Hex: play the classic connection game online free
Hex is the classic connection board game played on a rhombus of hexagons: Red must join the top and bottom edges and Blue the left and right edges, and exactly one of them always succeeds. Play the computer on four levels, from a gentle Easy to an Expert that uses Monte Carlo tree search. Use the fair swap (pie) rule, choose 9, 11 or 13 hexagons per side, add a chess-style clock, play best-of-3 or best-of-5 matches, share one screen or play online with a friend or a random player. With hints, undo, ranks, a practice rating, 18 badges and leaderboards. Free in any browser on a computer, tablet or phone.
How to play Hex
- Choose a board size and a computer level (or play a friend), then pick Red or Blue. Red moves first.
- Tap or click an empty hexagon to place one of your stones. Stones are never moved or captured.
- Red must join the top edge to the bottom edge, Blue must join the left edge to the right edge, with an unbroken chain of touching stones.
- After Red's first move Blue may press Swap to take over that stone (the pie rule), which keeps the opening fair.
- The first player to complete a chain wins. Hex can never end in a draw.
Mouse: click a hexagon; a see-through stone shows where it will go. Touch: tap a hexagon to preview the stone, then tap it again to place it (you can turn this off in Settings). Keyboard: the arrow keys move the cursor, Enter or Space places a stone, S swaps the opening stone, U takes back a move, H shows a hint and N opens the new game menu.
Hex rules
| Rule | How it works here |
|---|---|
| ⬡ The board | A rhombus of hexagons, 11 × 11 by default (9 × 9 and 13 × 13 are available). Each hexagon touches up to six others. Two edges are red, two are blue. |
| 👆 Moving | Players take turns placing one stone of their colour on any empty hexagon. Red moves first. Stones never move and are never captured. |
| 🔗 Winning | Red wins with an unbroken chain of red stones from the top edge to the bottom edge. Blue wins with a chain from the left edge to the right edge. |
| 🤝 No draws | When every hexagon is filled, exactly one player has a winning chain. A chain for one player always blocks every chain for the other. |
| 🥧 Swap (pie) rule | Because the first move is a big advantage, Blue may swap after Red's first move: Blue takes over that stone (it is mirrored across the long diagonal so it still works for Blue) and Red moves next. So Red should open with a balanced move, not the centre. The variant "11 no swap" switches the rule off. |
Shapes and strategy
| Shape | What it is | Why it matters |
|---|---|---|
| 🌉 Bridge | Two stones of one colour with two free hexagons between them (one step apart on a diagonal) | Connected for good: if the opponent plays in one gap, you play in the other |
| 🧱 Edge template | A stone on the third row from your edge with enough free space around it | Counts as already joined to that edge |
| 🛡️ Block | A stone placed a little ahead of the opponent's chain, not right next to it | A distant block is harder to jump around than a contact block |
| 🎯 Centre | The middle of the board | It helps both of your lines; it is also why the swap rule exists |
Hex is a race between two shortest paths. Every good move either shortens your own path or lengthens your opponent's, and the best moves do both. The computer scores positions with exactly that idea, and the hint button shows the move it would play.
Computer levels
| Level | Plays like | Good for |
|---|---|---|
| 🌱 Easy | Looks one move ahead and often plays a random nearby hexagon | Learning the rules and your first wins |
| 🌊 Medium | Always plays a move that shortens its path and lengthens yours, with a little variety | Casual players who want a real game |
| ⚓ Hard | Searches two moves ahead over its best candidates and uses the swap rule well | Experienced players |
| 🐙 Expert | Monte Carlo tree search: it plays out tens of thousands of random games every move and picks the most promising hexagon | A proper challenge |
The computer thinks in the background, so the board keeps moving while it plans. You can play Red (you move first), Blue (the computer starts) or a random side, take back moves with Undo and ask for a Hint whenever it is your turn.
Play Hex online with a friend
Online Hex is a real game against a real person. Choose the board size and an optional clock in the lobby: 11 × 11 with the swap rule, blitz (3 minutes plus 2 seconds a move), rapid (10 plus 5), 13 × 13 or 9 × 9. Both browsers check every move with the same rules, and the moves travel directly between the two players (peer to peer), so it is fast and needs no account.
Prefer to watch first? The 45-second online play demo on the home page shows every step.
Start a game with a friend
- Tap the pink Play with a friend button (or choose Play online in the menu), type your name and choose a variant and a clock, then Invite a friend.
- Send the 5-character code or the invite link with Share, Copy link or Copy code, and keep the window open.
- Your friend opens Hex, taps Play with a friend, then Join a friend, types the code and presses Join. The link does this for them.
- The game starts by itself. The sides are drawn at random.
No friend at hand?
Tap Random player to be paired with the next person looking for a game, or pick one of the open games in the list.
During the game
Tap the 😊 button to send a quick reaction, and keep an eye on the turn chip: it glows when it is your move, and the browser tab says so when you are in another tab. Hex has no draws, so there is no draw offer. While an online game is on, the pink button hides and an exit icon appears in the top bar: tap it once and it turns red, tap again to leave (your opponent wins). If the connection drops for a moment the game waits and reconnects by itself. At the end, press Rematch: the sides swap, and the session score against your opponent is kept.
Tips for beating a person at Hex
- Open with a fair move. If you play first with the swap rule, pick a hexagon near the edge, not the centre, or your opponent will swap and take it.
- Block from a distance. A stone two or three hexagons ahead of your opponent's chain is usually better than one touching it.
- Use the clock. On blitz, spend your thinking time on the first ten moves and then move quickly.
- Watch both paths. Before every move count how many stones you still need and how many your opponent needs.
Game modes, ranks, rating and leaderboards
Play the computer against Easy, Medium, Hard or Expert, with your own record for each level. Choose a single game, a best of 3 or a best of 5 match, and an optional clock. Two players, one screen lets two people take turns on the same device, and Play online connects you with a friend or a random player. Choose the level, side, clock and players in Settings (the cog), then press New game (the circular arrow).
Every finished game earns XP, and your first win of the day adds a bonus. XP raises your rank through ten steps from Pebble to Legend. Your practice rating (an Elo-style number that starts at 1000) moves after every game against the computer or a real opponent. Wins against the computer can go on the leaderboard, with This month and All time panels: A win scores 300 points, plus 10 for every one of your stones fewer than 40 that you needed, plus a level bonus (Easy 0, Medium 100, Hard 250, Expert 450). You only pick a nickname and can delete your scores at any time. Online games, two-player games, draws and losses are not ranked.
Badges
There are 18 badges: for beating each level, winning streaks, using the swap rule, quick chains, big boards, clock games, matches, two-player and online games, your rating, your rank and the number of games played. Open the medal button in the game to see your progress.
| Badge | How to earn it |
|---|---|
| 🏅 First Chain | Win a game against the computer. |
| 🌱 Sprout | Beat the computer on Easy. |
| 🌊 Tide Turner | Beat the computer on Medium. |
| ⚓ Anchor Down | Beat the computer on Hard. |
| 🐙 Kraken Slayer | Beat the computer on Expert. |
| 🏆 Hard Fighter | Win 5 games on Hard or Expert. |
| 🎯 Hat-trick | Win 3 games in a row against the computer. |
| ⚡ On Fire | Win 7 games in a row against the computer. |
| 🥧 Pie Chef | Use the swap rule to take over your opponent's opening stone. |
| 🚄 Express | Win with a chain of at most 4 stones more than the board is wide. |
| 🗺️ Big Board | Beat the computer on Hard or Expert on a 13 × 13 board. |
| ⏱️ Clock Master | Win a game against the computer with a clock running. |
| 🎖️ Match Winner | Win a best-of-3 or best-of-5 match against the computer. |
| 👥 Friendly Game | Finish a two-player game on one screen. |
| 🌐 Online Winner | Win an online game against a real person. |
| 📈 Rising Star | Reach a rating of 1200. |
| 🎓 Tactician | Reach the Tactician rank (1,700 XP). |
| 🎲 Regular | Play 25 games. |
Hex tips
- Think in bridges. Two stones one step apart on a diagonal are as good as joined, so you can cross the board quickly with few stones.
- Play the centre early (when the swap rule lets you), because central stones help your chain in every direction.
- Block at a distance. A blocking stone a couple of hexagons ahead is hard to go around; a stone in contact is easy to bypass.
- Make double-purpose moves. The best stone extends your chain and cuts your opponent's at the same time.
- Remember the edges. A stone on the second or third row from your edge often needs no more help to connect.
- Do not give up a long way behind. One good cut can change both shortest paths at once.
Frequently asked questions
Is Hex free?
Yes. Hex on Util.Ninja is completely free to play online, with no sign-up, no download and no in-app purchases. It runs in your browser on computers, tablets and phones, and your statistics, rating and badges are saved on your own device.
Can I play Hex online against another person?
Yes. Tap Play with a friend (or Play online in the New game menu), choose a variant, then Invite a friend and send the 5-character code or the link, or pick Random player or an open game for a quick match. The two browsers are connected directly (peer to peer), so every move shows up on your opponent's screen at once and no account is needed. You can send quick reactions during the game, offer or accept a draw where the rules allow it, and ask for a rematch at the end: the sides swap so both players get to start.
How do I leave an online Hex game?
Tap the exit icon in the top bar. The first tap turns it red, the second tap leaves the game and your opponent wins. You can also give up from the New game menu. If your opponent leaves or loses the connection, you win. On a very strict network a direct connection may not be possible; try another network or a mobile connection.
What are the computer levels in Hex?
Easy looks one move ahead and sometimes plays at random. Medium always plays a move that shortens its own path and lengthens yours. Hard searches two moves ahead and judges the swap rule. Expert runs a Monte Carlo tree search with tens of thousands of random playouts every move. No level cheats: they all play by the same rules as you.
Does Hex have a clock?
It can. Before a game against the computer or in an online lobby you can choose No clock, 3 + 2 (three minutes each plus two seconds after every move) or 10 + 5. If your time runs out you lose. Against the computer the clock only runs while no dialog is open.
What is a series or match?
Before you start against the computer you can pick Single game, Best of 3 or Best of 5. The sides swap after every game, the match score is shown in the top bar, and winning a whole match gives a bonus of 80 XP and counts as a Series win in your statistics. Online, the score of your session against the same opponent is shown after every rematch.
How do ranks, XP and the rating work in Hex?
Every finished game earns XP: a win against the computer earns more on higher levels, and your first win of the day adds a bonus of 50 XP. XP raises your rank through ten steps (Pebble, Novice, Apprentice, Bridge Builder, Chain Maker, Tactician, Strategist, Master, Grandmaster, Legend). Separately you have a practice rating, like an Elo score, that starts at 1000 and goes up when you beat stronger opponents and down when you lose to weaker ones. It is stored on your device and also moves in online games, using the rating your opponent's browser reports.
Does Hex have a leaderboard?
Yes. Wins against the computer are ranked on a leaderboard for each level, with This month and All time panels. A win scores 300 points, plus 10 for every one of your stones fewer than 40 that you needed, plus a level bonus (Easy 0, Medium 100, Hard 250, Expert 450). You only choose a nickname, and you can delete your scores at any time. Online games, two-player games, draws and losses are not ranked.
Can I play Hex on a phone?
Yes. Hex works on phones and tablets in portrait and landscape; on a tall screen the board turns so it fills the space. Tap a hexagon to preview the stone, then tap it again to place it, so you never place a stone by accident (you can turn the second tap off in Settings). On a computer use the mouse, or the arrow keys and Enter.
Is Hex safe to play online?
The game never asks for personal data. Only your nickname and the moves travel between the two browsers, and every move is checked by the rules engine on both sides, so an impossible move ends the game instead of changing the result. Nothing is stored on a server except the optional leaderboard nickname and score.
How do I play Hex?
Two players take turns placing one stone of their colour on an empty hexagon. Red must connect the top and bottom edges of the board with an unbroken chain of touching stones, and Blue must connect the left and right edges. Stones never move and are never captured. The first player to complete a chain wins.
Can Hex end in a draw?
No. When the board is full, exactly one of the two players has a chain between their edges. This is a famous mathematical fact about Hex, and it means every game has a winner.
What is the swap rule or pie rule?
Red has a big advantage from the first move, so after Red's first stone Blue may swap: Blue takes over that stone (mirrored over the long diagonal so it still works for Blue) and Red plays next. This makes the first player choose a fair opening move. You can switch it off by choosing the "11 no swap" board.
What is a bridge in Hex?
A bridge is two stones of the same colour that touch two empty hexagons in common. They are as good as connected: if your opponent plays in one of the gaps you play in the other. Strong players cross the board with chains of bridges.
Who invented Hex?
Hex was invented by the Danish mathematician Piet Hein in 1942 and independently by John Nash in 1948. It is sometimes sold under the name Nash. This version is an independent browser game.
Which board size should I choose?
11 × 11 is the standard size and the default. 9 × 9 is a quick game for beginners or short breaks, and 13 × 13 gives a longer, deeper game that rewards planning.
Is the computer on Expert unbeatable?
No. Expert uses Monte Carlo tree search with tens of thousands of random playouts, which is strong on 9 × 9 and 11 × 11 but can be out-planned by a strong human, especially on 13 × 13 or with a clock running.
More free board games to play online: Gomoku, Reversi, Four in a Row, Chess and Dots and Boxes.