Skip to content
One Quick Try

Magic Square Puzzle

Place the numbers so every row, every column and both diagonals add up to the same total.

Type
Logic
Takes
about 1-5 min
Result in
seconds

Magic Square

~1-5 min

  1. Fill the square with the numbers in the tray, each once.
  2. Every row, every column and both diagonals must add up to the same total.
  3. Select a cell, then tap a number. Each line shows its total so far.
Square

Every puzzle has exactly one answer.

Your result: —

How it's measured
  • Kakuro

    Fill the grid so every run adds up to its clue.~3-8 min
  • Cross Math

    Place 1 to 9 so six equations come out right.~2-5 min
  • Make 24

    Use all four numbers to make 24.~2-4 min
  • Domino Puzzle

    Lay the dominoes so every region keeps its rule.~3-8 min
  • Skyscrapers

    Place buildings so each clue sees the right number.~2-6 min
  • Calcudoku

    Fill the grid so every cage makes its target.~3-8 min

What is a magic square?

A magic square is a grid of different numbers in which every row, every column and both long diagonals add up to the same total, called the magic sum. For the numbers 1 to n², the magic sum is n(n² + 1) ÷ 2: 15 for a 3 × 3 square of 1 to 9, and 34 for a 4 × 4 square of 1 to 16.

Three puzzles are here: the classic 3 × 3 with 1 to 9, a 3 × 3 with nine new numbers every game, and a 4 × 4 with 1 to 16. Some numbers are already placed; the rest wait in the tray. Select an empty cell and tap a number. Each line's total so far sits at its end and gets a tick when the line is full and right.

How is your Magic Square Puzzle time calculated?

Your result is the time from Start until every line makes the magic sum. Next to it are your moves (each number placed in a cell) and the hints you used (each places one number, or fixes a wrong one). There is no Check button: the totals are plain arithmetic on the screen, so you can always see which lines are right.

There is no rating, because no published typical time exists for puzzles built like these. The 4 × 4 takes much longer than either 3 × 3: it starts with 7 of its 16 numbers placed.

How do you solve a 3 × 3 magic square?

Start in the middle. The centre of any 3 × 3 magic square is one third of the magic sum: 5 for the numbers 1 to 9. The two numbers on either side of the centre, in any line through it, add up to twice the centre (10 for 1 to 9). With 1 to 9, the even numbers always sit in the corners and the odd ones in the middle of each side. The site's tests check both facts against every arrangement.

Every 3 × 3 magic square has the same shape around its centre c: c − b, c + a + b and c − a across the top, for some numbers a and b. That is how the "new numbers" puzzles are made. With c = 5 it gives the oldest known magic square, the Lo Shu:

2 7 69 5 14 3 8

How do you solve a 4 × 4 magic square?

Every line makes 34, and so do two groups that aren't lines: the four corners, and the four numbers in the middle. That holds in every one of the 7,040 magic squares of 1 to 16, which the site's tests list and check one by one. Fill a line or a group with one number missing first, then look for numbers in the tray that only fit one place.

How many magic squares are there?

With 1 to 9 there is only one 3 × 3 magic square, shown 8 ways by turning and flipping it. With 1 to 16 there are 880 essentially different 4 × 4 squares, or 7,040 counting turns and flips, first listed by Bernard Frénicle de Bessy in 1693. Every puzzle here keeps enough numbers on the board for exactly one way to finish, which the code checks by trying them all.

Where do magic squares come from?

The 3 × 3 square was known to Chinese mathematicians by about 190 BCE. Legend tells of a turtle that rose from the Luo River with the Lo Shu pattern on its shell. In Europe the best-known magic square is in Albrecht Dürer's engraving Melencolia I: a 4 × 4 square whose bottom row shows 15 and 14, the year it was made, 1514.

For a puzzle of sums in a crossword, try Kakuro; for making a total from four numbers, Make 24.

Questions

What is the magic sum of a 3 × 3 magic square?
15 for the numbers 1 to 9. For any 3 × 3 magic square it is three times the middle number, so a square with 10 in the middle adds up to 30 in every line.
What number goes in the middle of a 3 × 3 magic square?
A third of the magic sum. With 1 to 9 that is always 5.
Do the diagonals have to add up too?
Yes. A square where only the rows and columns match is sometimes called semi-magic; a magic square needs both long diagonals as well.
Why is there no Check button?
Every line shows its total as you go, and a full line that is right gets a tick, so you can always see where you stand. Hints are there if you get stuck.
What is a good time?
There is no published average for magic squares built like these, so the page doesn't invent one. The classic 3 × 3 goes quickly once you know the middle is 5; compare your own times on one kind.