Math

The math of Quarto: 16 pieces as a 4D hypercube

By Alejandro Rioja · October 28, 2026

The 16 Quarto pieces are the 16 corners of a four-dimensional cube, a tesseract. Write each piece as four binary digits, one per trait, and every Quarto idea becomes geometry. Two pieces share 3 traits when they're joined by an edge (there are 32), and a piece's opposite is the far corner. The 8 pieces sharing a trait, like all 8 dark pieces, form one of the tesseract's 8 cubic cells. A winning line is four corners of the same cell, which is why exactly 536 of the 1,820 groups of four pieces can win.

About us: we make Quads, a game built on the same mechanic as Quarto, and not affiliated with Gigamic. Every count on this page was checked by enumerating all cases by computer.

16pieces = corners of a 4D cube
32pairs differing in one trait = edges
8trait values = cubic cells
24groups sharing two traits = square faces

Every piece is a 4-bit number

Give each trait a digit: 1 for tall, dark, square or solid, 0 for short, light, round or hollow. Each piece becomes a 4-digit binary number, and the 16 pieces are exactly the numbers 0000 to 1111. The full chart of the pieces lists them all. This is also how the Quads app stores a piece: as a number from 0 to 15.

PieceNameBinary (top, shape, colour, height)Number
short light round hollow00000
tall light square hollow01015
short dark round solid101010
tall dark square solid111115

With pieces as binary numbers, two operations do most of the work:

From a square to a tesseract

Two traits give 4 pieces, which you can draw as the corners of a square. Three traits give 8, the corners of a cube. Four traits give 16, the corners of a tesseract, the four-dimensional cube. You can't build one, but you can draw its shadow, as below. Each piece sits at a corner, and moving along a line changes exactly one trait.

The 16 Quarto pieces as the corners of a tesseract

heightcolourshapetop
Each line joins two pieces that differ in one trait only, coloured by the trait that changes. Every piece has four neighbours, one per trait, and there are 32 lines in all: the 32 edges of a four-dimensional cube.

Distance: how alike two pieces are

The number of traits two pieces don't share is their distance, the fewest edges you'd walk between them (mathematicians call it the Hamming distance). Every piece has the same view of the rest of the set:

Traits sharedDistancePieces at that distance (from any piece)Pairs in the whole setIn the tesseract
31432edges
22648diagonals of square faces
13432diagonals of cubic cells
0418long diagonals (opposite corners)

The 4-6-4-1 pattern is the row of Pascal's triangle for 4: there are "4 choose k" ways to differ in k traits. The total of all 120 pairs checks out: 32 + 48 + 32 + 8 = 120.

Winning groups are corners of a cell

A cube has 6 square faces. A tesseract has 8 cubic cells, and each one is the set of 8 pieces with one trait value in common: all tall, all short, all dark, and so on. Four pieces win when they share a trait, which in the drawing means all four corners lie in the same cell.

No four pieces can share three traits, because three traits pin down an edge, and an edge has only 2 corners. Our computer count agrees on every figure: 512 groups share exactly one trait, 24 share exactly two and none share three.

Why a line of three has 5 or 9 winners

Three pieces in a line, and you're about to hand over the fourth. How many of the other 13 pieces are dangerous?

That's the most practical fact on this page. A line whose three pieces share two traits is nearly twice as hard to defend as one that shares a single trait. The endgame guide turns it into a counting method.

384 ways to relabel the traits

Swap "dark" and "light" on every piece and nothing about the game changes: groups that shared a trait still do. The same goes for reordering the traits, say treating colour as height and height as colour. Combining the 24 = 16 ways to flip traits with the 4! = 24 ways to reorder them gives 16 × 24 = 384 relabelings, exactly the symmetries of the tesseract. One consequence: every piece is equivalent to every other, so the first piece handed over in a game makes no difference.

The board has symmetries of its own: 32 under classic rules, and 8 once 2×2 squares count. We found both by searching every rearrangement of the 16 cells. See which squares matter for what they mean in play.

Using this in a classroom

A Quarto set is a hands-on model of binary numbers, sets and higher-dimensional geometry. Some activities that follow from this page:

  1. Sort the pieces into a square, then a cube. Fix two traits and arrange the other 4 pieces as a square, then 8 as a cube. Ask what 16 would need.
  2. Find a piece's neighbours. Pick any piece and find the 4 that differ in exactly one trait. Every piece has 4: why?
  3. Count the winning groups. Have students reproduce 8 × 70 − 24 = 536.

Our classroom guide has four ready-to-run activities for ages 7 and up, and the comparison with SET shows the same idea with three values per trait instead of two.

Frequently asked questions

What is the math behind Quarto?

Each piece is a 4-bit binary number, one bit per trait, so the 16 pieces are the corners of a four-dimensional cube. Pieces sharing a trait form one of its 8 cubic cells, and four pieces win when they are corners of the same cell.

How many groups of four Quarto pieces share a trait?

536 of the 1,820: 8 trait values times 70 groups each, minus the 24 groups that share two traits and were counted twice.

Why are there 16 pieces in Quarto?

Four traits with two options each give 2 x 2 x 2 x 2 = 16 combinations, and the set has one piece for each.