Skip to content

Magic Square Maker and Solver

Make magic squares from 3×3 to 9×9, complete a partly filled one, check a filled one and print worksheets

Loading the tool…

Makes magic squares, completes a partly filled one, checks a filled one and prints worksheets with an answer key, for checking a 3×3 homework answer or learning how magic squares are built.

How to use

  1. On "Make", choose a "Size"; the square, its magic constant and the line sums appear at once.
  2. "Other shape" shows a rotated, reflected or rearranged square; "Copy table" copies it for a spreadsheet.
  3. On "Check and solve", type the numbers you know into a 3×3 or 4×4 grid and press "Fill the blanks". A full grid is checked and wrong lines turn red.
  4. On "Worksheet", set the options and press "Print"; puzzles and answers print on separate pages. "New version" changes the puzzle number.

How it works

Questions and answers

What is the answer to the 3x3 magic square?
Using 1 to 9 there is only one, up to rotation and reflection: 8 1 6 / 3 5 7 / 4 9 2. The centre is always 5 and every line adds up to 15.
How do you make a 4x4 magic square?
Write 1 to 16 in order, then replace each number on the two diagonals with 17 minus it. You get 16 2 3 13 / 5 11 10 8 / 9 7 6 12 / 4 14 15 1, with sum 34.
How do I solve a magic square with blanks?
Enter the given numbers on "Check and solve" and press "Fill the blanks"; a backtracking search finds an answer and says whether it is the only one.
Can I print the same worksheet again?
Yes. The same "Puzzle number (seed)" gives the same puzzles and answers.