Eleven by eleven hexagons. Red connects top to bottom, Blue connects left to right, one stone a turn, nothing ever captured. That is the entire rulebook — and underneath it is one of the cleanest pieces of mathematics in any board game on this site.
How to play Hex
Moving: one stone, no captures
Place a stone on any empty hex, in turn. There is no other move — no jumps, no captures, nothing that ever leaves the board once it is placed.
How do you win at Hex?
Connect your two edges with an unbroken chain of your own stones. Red's edges are the top and bottom rows; Blue's are the left and right columns. A corner hex belongs to both of its adjacent edges at once, whichever colour ends up owning it.
What is the swap rule, and why does it exist?
Right after the first move of the game — and only then — the second player may swap instead of placing a stone: take over the first move and its colour, and let the original first player continue as the other colour. Most sets and every serious tournament use it.
The reason is almost the whole point of this page: the first move in Hex is proven to be worth taking over if it is any good, so an unbalanced game needs some way to punish a strong opening. The swap rule is that punishment — open too strong, and your opponent just takes it from you. Our own computer opponent weighs the swap the same way it weighs any other move, and will take a strong opening away from you if you hand it one.
Why Hex can never end in a draw
John Nash proved this in 1952, and it is one of the more elegant short proofs in game theory: on a completely filled board, look at the connected group of stones touching one of Red's edges. Either it reaches Red's other edge — Red wins — or it does not, in which case the Blue stones sitting along its entire boundary form an unbroken chain from one side of the board to the other. There is no third option and no way for both, or neither, to happen at once.
We did not want to just cite that and move on, so we checked it ourselves, exhaustively, rather than sampling:
| Board | Fillings checked | Draws found |
|---|---|---|
| 2×2 | 16 (all of them) | 0 |
| 3×3 | 512 (all of them) | 0 |
| 4×4 | 65,536 (all of them) | 0 |
| 5×5 | 33,554,432 (all of them) | 0 |
Every single way of colouring a 5×5 board red or blue, all 33.5 million of them, has exactly one side connected. Not a sample — all of them.
Does the first player always win at Hex?
Also Nash, and also 1952 — but this one is a genuinely strange proof, because it proves a winning strategy exists without ever saying what it is. The argument is called strategy-stealing: suppose the second player had a winning strategy. The first player could make any opening move at all, then simply follow that strategy themselves. If it ever calls for a move on the square they already used, they play anywhere else instead — an extra stone on the board can never hurt them, since a stone of your own colour is never a disadvantage in Hex. That gives the first player a winning strategy too, and both players cannot have one, so the assumption was wrong: it was the first player's strategy all along. The proof never constructs it.
We solved the tiny boards ourselves
For 2×2, 3×3 and 4×4, small enough to search completely, we did find the actual strategy rather than just its existence: red wins every one of them with correct play, confirmed by full search rather than the stolen-strategy argument. The 4×4 search is the real work of the three — 113,243,210 positions checked, a little under five minutes — and it is already far past what a person could verify by hand.
Which 3x3 openings actually win
5 of the 9 possible openings win outright, and they are exactly the centre and its four immediate neighbours — the four sharp corners lose. That is precisely the intuition strong Hex players have about the real 11×11 board: play central, avoid the corners. Here it is not intuition, it is a complete search.
Nobody has fully solved the traditional 11×11 board, or ever likely will by brute force — but smaller sizes have fallen to serious dedicated research: 7×7 in 2002 (Yang, Liao and Pawlak), 8×8 in 2009 (Henderson, Arneson and Hayward), and every 9×9 opening in 2013 (Pawlewicz and Hayward). Each took real computational effort well beyond what this page attempts; we mention them rather than claim them.
Playing Hex against the computer
How the shortest-path score works
Beside the board, both sides get a live number: the fewest additional stones that colour would need to connect, assuming the opponent plays nothing at all in between. It is not a prediction of the outcome — the opponent very much will play something — but it is the same measure the computer opponent itself uses to judge a position, so watching it is a window into how the computer is thinking.
How do the three computer levels differ?
In how many candidate moves get weighed and how often a merely good move gets played instead of insisting on the exact best one — the same design as the Reversi and Halma opponents on this site. Games are short compared to those two: a shortest-path heuristic finds a workable connection quickly on a board this size, and our own games between matched levels ran well under fifty moves a side.
Where Hex comes from
Piet Hein, a Danish mathematician and poet, invented it in 1942 and introduced it at the Niels Bohr Institute in Copenhagen; a newspaper column that December made it known in Denmark as Polygon. John Nash independently reinvented the same game at Princeton in 1948, where it circulated as Nash, or John — a pun on the fact that it could be played on the hexagonal bathroom tiles common at the time. Parker Brothers published it commercially in 1952 under the name it has kept since: Hex.
Two mathematicians, six years apart, arrived at the same eleven-by-eleven idea independently — and both, separately, ended up proving the same two facts about it.
If you like this one
- Nim — another game settled by a short, complete proof rather than by play
- Reversi — the opponent here uses the same candidate-scoring approach as Hex's
- Gomoku — placement only, no captures, the other connection-style game on this site
- Dots and Boxes — solved exactly by its own engine rather than played out, the same spirit as the boards above



