Math
Magic Square Calculator
Find the magic constant of an n×n magic square.
Did this calculator solve your problem today?
✓ Thank you for your feedback!
Report issue to loopingon.com
Sponsored
A magic square uses the numbers 1 to n² so every row, column and diagonal sums to the same value.
The math behind it
The magic constant is M = n(n² + 1)/2. The grand total of all cells is n² (n² + 1)/2.
Worked Example
A 3×3 magic square has constant 3(9 + 1)/2 = 15.
Frequently Asked Questions
Do all sizes have magic squares?
Yes for every n ≥ 3 (and trivially n = 1); only n = 2 is impossible.
Advertisement