Magic Square Calculator
Find the magic constant of an n×n magic square.
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.
FAQ
Do all sizes have magic squares?
Yes for every n ≥ 3 (and trivially n = 1); only n = 2 is impossible.