The Wheat and Chessboard Problem: The Legend and the Math

One grain on the first square, doubled on each of 64 squares, adds up to 2^64 − 1: about 18.4 quintillion grains. See the legend, the math and the answer.

The wheat and chessboard problem asks how much grain you get if you put one grain on the first square of a chessboard, two on the second, four on the third, and keep doubling until the 64th square. The answer is 2⁶⁴ − 1 = 18,446,744,073,709,551,615 grains, about 18.4 quintillion. That much wheat would weigh around 1.2 trillion metric tons, more than 1,400 times the world's entire yearly wheat harvest.

The puzzle comes with a famous story about the invention of chess. This page tells the legend (and why it is a legend, not history), works through the math step by step, and gives a few ways to use the problem in a classroom.

The legend of the wheat and the chessboard

Please read this part as a story. Nobody knows who invented chess, and there is no evidence that this conversation ever happened.

In the most common version, a wise man (often called Sissa, a minister at the court of an Indian king) invents chess and presents it to his ruler. The delighted king offers him any reward he wants. Sissa asks for something that sounds modest: one grain of wheat on the first square of the board, two on the second, four on the third, and so on, doubling each time across all 64 squares.

The king laughs at such a small request and orders his treasurers to pay. Days later they return with bad news: there is not enough wheat in the kingdom, or in the whole world, to fill the board. Depending on who tells the story, Sissa is made a high advisor for his cleverness or punished for embarrassing the king.

The oldest known written version is from 1256, by the Arab historian Ibn Khallikan, centuries after chess appeared. Other tellings use rice instead of wheat; one well-known version from Kerala in southern India has a king playing chess against the god Krishna in disguise and paying his debt in rice over many years. For what is actually known about where chess came from, read our history of chess.

How many grains of wheat are on a chessboard?

Square number n holds 2ⁿ⁻¹ grains, because the first square has 1 (2⁰) and each square doubles the one before it:

Adding all 64 squares gives 18,446,744,073,709,551,615 grains, which is exactly 2⁶⁴ − 1.

Why the total is 2^64 − 1

There is a neat trick that works for any doubling sum. Call the total S:

You can check the pattern on small boards. One square holds 1 grain (2¹ − 1), two squares hold 1 + 2 = 3 (2² − 1), three squares hold 1 + 2 + 4 = 7 (2³ − 1). The total is always one less than the next square. That is also why the last square alone holds more grains than all 63 squares before it put together.

How much would all that wheat weigh?

A grain of wheat weighs roughly 65 milligrams (estimates range from about 50 to 65 mg depending on the variety). With 65 mg per grain:

The first half of the board is a different story. Squares 1 to 32 hold 2³² − 1 = 4,294,967,295 grains, about 279 metric tons: a lot for one person, but easily paid by a kingdom. All the trouble is in the second half.

What is the "second half of the chessboard"?

The inventor and author Ray Kurzweil used the phrase in his 1999 book The Age of Spiritual Machines. His point: in the first half of the board, doubling feels manageable, but in the second half the numbers become so large that they change everything. People now use "the second half of the chessboard" for any technology that grows exponentially, such as computer chips, where steady doubling suddenly has a huge effect.

The first square of the second half (square 33, with 4,294,967,296 grains) holds one more grain than the entire first half.

Using the wheat problem in class

The legend is a favorite in math lessons because students can feel exponential growth:

More classroom ideas are in our chess lesson plans.

Sources

Frequently asked questions

How many grains of wheat are on a chessboard in total?

18,446,744,073,709,551,615 grains, which is 2⁶⁴ − 1, or about 18.4 quintillion. Square 64 alone holds 2⁶³, about 9.2 quintillion grains.

Is the wheat and chessboard story true?

No, it is a legend. The oldest known written version dates from 1256, centuries after chess was invented, and nobody knows who invented the game. The story survives because it is a perfect way to explain exponential growth.

How many grains are on the 64th square?

2⁶³ = 9,223,372,036,854,775,808 grains. That is one more than all of the other 63 squares combined.

What is the formula for the wheat and chessboard problem?

Square n holds 2ⁿ⁻¹ grains, and the first n squares hold 2ⁿ − 1 grains in total. For the full board, n = 64, so the total is 2⁶⁴ − 1.

Was it rice or wheat on the chessboard?

Both versions are told. Most English sources use wheat; versions from India and other parts of Asia often use rice. The numbers are the same either way, only the weight changes.

Keep learning

Related guides