Follow us
31 August 2026

The square-counting puzzle: why 16 is wrong and 30 is right

Hand-drawn 4x4 grid on paper with pencil, math puzzle illustration
Illustration © Toptenplay

The mistake is a classic failure of visual perception: the brain defaults to the most obvious, discrete units and ignores the larger structures formed by combining them. A 2×2 arrangement of cells is also a square. So is a 3×3 arrangement, and so is the entire 4×4 grid itself.

This cognitive shortcut is not a sign of low intelligence — it is how human pattern recognition works under low effort. The puzzle exploits exactly that tendency, which is why it spreads so reliably online and generates such confident wrong answers.

A puzzle built on a real mathematical principle

The square-counting puzzle is not just a viral trick — it is a direct application of the sum of squares formula, a foundational result in combinatorics. The formula n(n+1)(2n+1)/6 has been known for centuries and appears in fields ranging from statistics to computer science. The puzzle works as a trap precisely because it disguises a solvable math problem as a simple visual task.

The step-by-step count that reaches 30

The correct approach is to count squares by size, systematically working from the smallest to the largest. In a 4×4 grid, four distinct sizes exist.

4x4 grid with squares of different sizes highlighted in color for counting
Illustration © Toptenplay

1×1 squares: with 4 positions along each axis, there are 4 × 4 = 16. 2×2 squares: a 2×2 square can start at any of 3 horizontal and 3 vertical positions, giving 3 × 3 = 9. 3×3 squares: the starting position can shift only twice in each direction, yielding 2 × 2 = 4. 4×4 squares: only one possible position — the full grid itself — giving 1.

Adding them together: 16 + 9 + 4 + 1 = 30 squares. Each size category follows the same logic: the number of valid positions along one axis equals the total grid size minus the square size, plus one. Multiply the two axes and the count for that size is complete.

30
The correct number of squares in a standard 4×4 grid — not 16, as most people instinctively answer.

One formula that works for any grid size

The step-by-step method works, but mathematicians have condensed it into a single formula. For any n × n grid, the total number of squares equals the sum of squared integers from 1 to n: 1² + 2² + 3² + … + n².

Mathematical formula written in notebook for solving grid square counting puzzle
Illustration © Toptenplay

This simplifies to the closed-form expression n(n+1)(2n+1) / 6. For a 4×4 grid: 4 × 5 × 9 / 6 = 180 / 6 = 30. For a 5×5 grid: 5 × 6 × 11 / 6 = 330 / 6 = 55. The formula scales instantly to any grid without manual counting.

Advertisement
Share on Facebook