What Is a Magic Square? How They Work and How to Solve Them
Magic squares are one of the oldest number puzzles in the world — they turn up in ancient China, medieval art, and modern math classrooms. The idea is simple and strangely satisfying: arrange numbers in a grid so every line adds up to the very same total. Here's how magic squares work, the neat math behind them, and how to solve and build your own.
The rules of a magic square
A magic square is an n×n grid filled with different whole numbers so that the sum of each row, each column, and both main diagonals is identical. A 'normal' magic square uses the consecutive numbers 1 through n² — so a 3×3 uses 1–9, a 4×4 uses 1–16, and so on.
That single shared total is the heart of the puzzle. It's called the magic constant, and everything about solving a magic square comes back to hitting it on every line.
The magic constant
You don't have to guess the target — you can calculate it. For a normal n×n magic square, the magic constant is n × (n² + 1) ÷ 2.
- 3×3: 3 × (9 + 1) ÷ 2 = 15.
- 4×4: 4 × (16 + 1) ÷ 2 = 34.
- 5×5: 5 × (25 + 1) ÷ 2 = 65.
How to solve a 3×3 magic square
The 3×3 is the classic, and it has a beautiful shortcut. Two facts unlock it: the magic sum is 15, and the center cell is always 5. From there the placement is fixed by a simple pattern:
- Put 5 in the center — it's the middle value of 1–9 and sits on four of the lines.
- Place the even numbers (2, 4, 6, 8) in the four corners.
- Place the odd numbers (1, 3, 7, 9) in the four edge cells.
- Keep pairs that add to 10 opposite each other through the center (1–9, 2–8, 3–7, 4–6).
- Check every row, column, and diagonal totals 15 — adjust a pair if a line is off.
Bigger squares and a solving mindset
For 4×4 and 5×5 puzzles you usually start from a partly filled grid and reason line by line: find a row, column, or diagonal with just one blank and fill in the number that reaches the magic constant. Each fill tightens the others, so the square unravels a step at a time — no guessing needed.
It's the same logic muscle sudoku uses, which makes magic squares a friendly warm-up and a great classroom tool for practicing mental addition.
Make your own printable magic square
Our magic square generator builds fresh 3×3, 4×4, and 5×5 puzzles with the magic constant shown, so you always know the target. Play right in your browser, or download a clean printable PDF with the answer key on page two. It's free, prints sharply in black and white, and needs no signup.
Frequently asked questions
What is a magic square?+
A magic square is a grid of different numbers arranged so that every row, every column, and both main diagonals add up to the same total. That shared total is called the magic constant or magic sum.
What is the magic constant?+
It's the sum that every row, column, and diagonal must reach. For a normal n×n square using the numbers 1 to n², the magic constant equals n × (n² + 1) ÷ 2 — so a 3×3 square using 1–9 has a magic constant of 15.
How do you solve a 3×3 magic square?+
Remember two facts: the magic sum is 15, and the center must be 5. The four even numbers (2, 4, 6, 8) go in the corners and the odd numbers (1, 3, 7, 9) go in the edges, with each pair that adds to 10 sitting opposite the center.
Is there always one solution?+
Our puzzles are built by blanking cells from a valid magic square and only removing a cell while the square can still be completed one way, so each printable puzzle has a single intended solution.
Are the magic square puzzles free to print?+
Yes. Generate 3×3, 4×4, or 5×5 magic squares and play, print, or download them free with an answer key — no signup.
Ready to Play or Print?
Put these techniques to the test with our free, interactive generator. Play online with instant hints or generate custom print-ready PDFs with answer keys.
Related Guides & Solving Tutorials
Explore companion techniques, printable classroom tips, and game strategies.
What Are Number Pyramids? How to Solve Them (and Why They Help)
Number pyramids pack a lot of addition into one neat puzzle — each brick is the sum of the two below it. Learn how to solve them, why they build careful adding, and make free printable number pyramid worksheets.
How Cryptograms Work (and How to Solve Them)
Understand what a cryptogram is, how substitution ciphers work, and the letter-frequency tricks that crack them fast. Make your own cryptogram from any phrase and print it free.
What Is Killer Sudoku? How to Solve It (Beginner's Guide)
Learn what killer sudoku is and how to solve it — the cage rules, the '45' trick, and simple cage-sum combinations. Play free online or print puzzles with the answer key.