Magic Square

Arrange the numbers so every line sums the same.

How to play Magic Square

816357492
Tap a number, then a cell to place it

Place each of the numbers into the grid so that every row, every column, and both main diagonals add up to the same "magic" total shown. Click a number tile, then a cell. Completed lines that hit the target are highlighted. Fill them all to solve it.

Find the magic total first

Before placing a single tile, work out the number every line has to hit. For the classic three-by-three using 1 through 9, it's 15, and there's a tidy reason. All nine numbers add up to 45, spread across three rows, so each row must carry a third of that. The same shortcut gives you the target for any size. It also hands you the middle: in a three-by-three the center cell is always the total divided by three, which is 5, because it belongs to four different lines at once (a row, a column, and both diagonals), and they all have to balance around it.

Build out from the middle

With 5 pinned in the center, the rest falls into a pattern. The even numbers 2, 4, 6 and 8 take the corners, and the odd numbers fill the edge cells, because each pair on opposite sides of the 5 has to add to 10.

The pairing idea deserves one worked line. Say the target is 15, the center holds 5, and a diagonal shows 8 in one corner with the opposite corner empty. The two corners must add to 10, so the empty one takes 2, no trial and error needed. Every line through the center works like that, which is why fixing the middle first cuts the puzzle roughly in half. Practise reading lines that way and the tiles almost place themselves.

The Siamese method

For odd-sized squares there is a recipe so reliable it feels like a card trick. It's called the Siamese method because Simon de la Loubere, a French diplomat, brought it home from Siam (today's Thailand) in 1688. Put 1 in the middle cell of the top row. From there, always try to move one cell up and one cell to the right, wrapping around to the opposite edge whenever you fall off the board. If the cell you want is already taken, drop one cell straight down instead, then carry on climbing. That is the entire method.

Walk it on the three-by-three. The 1 goes top-middle. Up and right wraps you to the bottom-right corner for 2, then to the middle-left for 3. The next step lands on the 1, so 4 drops in below the 3, at bottom-left. Then 5 takes the center, 6 the top-right, 7 drops in below it, 8 wraps to the top-left, and 9 finishes the bottom row. Read the result: 8, 1, 6 across the top, 3, 5, 7 through the middle, 4, 9, 2 along the bottom, and every line makes 15. The same march fills a five-by-five or a seven-by-seven without a single decision to make, which is worth remembering the moment a bigger board turns up.

The Lo Shu and Durer's square

Magic squares are ancient. The three-by-three is the Lo Shu, which Chinese legend says was found on the shell of a turtle rising from the River Lo thousands of years ago. Squares like it were carried as talismans across many cultures, engraved on amulets from India to Europe. One of the most famous sits in Albrecht Durer's 1514 engraving Melencolia I: a four-by-four whose rows, columns and diagonals all make 34, with a signature hidden in plain sight, since the two middle cells of its bottom row read 15 and 14, the year of the print. Benjamin Franklin was another addict. He passed dull hours as a clerk of the Pennsylvania Assembly building monster eight-by-eight squares whose lines sum to 260, and stayed fond of them his whole life. There is even a magic square carved into the Passion facade of the Sagrada Familia in Barcelona, tuned so its lines add to 33. People have been hooked on this arithmetic for a very long time, and solving one by hand is a small taste of why.

Magic Square leaderboard

Top scores. Log in to compete.

  1. Loading leaderboard…

Magic Square: frequently asked questions

What is the magic total?

For a 3×3 using 1–9 it’s 15; the puzzle shows the target so you always know what each line must sum to.

Can a number repeat?

No. Each number is used exactly once.

How do I work out the magic total?

Add up all the numbers you're given and divide by the number of rows. For a three-by-three with 1 through 9 that's 45 divided by 3, which is 15. Every row, column and both diagonals must reach that same figure.

Why is the center of a 3x3 always 5?

The middle cell sits on four lines at once: one row, one column and both diagonals. For all of them to balance, it has to equal the magic total divided by three, which is 15 over 3, or 5. Fixing the center first makes everything else easier.

Where do the odd and even numbers go in a 3x3?

In the classic arrangement the even numbers 2, 4, 6 and 8 take the four corners, and the odd numbers 1, 3, 7 and 9 fill the edge cells, with 5 in the middle. Each number and its partner across the center add to 10.

Is there a method that always works?

For odd-sized squares, yes: the Siamese method. Start with 1 in the top-middle cell, keep stepping up and to the right (wrapping around the edges), and drop straight down one cell whenever the target square is taken. Follow it faithfully and the square completes itself.

Is there only one solution?

For the three-by-three there's essentially one arrangement, though you can rotate or mirror it into eight versions that look different. Larger squares have many more solutions, but the equal line-sum is always the single rule you're solving toward.

What's the trick when I'm stuck?

Think in pairs. Any two cells on opposite sides of the center must add up to the magic total minus the center number. If a line is one tile short of the target, that tells you exactly which value the empty cell needs.

Is Magic Square free to play?

Yes. Magic Square is completely free on Inkplay, with no download, no sign-up, and no in-game purchases. Open the page and play instantly on desktop or mobile.

Can I play Magic Square unblocked?

Yes. Magic Square runs entirely in your browser with no download, install, or plugins, so it loads instantly and keeps working even on school or work networks where bigger game sites get blocked.

More games to play

In the mood for more? Try 2048, Memory Match, Lights Out, Minesweeper, or browse all puzzle games and the full games list on Inkplay. Magic Square also appears in Math Games.

This game has been removed

It's no longer available. Try one of our other games instead.

Browse games