Skip to content
Once Books

Free magic square generator, with the answer

Pick a size and generate a magic square, then print it with its answer. Every puzzle has one completion, with no sign-up and no watermark. It runs on the same engine as our KDP Publisher Studio.

Preview

Difficulty

2 pages · US Letter · free

How to make a magic square

  1. Pick a difficulty. Choose a grid size from a gentle 3 by 3 up to a 5 by 5. Larger grids and fewer given numbers take longer to work out.
  2. Generate the puzzle. Press Generate puzzle. You get a grid with some numbers filled in and the magic total printed beneath it. Every puzzle has exactly one completion.
  3. Print the two pages. Press Print / save PDF. You get two pages: the puzzle on page one and the completed grid on page two.

Generate it with your AI assistant

Connect Once Books to ChatGPT, Claude or Cursor, then ask in plain English and get a print-ready PDF back. How to connect.

Prompt
Generate a magic square puzzle with its solution as a printable PDF.

How to solve a magic square

Fill the grid with each number from 1 to N² once so every row, column and both diagonals add up to the same total.

The method

  1. Find the magic total. For an N by N grid the total is N × (N² + 1) ÷ 2, printed under the grid, so a 3 by 3 is 15 and a 4 by 4 is 34.
  2. Start where a line is nearly full. A row, column or diagonal with only one empty square is forced: the missing number is the total minus the others.
  3. Use each number once. Every value from 1 to N² appears exactly once, so cross off numbers as you place them and you narrow the choices fast.
  4. Cross rows with columns. A square has to satisfy its row, its column and any diagonal it sits on. Where only one unused number fits all of them, lock it in.
The one rule
Use 1 to N² once each so every row, column and both diagonals share the same sum.
What the answer page shows
The fully completed square is printed at the back.
How the grades differ
Bigger grids and fewer given numbers mean more to deduce before the grid settles.
Good for
Solvers who enjoy arithmetic and a tidy, self-checking grid.

Publishing a whole book?

This tool makes one puzzle for home or the classroom. To make a magic square book you can sell on Amazon KDP, Publisher Studio generates hundreds of graded puzzles across a difficulty curve, at any KDP trim, as a print-ready interior and solutions PDF.

See the KDP magic square maker

Questions

What is a magic square?
A magic square is a grid filled with each number from 1 to N² once, so that every row, every column and both main diagonals add up to the same total. That total, the magic constant, is printed under the grid.
Is this magic square generator free?
Yes. Pick a difficulty, generate a puzzle and print the grid plus its answer, with no sign-up and no watermark. It is free for classroom, home and personal use.
Does every puzzle have one solution?
Yes. Every puzzle is generated and checked by the same solver our Publisher Studio uses, so the given numbers fix exactly one completion. A puzzle is never ambiguous or unsolvable.
Does it include the answer?
Yes. Every puzzle prints as two pages: the puzzle on page one and the completed square on page two, so you can check your work.
What size are the pages?
The free tool prints at 8.25 by 11 inches, a popular large-print size. Our Publisher Studio will export the same book at any KDP trim, from 5.06 by 7.81 up to 8.27 by 11.69, as a print-ready 300 DPI interior.

Short of ideas? Browse our ready-made printables for this puzzle and print one today.

More puzzle generators

See every free tool

Make a magic square book to sell on KDP

Hundreds of graded puzzles, any KDP trim, print-ready PDFs. Start free.

Open Publisher Studio