Magic Squares

A classic number puzzle where rows, columns, and diagonals all add up to the same magic sum.

Practice
JuniorMathematics
Puzzles · Magic Square
Magic Square (hover to explore)
This is a ‘magic’ square.
Can you see what properties it has?
All row totals, all column totals, two diagonal totals are all the same!
Moreover, no number should be repeated.
Magic sum: 15Hover a cell to see sums
Guide

A quick idea

A magic square is a grid of numbers.

It is “magic” because:

  • Every row adds up to the same total
  • Every column adds up to the same total
  • Both diagonals add up to the same total
  • No number is repeated

That shared total is called the magic sum.

A tiny bit of history

The most famous 3×3 magic square is called the Lo Shu (pronounced “low shoo”).

A very old story from China says a turtle rose from a river with a pattern on its shell. People noticed something surprising: the numbers could be arranged so the sums matched in many directions.

Whether the turtle story is true or not, magic squares are real—and people have studied them for thousands of years.

How does it work?

Step 1: Find the magic sum

If you are using 9 different numbers, add them all up. Then divide by 3.

That works because a 3×3 grid has 3 rows, and each row must add to the same total.

Example with numbers 1–9:

  • Total: (1+2+3+4+5+6+7+8+9 = 45)
  • Magic sum: (45 ÷ 3 = 15)

Step 2: Check rows, columns, diagonals

When a square is finished, you can test it like a scientist:

  • Add each row
  • Add each column
  • Add the two diagonals

If every total matches the magic sum, you did it.

Examples

Below you can explore two example magic squares in a nicer visual style (hover a cell to see the row and column sums).

Try it yourself

  • Start with the interactive demo at the top of this page (hover to see sums)
  • Then try the practice problems below
  • Or open the sandbox to build your own puzzles and share them
Lo Shu (1–9)
A famous 3×3 magic square. Every row, column, and diagonal sums to 15.
Magic sum: 15Hover a cell to see sums
Another example (0–8)
Using 0–8, the magic sum is 12.
Magic sum: 12Hover a cell to see sums
Interactive Sandbox
Create your own magic square puzzles

Design custom puzzles with any set of 9 numbers, choose which cells to prefill as clues, and share your puzzles with friends via a link!

Open Sandbox
Practice Problems
Test your understanding with these problems
The Lo Shu Square
PrimaryDifficulty: 2/10
Zero to Eight
PrimaryDifficulty: 2/10
Even Magic
PrimaryDifficulty: 3/10
Triple Threat
PrimaryDifficulty: 3/10
Teen Square
PrimaryDifficulty: 4/10
Zero Sum Square
PrimaryDifficulty: 5/10
High Fives
PrimaryDifficulty: 5/10
The Challenger
PrimaryDifficulty: 6/10