Skip to content

How to read a matrix

A matrix is the text laid out in rows so that a sequence becomes a straight line you can see. It is the picture everyone associates with Torah codes, and the easiest thing in this field to misread. Here is how it works.

The text, in rows

Take the letters of Genesis with no spaces and cut them into rows of equal length. Hebrew reads right to left, so each row starts on the right and the next row picks up where the last one ended. No letter is moved. The rows are only a way of looking at one long line.

Now choose a row width equal to a sequence's skip. Each letter of the sequence falls exactly one row below the last, in the same column. Here is the top right corner of Genesis at width 50. Twelve columns of the fifty are shown.

Genesis at width 50, first 12 columns. The lit letters are תורה at skip 50, starting from letter 6.

Read down the lit column and you get ת, ו, ר, ה. Read across the top row and you have the opening of the Torah, בראשית ברא, with the final letters written in their regular forms. Every letter in a matrix is a real letter of the text in its real place. Tap one in the laboratory and its verse opens with that letter marked.

Choosing a width

The width decides the shape of the sequence. At a width equal to the skip, it stands straight. At half the skip, it skips every second row in one column. At other widths it runs on a slant, something like a chess knight's move. WRR used this. For a skip d, they looked at the widths nearest to d/1, d/2 and so on up to d/10, because those are where a sequence looks compact.

In the laboratory, the width slider snaps to useful values and Best fit picks a width that frames what you selected. Any width is fine for looking. Here is the catch: there are thousands of widths, and each gives a different picture. If you slide the width until two words look close, the picture you stop on was picked by you. The trial counter notes every width you settle on, and it should.

Two or more terms

Add a second term and the laboratory colors each one and draws the closest appearances into view. The Shortest window is the shortest stretch of text holding one sequence of every term. The rectangle view gives the smallest block of the matrix holding all of them.

A tight rectangle is what people mean when they say a word is "next to" another. Two things decide how meaningful that is. How many sequences did each term have? A term with 95,000 sequences will land near almost anything. And how many rectangles would chance give? There is no formula for that. Press Run 25 shuffles and the laboratory rebuilds the window on shuffled text. You get a line such as: "This window is the shortest that holds every term: 613 letters. Among 1,000 shuffled texts, 61% had a shorter one."

Wrap, the cylinder and row-split

A flat page has edges. A sequence that runs off the left side continues on the right, one row down. WRR pointed out that if you paste the two edges together you get a cylinder, and the text winds down it as one line. The 3D cylinder view shows this directly. The toroidal option does the same on a flat matrix, wrapping lines across the edge so you do not lose them.

Row-split is an older display idea that some desktop programs had. It divides each row into 2 to 11 layers, which lets you see a long skip in a compact form. It changes the view and nothing else. The positions stay the same.

Plain words in the picture

Turn on Show words and the laboratory marks where real words of the text pass through the matrix. Across a row, the letters that belong to one word in the verse are grouped. This helps you stay honest about what you are looking at. Words read across a row are the plain text of the Torah. A sequence read down a column is a measurement of equal spacing. They are different kinds of thing, and a good picture never blurs them.

What a matrix cannot do

The matrix is a strong picture, and that is its danger. The eye is very good at finding shapes. McKay's matrices from Moby Dick look just as striking as any from the Torah, and they were made to show exactly that. Brendan McKay's point was that a matrix with free choice of words, spellings, widths and windows can be built for almost any subject.

  • Report the terms you searched and did not find, as well as the ones you did.
  • Say how the width was chosen.
  • Do not quote the size of the final window as if it were the search space. A rectangle of 300 letters was found by looking through the whole text.
  • Check the shuffled texts before you trust your eye.

When you export a matrix from the laboratory, the verification line goes with it: the stream version and a short hash of the search. With the share link, anyone can rebuild your picture and see how you got there.

Open a matrix in the laboratory

Sources

Checked against its sources on 2026-10-31.