PLAY · TEST · UNDERSTAND
How to Solve a Magic Square
A normal magic square of order n uses each integer from 1 through n² exactly once. Every row, every column, and both main diagonals must have the same sum. Solving a partially filled square means satisfying all these conditions together, not merely making its rows add up. Use this four-step procedure alongside Magic Square Archive, recording your deductions on paper rather than assuming an unfilled cell has an obvious value.
Guided magic square practice
Use each integer from 1 to 9 once. Every row, column and both diagonals must sum to 15.
Given clues are locked. Fill the empty cells, check your work, or reveal one hint.
Practice steps
- Find a row, column or diagonal with just one empty cell. Its missing value is 15 minus the known sum.
- Check that your value is in range and has not already been used. If no such line exists, compare intersecting lines.
- Use a hint to reveal one value from the known solution; then check all rows, columns and both diagonals.
- Magic constant
- 15
1. Calculate the magic constant
For a normal square, the target sum is M = n(n² + 1)/2. The numbers total n²(n² + 1)/2, and dividing that total among n rows gives M. For a 3×3 square using 1 through 9, M = 15. Write this target beside your grid before filling anything. If the puzzle uses a different set of numbers, do not apply the normal-square formula automatically; first establish the intended set and its total.
2. Keep a list of unused numbers
Start with the allowed numbers and cross out every entry already present. Check the clues for repetitions or values outside that set. Suppose the grid has rows 8, 1, blank; 3, 5, blank; and 4, 9, blank. Its unused numbers are 2, 6, and 7. Keep this list beside the square, updating it after each entry. A number that gives the right line sum is still invalid if it has already been used.
3. Deduce an entry from one incomplete line
Choose a row, column, or main diagonal with exactly one empty cell. Subtract its known entries from M. In the example, the first row requires 15 − 8 − 1 = 6; the second requires 15 − 3 − 5 = 7; the third requires 15 − 4 − 9 = 2. Each result belongs to the unused list. If no line has just one blank, this deduction alone cannot determine the next entry; retain candidates rather than guessing.
4. Check distinct entries and every required line
The completed example reads 8, 1, 6 / 3, 5, 7 / 4, 9, 2. Confirm that 1 through 9 each appears once. Its three rows, three columns, and two main diagonals all total 15. A repeated number or a mismatched diagonal invalidates the result even when the rows work. Distinct entries do not establish a unique solution: these checks verify this completion, not whether the original clues permit other completions.
A four-step solving routine
Calculate the magic constant
For a normal square using 1 through n², calculate M = n(n² + 1)/2. A 3×3 square has target sum 15.
Track unused numbers
List the allowed numbers, cross out the given entries, and remove each newly placed number. Reject repeated or out-of-range entries.
Fill a line with one missing entry
Select a row, column, or main diagonal with exactly one blank. Subtract its known entries from the target and confirm the result is unused.
Verify distinct entries and all lines
Check that every allowed number appears exactly once, then check every row, column, and both main diagonals. This validates a completion, not uniqueness of the solution.