Skip to content

Magic Square Puzzle

Arrange 1 through 9 once each so every row, column, and diagonal totals the same magic constant.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Use the arrow keys to select a square, then press 1 through 9 to enter a value.
  2. 2.Use every digit exactly once; Delete clears the selected square if you make a mistake.
  3. 3.Make all three rows, all three columns, and both diagonals total 15.

About Magic Square Puzzle

Magic Square Puzzle presents the classic normal three by three challenge. Place each integer from 1 through 9 exactly once. Every row, every column, and both main diagonals must total the magic constant 15.

Wolfram MathWorld supplies the mathematical definition and normal-square constant formula. NRICH independently confirms that rows, columns, and diagonals share one total and that the classic three by three sum is 15. The controls, validation messages, score, and fixed empty starting board are Lizely product choices.

Move the visible selection with the arrow keys. Press a number key from 1 through 9 to fill the current square. Backspace or Delete clears it. Mouse and touch users can click a square to cycle its value. All nine positions remain editable so alternate rotations and reflections of a valid Lo Shu square can also win.

One disclosed solution is 8-1-6, 3-5-7, and 4-9-2. Its row totals are 15, its column totals are 15, and both diagonals total 15. Filling those nine cells cleanly completes the game in nine actions and scores 910 from the initial 1,000.

Validation runs after every entry. Reusing a nonzero digit is an immediate contradiction. A completed three-cell line is contradictory when it does not total 15. An incomplete line is contradictory when its placed values already total 15 or more, because positive remaining digits cannot reduce that sum.

Completion requires exactly nine distinct nonzero digits and exact totals for all eight winning lines. The independent fixture checks order 3, nine cells, magic constant 15, representative rows, a column, both diagonals, unique digits, the complete nine-action simulation, duplicate rejection, and an impossible partial line.

The board is a semantic CSS grid, not a canvas. Every square announces row, column, current value, and keyboard-selection state. Site CSS variables control surfaces, borders, accent, warning, and focus styling; there are no downloaded assets, timers, accounts, or pointer-only controls.

Restart clears all nine values and restores 1,000 points. A completed best score stays only in localStorage. Double-press Escape for the shared spreadsheet boss screen and repeat the gesture to resume the unchanged board.

Methodology & sources

The logic validates nine integer slots in the range 0 to 9, rejects repeated nonzero digits, and evaluates three rows, three columns, and two diagonals. Full lines must equal 15; incomplete positive lines must stay below 15. Completion requires all slots filled and all eight sums equal 15. Score is max(0, 1000 minus 10 times edit actions).

Frequently asked questions

Why is the magic total 15?
A normal 3×3 square uses 1 through 9, whose total is 45. Three equal row sums therefore each equal 15.
Can a rotated solution win?
Yes. Completion is rule-based, so rotations and reflections that use 1 through 9 once and make all eight lines total 15 are accepted.
Why can an incomplete line already be impossible?
All remaining entries are positive. If placed values in an unfinished line already total 15 or more, another digit cannot bring it back to 15.
Where do the rules come from?
The definition and constant are cross-checked against Wolfram MathWorld and NRICH; the interface and score are disclosed product choices.

Mini Games guides

View all