Draw a three-by-three grid on a scrap of paper, write the numbers one to nine inside it, and something odd can happen: every row adds up to the same total, every column adds up to the same total, and both diagonals do too. Nothing is hidden, nothing is a trick of wording, and there is no clue to decode. The numbers simply sit in the one arrangement where the sums all agree. That arrangement is a magic square puzzle, and it has been quietly delighting people for thousands of years.

A magic square puzzle in one paragraph
A magic square puzzle is a square grid filled with numbers, usually each number used once, in which each row, each column and the two long diagonals all reach an identical sum. That shared total is called the magic constant, or magic sum. In the classic three-by-three version, the numbers one through nine are arranged so that each line totals fifteen. In larger squares the constant grows, but the idea never changes: one grid, one rule, one total running in every direction.
Most magic square puzzles you meet are called normal magic squares, which means they use the numbers from one up to the square of the grid size, each exactly once. A three-by-three normal square uses one to nine. A four-by-four uses one to sixteen. A five-by-five uses one to twenty-five. The numbers never repeat, and no number is skipped, which is part of what makes the puzzle so satisfying: the answer is a complete set, neatly used up.
The one rule that makes it magic
Everything in a magic square puzzle hangs on a single demand: the sums must match. Add the top row, and you get the magic constant. Add the middle column, and you get the same number again. Add a diagonal, and there it is once more. If even one line is off by a single point, the square is not magic, and there is no partial credit. The rule is absolute, which is why checking a finished square takes only a few seconds and yet feels so decisive.
The magic constant is not a mystery you have to guess. For a normal square of any size, there is a formula for it: take the size of one side, multiply it by the square of that size plus one, and halve the result. Written out, that is n times n squared plus one, all divided by two. For a three-by-three grid, the maths gives fifteen. For a four-by-four, it gives thirty-four. For a five-by-five, it gives sixty-five. Knowing the target before you start changes the whole feel of the puzzle, because every row you build is aimed at a number you already know.
Reading a three-by-three square, line by line
The smallest interesting magic square is three rows by three columns, and it is the best place to start because you can hold the whole thing in your head at once. Here is the classic arrangement, row by row:
Top row: eight, one, six.
Middle row: three, five, seven.
Bottom row: four, nine, two.
Now check it the way a solver would. Across the top, eight plus one plus six makes fifteen. Across the middle, three plus five plus seven makes fifteen. Across the bottom, four plus nine plus two makes fifteen. Down the left-hand side, eight plus three plus four makes fifteen. Down the middle, one plus five plus nine makes fifteen. Down the right-hand side, six plus seven plus two makes fifteen. The two diagonals behave too: eight plus five plus two is fifteen, and six plus five plus four is fifteen. Eight lines, one total, no exceptions.
Notice where the five sits: dead centre. That is not a coincidence. In any normal three-by-three magic square, the middle cell must hold the middle number of the set, and five is the middle of one to nine. The corners, meanwhile, must hold even numbers, and the edge centres must hold odd ones. Once you know that much, the square almost starts to build itself, which is why this size is a favourite first puzzle for children and a warm-up for adults.
The Lo Shu legend and a very old idea
Ask where magic squares come from, and the story usually starts on the banks of a river in ancient China. According to legend, a turtle climbed out of the Luo River carrying a pattern of dots on its shell, arranged three by three. The pattern was the Lo Shu, and the dots in each row, column, and diagonal added up to fifteen. The turtle became a symbol of wisdom, and the square became a sacred diagram, copied onto temples, coins, and amulets long before anyone thought of it as a puzzle.
How much of the legend is history and how much is storytelling is impossible to settle now, but the square itself is genuinely ancient. Chinese mathematicians were writing about the Lo Shu more than two thousand years ago, and the idea travelled along trade routes into India, the Arab world, and eventually Europe. By the Middle Ages, magic squares were being engraved on talismans and credited with powers far beyond arithmetic, which is probably how they got the word magic in their name.
Europe met the magic square properly in the sixteenth century, and the most famous European example sits inside a work of art. In 1514, the German artist Albrecht Dürer engraved a four-by-four magic square into his print Melencolia I, and he hid the date in it: the two middle numbers of the bottom row read fifteen and fourteen, spelling out 1514. Every line of that square totals thirty-four, and Dürer placed it beside the brooding winged figure as a symbol of order and reason. It is still the most looked-at magic square in the world, even if most people who see it have no idea what it is.
The main types you will meet
Not every magic square follows the same recipe, and the variations are where the puzzle grows from a parlour trick into a small world of its own. The normal square is the starting point, but these are the types worth knowing by name.
Normal magic squares. The standard version: numbers from one to the square of the side, each used once, with every line totalling the magic constant. The three-by-three and four-by-four squares in this article are both normal. When someone says magic square without any qualifier, this is almost always what they mean.
Pandiagonal squares. Also called most-perfect squares, these go one step further: not only the two main diagonals add up to the magic constant, but so do the broken diagonals, the ones that wrap around the edges of the grid as if the square were printed on a doughnut. A four-by-four pandiagonal square is a genuinely impressive object, and building one by hand is a proper challenge.
Associative squares. In an associative square, any two numbers sitting opposite each other across the centre add up to the same total. In a three-by-three normal square, that total is ten: eight pairs with two, one pairs with nine, six pairs with four, and the five in the middle pairs with itself. The Lo Shu square is associative, which is one reason it feels so balanced when you look at it.
Bigger squares, bigger constants
Once the three-by-three clicks, the natural question is what happens when the grid grows. The answer is that the puzzle gets roomier and stranger at the same time. A four-by-four normal square uses the numbers one to sixteen and every line must total thirty-four. There are 880 different four-by-four normal squares, ignoring rotations and reflections, which sounds like a lot until you remember that there are more than twenty billion ways to arrange sixteen numbers. Finding one of the 880 by trial and error alone is like finding a particular grain of sand on a beach.
Dürer’s four-by-four, from his 1514 engraving, is the most famous of them. Row by row, it reads: sixteen, two, three, thirteen; five, ten, eleven, eight; nine, six, seven, twelve; four, fourteen, fifteen, one. Add any row, any column, or either diagonal, and you get thirty-four. The bottom row even hides the year it was made. It is a good square to memorise, because it gives you a finished four-by-four to admire before you try building one yourself.
Five-by-five squares use one to twenty-five and a magic constant of sixty-five, and they introduce a lovely shortcut for odd-sized grids called the Siamese method. You start with the number one in the middle cell of the top row, then place each next number one step up and one step right, wrapping around the edges when you run out of grid. When a cell is already taken, you drop down one cell instead. Follow those two rules and a perfect five-by-five appears, as if the grid were filling itself in. The method works for any odd size, which is why seven-by-seven and nine-by-nine squares are far easier to build than their size suggests.

How a magic square differs from sudoku
Magic squares are often confused with sudoku, because both are grids of numbers and both reward careful placement. The resemblance is real but shallow, and knowing the difference saves a lot of confusion. In sudoku, every row, column and box must hold the digits one to nine once each, and the numbers are never added together. The puzzle is about position and elimination: which digit can go where. In a magic square, the digits can repeat across rows in the sense that each number appears once in the whole grid, and the whole point is the sum. Position matters only because it changes the totals.
Put another way, a sudoku is a puzzle about uniqueness, and a magic square is a puzzle about balance. A finished sudoku tells you nothing if you add its rows up; a finished magic square tells you everything if you do. The two puzzles exercise different muscles, which is why people who love one often enjoy the other, but they are not interchangeable, and a technique that works in one will usually fail in the other.
Kakuro sits somewhere between the two, and it is worth a mention because it is the other great number puzzle built on sums. In kakuro, each run of white cells has to total the clue number printed beside it, and no digit may repeat inside a run. It shares the magic square’s love of addition, but its totals change from run to run, and its grid is a crossword shape rather than a full square. If you enjoy the adding-up part of magic squares, kakuro is the natural next puzzle to try, and it will sharpen the same mental arithmetic.
Try one yourself
Reading about magic squares is pleasant, but the puzzle only really starts when a blank grid is in front of you. Here is a gentle one to try. Draw a three-by-three grid and fill it with the numbers one to nine, each used once, so that each line of the grid totals fifteen, but with one extra condition: the number one must sit in the top-right corner instead of the top-middle. That single change forces a different rotation of the classic square, and finding it will show you how the eight versions of the square relate to each other.
Questions people ask about magic squares
Is a magic square the same as a sudoku? No. A sudoku is solved by placing digits so every row, column and box holds one to nine once each, with no adding involved. A magic square is solved by placing numbers so each line of the grid reaches one shared sum. The grids look alike, but the rules and the thinking are different.
What is the magic constant of a three-by-three square? Fifteen. The numbers one to nine add up to forty-five, and forty-five shared equally across three rows is fifteen per row. The same reasoning gives thirty-four for a four-by-four and sixty-five for a five-by-five.
The bottom line
A magic square puzzle is a small machine made of numbers: a grid, a rule, and a single total that every line must reach. It is old enough to have a legend about a turtle, famous enough to appear in a Renaissance engraving, and simple enough for a child to finish on a rainy afternoon. The three-by-three teaches you the rule, the four-by-four teaches you patience, and the five-by-five teaches you a method that feels like a conjuring trick. Start with fifteen, aim every line at the same number, and enjoy the quiet click when the last cell falls into place.
For a deeper look at the number puzzles that sit beside it, read our guide to what a sudoku puzzle is, our explanation of the kakuro puzzle, and our broader tour of what logic puzzles are and how they work.