×   Home   Blog   Newsletter   Privacy   Contact Us   About

How many squares on a chess board?

How many squares are there on a chess board? Depending upon your interpretation, this can be perceived as a trick question. The answer of 64 squares (8×8), is perfectly valid, but there is also an alternative answer if we count the squares of different sizes, not just the individual squares.
For instance, there is one square of size 8×8 units:
Then there are four squares of size 7×7 units:
And nine squares of size 6×6 units:
I'm sure you've probably seen a pattern by now. As we progressively make the target square smaller by one unit, we can find this a perfect square number of times. There are 2×2 starting positions a (7×7) square can start from, there are 3×3 starting positions a (6×6) square can start from …
The total number of squares is thus:
There's also a formula for quickly calculating the sum of squares. For a chess board, with n=8, we can see the sum is 204.
Interestingly, as n gets larger, this formula tends to n3/3. I'm sure there is some particularly cool consequence of this, but I can't think of one at the moment. If you think of one, drop me a note, and I'll update this page and give you credit!


Image: Isabel encourages peace for all history students

I received an nice email from Manos Kamarianakis who suggested that:

"A consequence of the sum of n2 tending to n3/3. It turns out to be quite simple and fascinating! Consider each number n2 to correspond to n2 little cubes of size 1, put in such way to form a square. For each n=1,2,3,… let us put this squares on top of each other (no need to centre them, thanks to Fubini's theorem). If we repeat this process infinitely, we can actually 'see' a pyramid forming, whose volume is indeed n3/3 = the sum of the cubes volume!"

I found a picture of such a Ziggurat, on the internet, made from sugar cubes!


How about the number of rectangles on a chess board? Well, to make a rectangle you need to pick any two of the vertical lines, and any two of the horizontal lines. There are 9C2 pairs of horizontal lines you can pick (36 distinct pairs), and the same number of vertical pairs, so the answer is 36×36=1,296.
Here's a table of the the first few square grids, and the number of squares and rectangles:
Board Size# Squares# Rectangles

2002 Puzzle

All of this started because I came across an old puzzle attributed to Erich Friedman, created, would you believe, in 2002:
Take an 18×18 grid of squares, and remove two of them so that the resulting figure contains exactly 2002 squares of all different sizes made from the remaining squares.
There's an answer on the internet, but I could not agree with it, so I wrote a bit of code to generate all the answers.
If you want to give it a go yourself, here's an applet below. In this variant, you can also specify different grid sizes and the number of shaded blocks you are allowed to set.


Did you find a solution? If you want to see all 64 solutions (not de-duplicated by rotations or reflections), click below.