Magic Square

Play the magic square puzzle free in your browser. Fill the grid with the numbers 1 to n² so that every row, every column and both diagonals add up to the same magic number (15 on a 3×3, 34 on a 4×4). Some numbers are given; tap a square, then tap a number to place it. Every board has one solution reachable by logic alone — no guessing, no arithmetic luck.

Rules

What is a magic square?

A magic square is a grid filled with distinct numbers so that every row, every column and both main diagonals add up to the same total — the “magic constant”. For a normal n×n magic square using the numbers 1 to n², that constant is M = n(n²+1)/2: 15 for a 3×3 and 34 for a 4×4. The 3×3 magic square is the famous one, known in ancient China as the Lo Shu square.

This is the playable version: you’re given a few numbers and you complete the grid so all the lines hit the magic number, using each value exactly once.

How to solve a magic square

Work from the magic number. Where a row, column or diagonal already has all but one cell filled, the missing value is forced — it’s the magic sum minus what’s there.

  • Finish almost-complete lines first. A line with one empty cell has exactly one possible value (M − the rest).
  • On a 3×3, the centre is always M⁄3. For the classic 1–9 square that’s 5 — every line through the centre is built around it.
  • Track which numbers are left. Each value 1 to n² appears once, so cross them off as you place them.
  • Use the diagonals. They’re extra constraints many solvers forget — a diagonal often pins down a stubborn cell.

Is there more than one magic square?

The 3×3 magic square is essentially unique: every 1–9 magic square is just a rotation or mirror image of the Lo Shu square (eight in all). That’s why a 3×3 puzzle hinges on which cells are revealed. The 4×4 is far richer — there are 880 genuinely different 4×4 magic squares — so it gives much more variety. If you enjoy number-logic, magic squares sit naturally beside Kakuro and Sudoku in this collection.

Magic Square: FAQ

What is a magic square?

A grid of distinct numbers where every row, column and both main diagonals add up to the same total, called the magic constant. With the numbers 1 to n², that total is n(n²+1)/2.

What is the magic constant?

It’s the sum every line must reach. For a normal magic square it’s M = n(n²+1)/2 — that’s 15 for a 3×3 (numbers 1–9) and 34 for a 4×4 (numbers 1–16).

How do you solve a 3×3 magic square?

Use the magic number 15. The centre is always 5, and any row, column or diagonal with one empty cell is forced (15 minus the other two). Place the given numbers, then fill the forced cells.

Is there more than one 3×3 magic square?

Essentially no — every 3×3 magic square using 1–9 is a rotation or reflection of the same Lo Shu square (eight orientations). The 4×4 has 880 distinct ones, so it offers far more variety.

Is it free to play?

Yes — the magic square puzzle plays free in your browser on phone, tablet and desktop, with no download and no sign-up. Tap New for a fresh board any time.

← All logic puzzles