How to Complete a 3x3 Magic Square Without Guessing

Last edited Oct 12, 2026 · 4 min read

A magic square is a grid of numbers where every row, every column, and both diagonals add up to the same total. NRICH, the mathematics enrichment project at the University of Cambridge, calls that shared sum the "magic total," and its introduction to magic squares traces the idea back to the ancient Chinese Lo Shu square.

Most people try to fill a magic square by trial and error. For a 3x3 square you never need to. Three facts pin down almost everything, and they work for any set of nine numbers, not just 1 to 9. Below are the three facts, why they are true, and three original puzzles. Every puzzle was checked against all possible arrangements and has exactly one completed square.

1. Fact 1: the magic total is the grand total divided by 3

The three rows together contain all nine numbers once each. So the three row totals add up to the sum of all nine numbers, and each row gets one third of it.

For the numbers 1 to 9, the grand total is 45, so the magic total is 15. NRICH asks readers to work this out from the numbers alone, and this is the reason it works.

2. Fact 2: the center is the magic total divided by 3

Four lines pass through the center: the middle row, the middle column, and both diagonals. Together they cover every cell once, except the center, which they cover four times. So:

  • four lines add up to 4 times the magic total, and
  • that equals the grand total plus 3 extra copies of the center.

For 1 to 9 this gives 60 = 45 + 3 times the center, so the center is 5. In general the center is always one third of the magic total.

3. Fact 3: opposite cells add up to twice the center

Any line through the center has the form "one cell, center, opposite cell," and it adds up to the magic total, which is 3 times the center. Take away the center and the two outer cells must add up to 2 times the center. NRICH points out the 1 to 9 version: across the 5, the pairs 8 and 2, 6 and 4, 1 and 9, and 3 and 7 all make 10.

A bonus pattern for the classic 1 to 9 square: checking all possible arrangements shows there are exactly 8 magic squares, all rotations and reflections of one another, and in every one of them the corners are even (2, 4, 6, 8) and the edge-middle cells are odd. So if a puzzle asks for a 1 to 9 square, you can place the 5 and the even numbers first.

4. The method in four steps

  1. Add up all nine numbers and divide by 3 to get the magic total.
  2. Divide the magic total by 3 and write that in the center.
  3. For every given number on the edge of the grid, fill its opposite cell using "twice the center minus this number."
  4. Finish any row or column that has two numbers already.

5. Puzzle 1: the numbers 4 to 12

Use each of the numbers 4 to 12 once.

Left Middle Right
Top . . 9
Middle . . .
Bottom . 6 .

6. Puzzle 2: the even numbers 2 to 18

Use each of 2, 4, 6, 8, 10, 12, 14, 16, and 18 once.

Left Middle Right
Top . 18 .
Middle . . .
Bottom . . 12

7. Puzzle 3: mystery numbers

This time you are not told which nine numbers are used, only that the result is a magic square with nine different whole numbers.

Left Middle Right
Top 16 3 .
Middle . 10 .
Bottom . . .

8. Answers

Puzzle 1. The numbers 4 to 12 add up to 72, so the magic total is 24 and the center is 8. Opposite pairs add up to 16. The 9 in the top right puts 7 in the bottom left; the 6 in the bottom middle puts 10 in the top middle. The top row then needs 24 minus 10 minus 9, which is 5, and its opposite corner is 11. The middle row gets 12 and 4.

Left Middle Right
Top 5 10 9
Middle 12 8 4
Bottom 7 6 11

Puzzle 2. The nine even numbers add up to 90, so the magic total is 30, the center is 10, and opposite pairs make 20. The 18 puts 2 in the bottom middle and the 12 puts 8 in the top left. The top row then needs 4 on the right, which puts 16 in the bottom left. The middle row gets 6 and 14.

Left Middle Right
Top 8 18 4
Middle 6 10 14
Bottom 16 2 12

Puzzle 3. Fact 2 works backward: with 10 in the center, the magic total is 30 and opposite pairs make 20. The top row needs 30 minus 16 minus 3, which is 11. Opposites give 4 in the bottom right, 17 in the bottom middle, and 9 in the bottom left. The left column then needs 5 in the middle, and its opposite is 15.

Left Middle Right
Top 16 3 11
Middle 5 10 15
Bottom 9 17 4

Check any line in any answer and it reaches the magic total: 24, 30, and 30.

9. Key takeaways

  • The magic total of a 3x3 magic square is the sum of all nine numbers divided by 3.
  • The center is always one third of the magic total, so you can place it before anything else.
  • Cells directly opposite each other across the center always add up to twice the center.
  • For the numbers 1 to 9 there are only 8 magic squares, all reflections or rotations of one pattern, with even numbers in the corners.
  • When the numbers are unknown, the center alone still tells you the magic total.

Sources

  1. NRICH, University of Cambridge Millennium Mathematics Project, An Introduction to Magic Squares
  2. NRICH, University of Cambridge Millennium Mathematics Project, Magic Squares
CategoriesPuzzle Breakmagic squaresnumber puzzlesmath games