Magic squares have fascinated people for millennia, from the Chinese Lo Shu square to Dürer’s engraving Melencolia I. They are a playground for number patterns and a classic puzzle.
How to use the Magic Square Calculator
- Size of the square n
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
Odd sizes use the Siamese (de la Loubère) method, sizes divisible by 4 use the complement pattern on the diagonals, and other even sizes use Strachey’s method of combining four odd squares.
Formula
Magic constant M = n(n² + 1) / 2
Worked example
Inputs: Size of the square n: 4.
Results: Magic square = 16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1; Magic constant = 34; Sum of all numbers = 136.
Key terms
- Magic constant
- The common sum of each row, column and diagonal.
Frequently asked questions
What is the magic constant of a 3 × 3 square?
15.
Is there a 2 × 2 magic square?
No, it is impossible with distinct numbers 1 to 4.
How many 3 × 3 magic squares are there?
Essentially one; the others are its rotations and reflections.
What is Dürer's magic square?
A 4 × 4 square from 1514 whose bottom row contains the year, 15 14.