PlayNook

Board Game · Connection Game

Play Hex Online — Free, No Sign-Up

Red connects top to bottom, Blue connects left to right, one stone a turn, no captures. We solved the tiny boards ourselves to show why the swap rule exists at all.

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:

BoardFillings checkedDraws found
2×216 (all of them)0
3×3512 (all of them)0
4×465,536 (all of them)0
5×533,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

A 3x3 Hex board with each of the nine opening hexes labelled either wins or loses for red, showing the centre and its four neighbours winning and the four sharp corners losing
Every one of the nine possible opening moves on a 3x3 board, solved outright. The centre and its neighbours win; the sharp corners lose.

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

Frequently asked questions

+ How do you play Hex?

Eleven by eleven hexagons. Red owns the top and bottom edges, Blue owns the left and right edges. Players alternate placing one stone on any empty hex — no captures, no jumps. Build an unbroken chain of your own stones connecting your two edges to win. A corner hex counts for whichever edge its owner needs, since it touches both at once.

+ What is the swap rule in Hex?

Immediately after the very first move of the game, the second player may swap instead of placing a stone of their own: they take over the first move and its colour, and the original first player continues as the other colour from then on. It exists because the first move is provably worth taking if it is any good — without it, the player who goes first would simply be favoured.

+ Can Hex end in a draw?

No, never — proved by John Nash in 1952, and we checked it ourselves rather than just citing him. Every one of the 33,554,432 possible ways to completely fill a 5x5 board has exactly one side connected, never both and never neither. A full board always has a winner.

+ Does the first player always win at Hex?

With perfect play, yes — also Nash, 1952, though his proof only shows a winning strategy exists without saying what it is. We found the actual strategy ourselves for boards small enough to fully search: 2x2, 3x3 and 4x4 all confirmed, red wins with correct play every time. The 4x4 search alone worked through 113,243,210 positions to be certain. For the traditional 11x11 board no one has ever computed a complete strategy; the proof that one exists does not mean anybody knows it.

+ Which opening moves in Hex are actually strong?

On the 3x3 board, where we could check every option exhaustively, 5 of the 9 possible openings win outright for the player who makes them: the centre and its four immediate neighbours. The 4 sharp corners lose. That pattern — centre strong, corners weak — is exactly the intuition experienced Hex players have for the full 11x11 board too, just not provable there by brute force.

+ Has Hex been solved on the real 11x11 board?

No. Researchers have fully solved specific smaller sizes — 7x7 in 2002 (Yang, Liao and Pawlak), 8x8 in 2009 (Henderson, Arneson and Hayward), all 9x9 openings in 2013 (Pawlewicz and Hayward) — each taking serious dedicated computation. 11x11, the traditional tournament size, remains open.

+ 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 the exact best one — not in a fixed unbeatable formula, the same approach as the Reversi and Halma opponents on this site. Every move is scored by a shortest-path estimate: how many more stones of this colour would it take to connect, ignoring anything the opponent might still do.

+ Can I play Hex with a friend online?

Yes. Choose 'With a friend online' below the board and press Open a table. You get a four-character code; send it to your friend, they type it in and press Join. There is a chat window built in, and neither of you needs an account or a download.

+ Is it free?

Yes, and there is no sign-up, for the online tables either. Nothing about a solo or hotseat game is saved anywhere; close the tab and start fresh next time.

More games like this