Magic Square
Generate and validate magic squares
About this calculator
The Magic Square Calculator generates a magic square of any order from 1 to 12, where every row, column and both diagonals share the same magic constant M = n(n² + 1) / 2. It uses the Siamese method for odd orders, the doubly-even method for orders divisible by four, and Conway's LUX method for singly-even orders, and confirms the result is genuinely magic.
How to use the Magic Square calculator
- Enter the values for your problem into the input fields.
- Read the result — it updates instantly as you type.
- Check the formula and the visual explanation to follow how the answer was found.
- Copy the page URL to share the exact calculation.
Common examples
- Order 3 (Siamese method) → magic constant 15, first row 8 1 6 — the classic Lo Shu square
- Order 4 (doubly even method) → magic constant 34, first row 16 2 3 13
- Order 6 (Conway's LUX method) → magic constant 111, every row, column and diagonal checked
- Order 12 → magic constant 870 from M = n(n² + 1)/2
- Order 2 → correctly reported as impossible: no 2×2 magic square exists
Frequently asked questions
How does the Magic Square calculator work?
Enter your values and the calculator applies the exact mathematical method for this problem, showing the result together with the formula it used. Everything is computed with high-precision arithmetic, so the answer you see is not limited by ordinary floating-point rounding.
When would I use the Magic Square calculator?
It is useful for homework and exam preparation, for checking work done by hand, and whenever a step in a larger problem needs this calculation done quickly and reliably.
How accurate are the results?
Calculations run at 30 significant digits of precision internally. Displayed values are rounded for readability, but the underlying result is far more precise than a typical hand or pocket-calculator computation.
Can I share a specific calculation with someone else?
Yes. Every value you enter updates the URL, so copying the address bar and sharing the link reopens the exact same calculation for whoever clicks it.