Skip to the game
Tic Tac Toe

Gomoku

Set black and white stones on a 15×15 board and make five in a row first, in Gomoku against a three-level computer or a friend.

Play Gomoku

You
0
Draws
0
Computer
0

Loading the game…

Five or more in a row wins. Black moves first.

Click a point to place a stone. On a touch screen, tap once to aim and again to place. With a keyboard, move with the arrow keys and press Enter. U undoes and N starts a new game.

Game settings
Changing a setting starts a new game. Each opponent keeps its own score.
Opponent
Difficulty
You play

The board has 15×15 points. Stones go on the crossings, and lines of six or more also win.

How it works

How to play Gomoku

Black opens, each turn adds one stone to an empty crossing, and the first unbroken line of five, in any direction, takes the game.

  1. Step 01

    Place a stone

    Black moves first. Click a crossing to place your stone; on a phone, tap once to aim and again to place it.
  2. Step 02

    Build toward five

    Line up your stones across, down, or diagonally. Five or more in an unbroken line wins the game.
  3. Step 03

    Block in time

    Stop an open line of three before it becomes four. An open four, with both ends empty, can't be blocked.

Features

Gomoku on a wooden 15×15 board

  • Opponents from casual to eight moves deep

    Easy plays by feel and sometimes misses a four. Medium looks two moves ahead. Hard searches deeper for up to 0.7 seconds a move.

  • Black and White, side by side

    Share the screen and take turns as Black and White, with a scoreboard for both.

  • A real Gomoku board

    A wooden 15×15 board with star points, stones that sit on the crossings, a dot on the last move, and a line through the winning five.

  • No misplaced stones

    On a touch screen, the first tap shows where your stone will go and the second places it.

  • Undo and saved games

    Take back a move, and the computer's reply with it. Scores and the game in progress are saved in your browser.

  • Keyboard play

    Move a cursor with the arrow keys and press Enter. Points are announced by their board names, like H8.

Strategy

Gomoku strategy: winning the race of threats

Gomoku is a race of threats. Whoever makes threats the other can't answer wins.

  • Play near the middle

    Stones in the center can make lines in every direction. Stones by the edge run out of room.

  • Know the open three

    Three in a row with both ends empty becomes an open four next move, and an open four can't be stopped. Block an open three at once.

  • Make a double threat

    A move that makes two threes, or a four and a three, at the same time wins: your opponent can block only one.

  • Attack with tempo

    A four forces a reply. Use fours to move your opponent where you want while you build your next threat.

  • Black has the edge

    Moving first is a real advantage in Gomoku. Practice as White against Medium to get good at defending.

About the game

Gomoku: 225 points, two colors, and a line of five

The rules, freestyle and Renju, the computer levels, playing a friend, beginner strategy, and the names Gomoku goes by around the world.

Gomoku is the classic five-in-a-row game: two players take turns placing black and white stones on the crossings of a grid, and the first to line up five wins. It's also known as five in a row, Gobang, and omok. Here it's played on the standard 15×15 board under freestyle rules, against a computer with three levels or a friend sharing your screen.

Gomoku rules: five in a row wins

A Gomoku board has 15 lines each way, which makes 225 points where the lines cross. Stones go on those crossings, not inside the squares. Black moves first, and from then on the players alternate, each placing one stone on any empty point. Stones are never moved or captured, so every stone stays in play until the end.

The first player to make an unbroken line of five stones across, down, or diagonally wins, and a line is drawn through the winning stones. If all 225 points fill up with no five, the game is a draw.

Freestyle Gomoku, Renju, and other rule sets

This Gomoku game uses freestyle rules: five or more in a row wins, so a line of six counts too. Freestyle is the simplest set of rules and a common choice for casual games.

Other rule sets exist because moving first is a big advantage. Standard Gomoku counts only exactly five, so a line of six doesn't win. Renju, a tournament form of the game, forbids Black from making two open threes at once, two fours at once, or a line longer than five, and adds special opening rules. Those variants aren't offered here.

From a loose Easy to an eight-move Hard

Switch Opponent to Computer and pick a level under Difficulty. Whichever you choose, the computer completes a five whenever it has one, and each level keeps its own scoreboard:

  • Easy blocks your four most of the time, but not always, and otherwise picks among a handful of good-looking moves, now and then a loose one. It's the level for learning how lines grow.
  • Medium always blocks a single four and looks two moves ahead: its own move and your best reply, over its ten most promising points. It chooses among moves that score almost equally well, so games vary.
  • Hard searches deeper, up to eight moves ahead, adding a move at a time until it has used about 0.7 seconds, and stops early if it finds a forced win.

The computer scores every line of five points on the board, all 572 of them, and favors lines that hold only its own stones. It considers only points within two steps of stones already on the board, which keeps its search on the part of the board where the fight is. The center point, H8, lies on 20 of those lines, the most any point can, while a corner lies on just 3. That's why the computer always opens on H8 when you let it play Black.

Set You play to Black to take the first stone yourself, or to White to hand the opening to the computer.

Two players: fair starts and handicaps

With 2 players selected, you and a friend alternate Black and White stones on the same board, and a separate Black and White scoreboard keeps the record. Undo takes back one stone at a time here, rather than a pair.

Black's head start is real, so between equal players, swap colors every game. When one of you is much stronger, a simple handicap is to give the weaker player Black every time. The game lives on one screen, so you'll want to sit together; there's no way to invite someone to a board from elsewhere.

Threes, fours, and double threats

Gomoku is a race of threats, and a few terms make the tactics easier to talk about:

  • An open three is three in a row with both ends empty. Left alone, it becomes an open four.
  • An open four has both ends empty, so it can't be stopped: block one end and your opponent plays the other.
  • A four with one end blocked still forces a reply, because it threatens five on the next move.
  • A double threat, such as a four and a three at once, gives your opponent two things to stop. They can answer only one.

So block an open three as soon as it appears, and attack with tempo: each four you make forces your opponent to answer where you choose while you build the next threat. Start near the center, where stones can grow lines in every direction, and keep your stones close enough to share lines. If you've played 9x9 Tic Tac Toe, which also needs five in a row, you'll recognize many of the same ideas.

Teaching a child five in a row

Gomoku is easy to teach a child who already plays Tic Tac Toe: it's the same idea on a bigger board, with five to line up instead of three, and there are no captures or special moves to remember. Start them on Easy, which blocks most fours but leaves room to win, and move up to Medium once open threes stop catching them out.

On a tablet, the aim-then-place tap means a slip of the finger shows a see-through stone instead of placing a real one. In 2-player mode, giving the child Black every game is a simple handicap, since moving first is worth a lot.

Aiming a stone with a mouse, a double tap, or the arrow keys

With a mouse, a see-through stone follows your pointer and a click places it. On a touch screen, the first tap shows where your stone will go and a second tap on the same point places it, so a slip of the finger won't put a stone in the wrong place. The wooden board scales down to fit a phone and up to fill a monitor.

With a keyboard, Tab to the board, move the cursor with the arrow keys, and press Enter or Space. U takes a move back and N starts a fresh board. Points are named the way Go boards name them, columns A to P without the letter I and rows counted from the bottom, so the center is H8, and each move is announced for screen readers.

All of the computer's thinking happens in this browser tab, so once the board has appeared, a slow connection never slows Hard down, and the stones you place aren't sent to a server.

Five in a row, Gobang, and the history of Gomoku

The name Gomoku is Japanese: its full form, gomokunarabe, means roughly five pieces lined up. It's traditionally played with Go stones on a Go board. Older boards had 19 lines each way, and 15×15 is the usual size today. Gobang is an older English name, Korean players call it omok, and in China it's wuziqi, while many people simply say five in a row or connect five.

Gomoku players long suspected that Black can always win, and in 1993 Victor Allis and his colleagues proved it for freestyle Gomoku on a 15×15 board, using computer search methods called threat-space search and proof-number search. That's why tournament rules restrict Black or use special openings.

Like lines? Four in a Row adds gravity, so discs stack from the bottom, and Ultimate Tic Tac Toe plays nine small boards at once.

Saved positions and scoreboards

A half-played game survives closing the tab: the position is stored in this browser's local storage along with your stone color, your level, and a scoreboard for each opponent. That storage stays on this device and isn't copied to a server. Reset scores clears only the opponent you're facing, and the privacy policy names every item the site stores.

FAQ

Gomoku questions

Quick answers about Gomoku: the rules, six in a row, the computer, playing a friend, and saving.

How do you play Gomoku?

Players take turns placing a black or white stone on an empty crossing of a 15×15 board. Black moves first. The first to get five stones in a row across, down, or diagonally wins.

Does six in a row count in Gomoku?

Yes. This game uses freestyle rules, so five or more in a row wins. Other rule sets, such as standard Gomoku, require exactly five.

Is Gomoku the same as Gobang or five in a row?

Yes. Gomoku, Gobang, omok, and five in a row are names for the same game, played with stones on a grid.

Does the first player always win?

With perfect play, yes: Black can force a win on a 15×15 board, as computer search showed in 1993. Real players make mistakes, so either side can win.

Can I play Gomoku against the computer?

Yes, at three levels. Easy sometimes misses a four, Medium looks two moves ahead, and Hard searches deeper for up to 0.7 seconds a move. Play Black to open the game, or White to let the computer take H8 first.

Can I play Gomoku with a friend?

Yes. Switch Opponent to 2 players and pass the board back and forth, Black then White. If one of you is stronger, give the other player Black every game as a handicap.

How do I place a stone on a phone?

Tap a crossing once to see a see-through stone there, then tap the same crossing again to place it. Tap somewhere else to aim again.

Why does the computer open on H8?

H8 is the center point. It lies on 20 of the board's 572 possible lines of five, the most any point can, while a corner lies on just 3. When the computer plays Black, it always starts there.

Does a reload keep the stones on the board?

Yes. The stones placed so far, your stone color and level, and each opponent's scoreboard are kept in this browser's local storage, so a reload puts the same position back.