Free logic and strategy game

Play Hex Online

Place stones, connect your two sides, and block your opponent before they build an unbroken chain. Play Hex against the computer or share the board in two-player mode.

Board size
Mode
AI difficulty
Turn Pink
Goal Left to right
Moves 0

Choose an empty hex to start.

Preparing the Hex board

Choose a board size, pick two players or an AI opponent, then connect your sides with an unbroken path.

Blue
Pink
Blue
Pink

What is Hex?

Hex is a classic two-player strategy board game played on a diamond-shaped grid of hexagons. One player tries to connect the left and right sides of the board, while the other player tries to connect the top and bottom sides.

Players take turns placing one stone on any empty hex. Stones never move and are never captured. The first player to create a continuous chain between their two sides wins the game.

  • Pink connects left to right.
  • Blue connects top to bottom.
  • Place one stone on each turn.
  • Adjacent stones of your colour form chains.
  • A completed chain wins immediately.

How to play Hex online

Start by choosing a board size. A 5x5 board is fast and friendly for learning, 7x7 gives a balanced quick match, 9x9 adds real strategic space, and 11x11 is the classic deeper challenge.

Choose two-player mode to play on the same screen, or choose AI mode to practise against the computer. The Easy AI plays casual central moves, Medium looks for wins and blocks, and Hard evaluates connection distance before choosing a move.

  • Click or tap an empty hex to place your stone.
  • Use smaller boards to learn opening patterns.
  • Use larger boards for richer strategy.
  • Switch AI difficulty without leaving the page.
  • Start a new game whenever you want a fresh board.

Hex strategy for beginners

The main idea in Hex strategy is connection. A move can be strong even when it does not touch your existing stones, because it creates future routes that are hard to block. Central stones are flexible, while edge stones can finish a path quickly.

Blocking matters, but only blocking usually loses. Good Hex moves help your own path while making the opponent's path narrower. Look for moves that do both at once.

  • Build several possible paths instead of one fragile line.
  • Use the centre to keep options open.
  • Watch both your route and your opponent's route.
  • Try to make blocks that also improve your own chain.
  • Near the edge, look for short forcing connections.

The bridge: the key connection in Hex

Hex is a connection game with no captures, so every move is really about linking your two sides together, and the single most important tool for that is the bridge. A bridge is a pair of your stones placed so that exactly two empty cells both touch both stones. The two stones are not yet physically joined, but they are safely connected: if your opponent plays one of those two cells, you simply play the other and the link holds.

Because a bridge cannot be cut, you can treat bridged stones as already connected and spend your moves extending toward your edges instead of filling gaps. Strong play is largely chains of bridges reaching from one side to the other, while you watch for the same pattern in your opponent's position so you can break it before it completes.

  • A bridge is two of your stones sharing two common empty neighbours.
  • If the opponent enters one bridge cell, reply in the other to keep the link.
  • Treat bridged stones as connected and keep extending toward your sides.
  • Chain bridges together to cross the board quickly and safely.
  • Spot the opponent's bridges early and block before both ends are set.

Why Hex can never end in a draw

Hex has a remarkable property: a completely filled board always contains exactly one winning chain, so the game can never be a draw. One side must connect its edges, which also means that blocking your opponent and building your own connection are the same task — every stone you place both helps you and hinders them.

It is also known that the first player has a theoretical winning strategy, proven by a clever argument rather than a written-out plan. To keep games fair, many players use the swap rule (also called the pie rule): one player makes the opening move, and the other may then choose to take it over. That single tweak removes most of the first-move advantage and rewards a balanced opening.

A short history of Hex

Hex was invented around 1942 by the Danish designer and poet Piet Hein, who introduced it under the name Polygon, and then independently a few years later by the mathematician John Nash. The game spread through universities — at Princeton it was often played on the hexagonal bathroom tiles — before Parker Brothers published it commercially as Hex in 1952.

Martin Gardner's Scientific American column helped make it famous, and its deep theory has fascinated mathematicians ever since. The version here keeps that classic connection game and adds adjustable board sizes and computer difficulty, so you can learn the bridge on a small board or test yourself on a larger one.

AI difficulty levels

Easy AI is useful while you are learning the rules. It tends to like central spaces but can miss urgent threats. Medium AI checks for immediate wins and blocks, so you need to build threats over several turns.

Hard AI compares how close each player is to connecting their sides, favours flexible bridges, and tries to slow your shortest route. It is not a tournament engine, but it gives a much sharper online Hex practice game.

Why Hex is a logic and strategy game

Hex rewards planning, pattern recognition and spatial logic. There is no hidden information, no dice and no guessing. Every stone stays on the board, so each choice creates a permanent constraint.

That makes Hex a strong fit for players who enjoy logic puzzle games but want a competitive board game. The rules are quick to learn, while the strategy keeps growing as board sizes increase.

FAQ

Hex FAQ

Can I play Hex against the computer?

Yes. Choose Vs AI mode, then select Easy, Medium or Hard difficulty.

Can two people play Hex on this page?

Yes. Choose 2 players and take turns placing stones on the same board.

What board sizes are available?

This online Hex game includes 5x5, 7x7, 9x9 and 11x11 boards.

Can Hex end in a draw?

No. With perfect rule play, a filled Hex board always contains a winning connection for exactly one player.

What is a bridge in Hex?

A bridge is two of your stones that share two empty cells as common neighbours. The pair is safely connected, because if your opponent plays one of those cells you can play the other, so the link cannot be cut. Bridges are the building blocks of strong Hex play.

Does the first player always win at Hex?

In theory the first player has a winning strategy, but no one has written it out for full-size boards. To keep games fair, players often use the swap rule, where the second player may take over the first move.

Who invented Hex?

Hex was created by Piet Hein around 1942 and independently by John Nash a few years later. It was published commercially as Hex by Parker Brothers in 1952 and popularised by Martin Gardner.

Game over