Magic square solver

Enter the numbers you know and see whether the solver can complete the square.

Every line adds up to15

Every line adds up to 15, using the numbers 1 to 9 once each.

One answer. Only this square fits the numbers you entered.
Answer 1
816357492

Dark squares are the numbers you typed. Yellow squares were filled in by the solver.

How to play

Choose a 3 × 3 or 4 × 4 square and type the numbers you know. The solver fills in the rest, or tells you when more than one square fits or none does.

  • Type only numbers you are sure of.
  • A line marked with a cross cannot reach the total.
  • Press Example to see a square with one answer.

Magic square solver

A magic square solver fills a three by three or four by four square from the numbers you enter. Leave unknown cells empty to solve a magic square, count its possible answers, and see which line forced each number.

How the solver finds answers

The solver tries possible numbers in the empty cells one at a time. If a choice makes a row, column, or diagonal unable to reach the required sum, it drops that choice and tries another. It then counts the completed squares that fit your entries.

Solve a three by three square by hand

For a standard three by three magic square using consecutive whole numbers, the center is 5. Even numbers go in the corners, and opposite cells add up to 10. Use those relationships to narrow down where each number can go, then check every row, column, and diagonal.

Check a square from a book or class

Enter every number from the square, then let the solver check it. It marks any row, column, or diagonal that does not add up to the same total, so you can spot a copied number or a line that needs another look.

Questions

What numbers can I use?

Use a run of consecutive whole numbers, with each number appearing once. Enter the numbers you have in the cells and leave the others empty. The solver checks whether your entries can form a valid square.

What if there are two answers?

The solver tells you when there are two possible completions and shows both. Compare them with the numbers you entered or use the line clues to see how each answer fits.

Does it work for four by four?

Yes. You can enter known numbers in a four by four square, leave the remaining cells empty, and ask the solver to find and count completions.

More puzzles