Magic Square Generator
Generate a magic square of any order from 3 to 20 and verify its magic constant.
Runs in your browser. Your files never leave your device. See how to check
…
How to do it
- 1Step 1: Open Magic Square Generator and add your input
Type your numbers or text, add your file, or pick the options you need. Nothing is uploaded: everything stays in your browser.
- 2Step 2: What Magic Square Generator does
Generate a magic square of any order from 3 to 20 and verify its magic constant.
- 3Step 3: Read the result and compare
The result appears at once. Change one value to see how the answer moves, then keep the figure that fits your case.
- 4Step 4: Copy or save it
Copy the result or download it. For an important decision, confirm it with the official source or an adviser.
About this tool
Enter the order n. The calculator builds an n × n magic square in which every row, column and both diagonals add up to the same magic constant n(n² + 1) ÷ 2, and checks it.
Methods
Odd orders use the Siamese method. Orders divisible by 4 use the complement pattern. Singly even orders (6, 10, 14, …) use the LUX/Strachey method. Order 2 does not exist.
Magic constant
M = n(n² + 1) ÷ 2, for example 15 for n = 3, 34 for n = 4 and 65 for n = 5.
Worked example
Order 5 has the magic constant 65 and every row, column and diagonal adds up to it.
Tips for best results
Check every box before you rely on a result, because one wrong digit changes the whole answer. Use the exact figures from your payslip, bill, certificate or contract, and keep a note of the date you calculated. Rates, thresholds and rules change from time to time, so for tax, fees and legal matters treat the output as an estimate and confirm with the official source named on this page. You can run as many scenarios as you like; nothing is saved or sent, and refreshing the page clears the boxes.
Quick facts
- Category: Games & Fun
- Works in your browser, no sign-up, no upload.
- Your input stays on your device.
- Available in many languages.
- Content last reviewed:
Frequently asked questions
Does a 2×2 magic square exist?
No.
Is the square unique?
No; there are many, this is one standard construction.
How is it checked?
All rows, columns and both diagonals are summed.
What orders are allowed?
3 to 20.
