Every strategy tip for 3D tic-tac-toe eventually comes down to one question: how many winning lines are there, and which cells sit on the most of them? This article does the counting for every board size from 3×3×3 to 10×10×10 and explains what the numbers mean for your play.
The formula
On an n×n×n cube, a winning line is n cells in a straight row. The number of such lines is
((n + 2)³ − n³) / 2
There is a nice way to see why. Surround the cube with one extra layer of cells on every side, giving an (n+2)×(n+2)×(n+2) cube. Every winning line, extended by one step at each end, leaves the original cube through exactly two of the new border cells. Conversely, every border cell is the start of exactly one such extended line. So the lines pair up the (n+2)³ − n³ border cells, two cells per line.
The numbers for every board
| Board | Cells | Winning lines | Most lines through one cell | Average per cell |
|---|---|---|---|---|
| 3×3×3 | 27 | 49 | 13 | 5.4 |
| 4×4×4 | 64 | 76 | 7 | 4.8 |
| 5×5×5 | 125 | 109 | 13 | 4.4 |
| 6×6×6 | 216 | 148 | 7 | 4.1 |
| 7×7×7 | 343 | 193 | 13 | 3.9 |
| 8×8×8 | 512 | 244 | 7 | 3.8 |
| 9×9×9 | 729 | 301 | 13 | 3.7 |
| 10×10×10 | 1000 | 364 | 7 | 3.6 |
Two patterns stand out. First, the number of lines grows roughly with the square of n, while the number of cells grows with the cube. Big boards have far more lines in total, but each cell matters less. Second, odd and even boards behave differently, which is the most practical fact in this article.
Odd boards have a king cell
On 3×3×3, 5×5×5, 7×7×7 and 9×9×9 there is a single centre cell. It lies on 13 lines: one in each of the 13 possible directions in a cube (3 straight, 6 face diagonal, 4 space diagonal). No other cell comes close. On odd boards, taking the centre early is almost always correct, and if your opponent takes it, expect to spend the game defending.
Even boards share the power
On even boards there is no centre. Take 4×4×4: of its 64 cells, exactly 16 lie on 7 lines and the other 48 lie on only 4. The 16 strong cells are the 8 corners and the 8 cells of the small 2×2×2 cube in the middle. All of them sit on space diagonals, which is what gives them extra lines. That is why opening play on 4×4×4 revolves around corners and the inner cube, and why the four great diagonals are so often where games are decided.
What to do with this
- Early in the game, prefer cells on many lines. On odd boards that means the centre; on even boards, corners and the inner cube.
- On big boards, think locally. With 3–4 lines per cell on average, a single piece does little alone. Groups of pieces that share several lines are what create threats.
- Count your opponent's lines too. A strong cell for you is usually a strong cell for them. Sometimes the best move is simply taking the cell they need.
Try it yourself on XO3D : pick 4×4×4 and play the first few moves only on the 16 strong cells, then compare with a game where you ignore them. For more on using these cells, see the strategy guide and the win-in-two puzzles .