Calculators
Chessboard Square Calculator
Count squares of every size on an n × n chessboard or square grid using exact browser-only arithmetic.
Count all axis-aligned squares on an n × n board, including every size from 1 × 1 to n × n. Enter a positive integer of up to 100 digits. Results stay in your browser.
How to count all squares on a chessboard
On an n × n board, a k × k square can start in (n − k + 1) positions in each direction, giving (n − k + 1)² squares of that size. Summing over k = 1 through n gives 1² + 2² + … + n² = n(n + 1)(2n + 1)/6. An 8 × 8 chessboard has 64 unit squares and 204 squares of all sizes, including 140 larger squares. A 1 × 1 board has exactly one square. The calculation counts axis-aligned squares whose sides follow the grid lines, regardless of cell color. It excludes tilted squares, nonsquare rectangles and boards with missing cells. Enter a positive whole number using up to 100 decimal digits. Leading zeros and surrounding whitespace are accepted; signs, decimals, separators and scientific notation are rejected. Exact BigInt arithmetic preserves every result digit. All calculations run locally in your browser.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
How many squares are on a chessboard?
An 8 × 8 chessboard contains 204 axis-aligned squares of all sizes: 64 unit squares and 140 larger squares.
What formula counts all squares on an n × n board?
Use n(n + 1)(2n + 1)/6, the sum of the first n squared integers.
Are tilted squares included?
No. This counts only squares whose sides follow the grid lines, with corners at grid intersections.
Does the color of each square matter?
No. The count includes every axis-aligned square regardless of the colors of the cells inside it.
Can I use a rectangular board?
This calculator assumes equal row and column counts. Rectangular boards need a different sum based on both dimensions.