How to Make a 3×3 Magic Square Step by Step

A magic square is a grid of numbers where every row, every column, and both diagonals add up to the same total. The classic 3×3 version uses the numbers 1 to 9, and its magic total is 15. It looks like a puzzle, but there is a simple method that builds it perfectly every time, with no guessing.

First, find the magic total

For a 3×3 square using the numbers 1 to 9, the magic total is easy to work out. Add all nine numbers: 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 = 45. There are three rows, and each row must have the same total, so divide 45 by 3 to get 15. Every row, column, and diagonal in your finished square must add to 15. This also tells you the middle number: the centre cell belongs to one row, one column, and both diagonals, so it must be the average of the numbers, which is 5. In every normal 3×3 magic square, 5 sits in the centre.

The up-and-right method, step by step

Draw an empty 3×3 grid. Step one: put 1 in the middle box of the top row. Step two: move one square up and one square right to place the next number. If you move off the top edge, wrap around to the bottom row; if you move off the right edge, wrap around to the left column. Step three: if the square you land on is already filled, place the number in the box directly below the previous number instead. Repeat until you have placed 9.

Walked through, it looks like this. Place 1 in the top middle. Move up and right, wrapping to the bottom right, and place 2 there. Move up and right again, wrapping to the middle left, and place 3. The next up-and-right move lands on the top middle, which is taken by 1, so drop one square below the 3 and place 4 there. Continue the pattern: 5 lands in the centre, 6 in the top right, 7 in the middle right after a collision drops it below the 6, 8 in the top left after wrapping, and 9 in the bottom middle. The finished square reads 8, 1, 6 on the top row, 3, 5, 7 in the middle, and 4, 9, 2 on the bottom row. Check it: top row 8 + 1 + 6 = 15, middle row 3 + 5 + 7 = 15, bottom row 4 + 9 + 2 = 15, and both diagonals, 8 + 5 + 2 and 6 + 5 + 4, also equal 15. If your grid matches those sums, your square is correct.

Why the method works for any odd square

The same up-and-right method builds 5×5, 7×7, and larger odd squares, which is why it is worth learning properly rather than memorising one answer. The wrap-around rule keeps the pattern going at the edges, and the drop-down rule resolves collisions. Even squares, such as 4×4, need a different method, so do not force this one onto them.

Making a magic square with different numbers

You are not limited to 1 to 9. Take any nine numbers in an evenly spaced sequence, for example 7, 8, 9, 10, 11, 12, 13, 14, 15. The middle number of the sequence, 11, goes in the centre, and the magic total is three times the middle number, which is 33. Place the numbers in order using the same up-and-right method, and every line will add to 33. This is handy for classroom exercises and for puzzles where the target total is fixed in advance: pick a middle number one third of the target, build the sequence around it, and the square follows.

Checking your work

Add each row, each column, and both diagonals, eight sums in total. All eight must equal the magic total. If one line is off, the error is usually a swapped pair of numbers or a misapplied wrap rule; rebuild from the start rather than patching, because a patched square often hides a second error. Once all eight sums check out, your magic square is done.

Try it free right here

Use the free Magic Square Generator below, right on this page. It runs in your browser and needs no sign-up. You can also open the full tool here: Magic Square Generator.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top