How Many Squares Are on a Chessboard? The Counting Trick
A chessboard holds 204 grid-aligned squares of all sizes, not just the 64 smallest. Count each size separately, from 1 by 1 through 8 by 8.
On this page▾
Count each size separately; the method also works on rectangles and grids of dots. The four original puzzles were checked by listing every possible square one at a time.
Count one size at a time
Ask how many different sizes of square there are, and how many squares of each size. On an 8 by 8 board the sizes run from 1 by 1 up to 8 by 8.
Now ask where the top-left corner of each size can go.
- A 1 by 1 square can start in any of 8 columns and 8 rows: 8 times 8, or 64.
- A 2 by 2 square needs one extra column and row of room, so it can start in only 7 columns and 7 rows: 49.
- A 3 by 3 square can start in 6 by 6 places: 36.
The pattern continues all the way down to the single 8 by 8 square, which fits in exactly one place.
| Square size | How many fit |
|---|---|
| 1 by 1 | 64 |
| 2 by 2 | 49 |
| 3 by 3 | 36 |
| 4 by 4 | 25 |
| 5 by 5 | 16 |
| 6 by 6 | 9 |
| 7 by 7 | 4 |
| 8 by 8 | 1 |
| Total | 204 |
For any square grid of side n, the total is the sum of the square numbers from 1 times 1 up to n times n.
A chessboard has 204 squares (64 small and 140 larger), and a side-k square fits in (n minus k plus 1) positions in each direction, so multiply and add across sizes.
The same trick on a rectangle
On a rectangular board the idea is unchanged, but the two directions give different counts. On a grid that is m squares tall and n squares wide, a square of side k fits in (m minus k plus 1) rows and (n minus k plus 1) columns. Multiply those, and add over every size that fits.
NRICH's Squares in Rectangles problem gives two worked totals you can test this on: a 2 by 3 rectangle contains 8 squares (6 small plus 2 of size 2), and a 3 by 4 rectangle contains 20 (12 plus 6 plus 2). NRICH then asks which rectangles contain exactly 100 squares. That one is left for you.
Squares that tilt
On a grid of dots, squares do not have to sit level. Four dots can form a square standing on its corner, as long as all four sides are equal and every corner is a right angle. These tilted squares are easy to miss, and they are the main trap in dot-grid counting puzzles.
A quick way to spot them: pick two dots and walk from one to the other, say 1 step right and 1 step up. Turn 90 degrees and repeat the same walk (1 step left and 1 step up). If you land on dots each time and close the shape, you have a square, tilted or not.
Puzzle 1
How many squares of all sizes are there in a 5 by 5 grid?
Puzzle 2
How many squares of all sizes are there in a grid 3 squares tall and 5 squares wide?
Puzzle 3
A strip of squares is 2 squares tall. How many squares long must it be to contain exactly 20 squares of all sizes?
Puzzle 4
A 4 by 4 grid of dots has 16 dots in total, evenly spaced. How many squares can you draw with all four corners on dots, counting tilted ones?
Answers
Puzzle 1: 55. Add 25 + 16 + 9 + 4 + 1.
Puzzle 2: 26. Size 1: 3 rows times 5 columns is 15. Size 2: 2 times 4 is 8. Size 3: 1 times 3 is 3. Squares of size 4 do not fit, so the total is 15 + 8 + 3 = 26.
Puzzle 3: 7 squares long. In a strip 2 tall and n long, there are 2n small squares and n minus 1 squares of size 2, for a total of 3n minus 1. Setting 3n minus 1 equal to 20 gives n = 7. No other length works, because each extra column adds exactly 3 squares.
Puzzle 4: 20. The dots outline a 3 by 3 grid of level squares, which gives 9 + 4 + 1 = 14. The other 6 are tilted. Four use a "1 across, 1 up" side: each fits inside a 3 by 3 block of dots, and the grid has four such blocks. Two more use a "1 across, 2 up" side (or "2 across, 1 up") and stretch across the whole grid. A full check of every set of four dots found exactly 20 squares.
Tips for counting puzzles
- Count by size, not by eye. Scanning a picture for squares always misses some. A table of sizes never does.
- Use corners. Asking where the top-left corner of each size can go turns counting into multiplication.
- Start small. Count a smaller board first. A 2 by 2 grid has 5 squares and a 3 by 3 grid has 14, and the pattern is easier to see from there.
- Check for tilted shapes whenever the puzzle uses dots rather than drawn lines.
The same count-by-size idea applied to dominoes is covered in How Many Dominoes Are in a Set? Double-6, Double-9 and More.
Sources
About this guide
Howlane operator · Checked against the official sources listed above. It is general information, not professional advice.
AboutEditorial standardsCorrectionsReport an error
Edit history
- Updated
- Updated
- Updated
- Updated
- Published