Magic Square Generator
Generate an n×n magic square (3 to 12) where every row, column and diagonal has the same sum.
Generate an n×n magic square (3 to 12) where every row, column and diagonal has the same sum.
Results
Enter your details and click Calculate to see your results.
About This Calculator
Odd n: Siamese method; n divisible by 4: diagonal swap; other even n: LUX/Strachey method.
Example
Example: the default inputs → Magic Square: 8 1 6 / 3 5 7 / 4 9 2.
Assumptions
Exact maths — check the input format shown in each field.
Frequently Asked Questions
What is the magic constant of a 3×3 square?
15.
What is the formula for the magic constant?
n(n² + 1)/2.
Related Calculators
About the Author

Imran Hossain
Professional SEO, Digital Marketer Specialist
I am a Certified Google Ads Expert And Professional SEO, Digital Marketing Specialist
View full profile