Gomoku

Black and White take turns placing stones where the lines cross. The first to line up five of their stones — across, down or diagonally — wins.

Choose your settings and press Start

Opponent
CPU level
Your color (Black moves first)
Rules

Fine-tune the rules
Board size (lines)
Six or more in a row (overline)
Forbidden moves for Black

With forbidden moves on, Black may not play a point that makes a double-three, a double-four or an overline (those points are marked with ×). Black can’t win with an overline; for White, the overline setting above applies.

Undo (take back a move)
Report a bug

Only the site operators can read your report. It will not appear in public comments.

Do not include your name, school, address, contact details, or links. The game version and browser type are attached automatically. Privacy

ver 1.0.0 · Updated

Release notes
  1. · ver 1.0.0Added the version label and release notes.
  2. Added the English version.
  3. First published.

How to Play Gomoku

Gomoku is a two-player strategy board game played with black and white stones on a grid. Players take turns placing one stone on an empty intersection, and the first to get five stones of their color in an unbroken line — horizontally, vertically or diagonally — wins. That’s the whole game, which is why people also call it “five in a row”. You can play it with nothing more than a Go board or a sheet of graph paper, yet the back-and-forth of blocking your opponent’s lines while building your own is surprisingly deep.

Here you can play Gomoku online for free against the computer at three levels, or with a friend on the same device. There’s nothing to install and no account needed.

Placing stones

Black and white stones numbered 1 to 6 placed alternately near the center of the board. A dashed blue ring marks an empty intersection
Black moves first; then the players take turns placing one stone on an intersection.

The board in this game has 15 horizontal and 15 vertical lines (you can also choose a 19×19 Go board). Stones go on the points where lines cross, not inside the squares. Black always plays first, then White, then Black, one stone at a time. The first stone can go anywhere, but most players start in the center. Once a stone is placed it never moves and is never captured, so the board only ever fills up.

When you play the computer, you can choose to be Black, White or a random color. If you turn on Confirm before placing, your first tap shows a faint stone where you’re about to play, and a second tap (or the Place here button) confirms it — handy on a phone, where the intersections are small.

Five in a row wins

Black has five stones in a horizontal row and White five in a diagonal row, each joined by a red line
Five in any direction — across, down or diagonally — wins the game.

Line up five of your stones with no gaps and you win. An empty point or an opponent’s stone in the middle breaks the line. Rows along the edge of the board count just the same. When someone wins, the game draws a red line through the winning five. If the whole board fills up and nobody has made five, the game is a draw.

Fours and threes: what to block

Green check marks on both empty ends of a black row of three, and on the open end of a black row of four
Play on a green mark to block. Block a four at once, and an open three soon.

Two shapes come up in every game. A four is a line that needs just one more stone to become five. If your opponent has a four, you must block that point immediately or you lose. An open three is three in a row with both ends empty. If you ignore it, it becomes an open four — four in a row with both ends empty — and you can only block one end, so it’s already too late. When your opponent makes an open three, block one of its ends. Watch out for “split” shapes with a one-point gap, such as X X _ X: they are just as dangerous.

Gomoku Rules: Freestyle, Exactly Five and Renju-Style

Gomoku rules vary a little from place to place. The two big differences are what happens when someone makes six or more in a row, and whether the first player (Black) has forbidden moves. In this game you can pick one of four rule sets, or mix and match under “Custom”. All of them use a 15×15 board except the last, which uses a full 19×19 Go board.

Rule setSix or more in a rowBlack’s forbidden moves
Freestyle (standard)WinsNone
Exactly fiveDoesn’t winNone
Forbidden moves for BlackForbidden for Black, wins for WhiteDouble-three, double-four, overline
Large 19×19 boardWinsNone
Six black stones in a horizontal row, labeled six or more equals overline
Six or more in a row is called an overline. Whether it wins depends on the rules.

A line of six or more is called an overline. In freestyle gomoku an overline wins like any five. With the “Exactly five” rule (often simply called standard gomoku), only a line of exactly five wins; an overline doesn’t count and the game goes on.

Forbidden moves for Black (Renju-style)

A black stone on the point where a vertical pair and a horizontal pair meet would make two open threes. That point has a red cross
A point that makes two open threes at once is a double-three. With forbidden moves on, Black can’t play there.
A black stone on the point where a vertical three and a horizontal three meet would make two fours. That point has a red cross
A point that makes two fours at once is a double-four — also forbidden for Black.

Without restrictions, the first player has a big advantage. Strong players have long known that Black can force a win, and computer researchers later proved it for the 15×15 board. To balance the game, some rule sets give Black a few forbidden moves. Renju, the tournament version of five in a row, is built on this idea (it also uses special opening rules, which this game doesn’t include).

There are three forbidden moves for Black: a double-three (one move that creates two open threes), a double-four (one move that creates two fours, including two fours on the same line), and an overline. In this game, forbidden points are marked with a red × on Black’s turn, and you can’t play there. White has no restrictions and even wins with an overline. One important exception: if Black’s move makes exactly five, it wins even if it also forms a double-three or double-four. Also, a three that is already blocked at one end by a stone or the edge of the board is not an open three.

If the only empty points left are forbidden ones, Black has to pass (this is very rare). If both players pass in a row, or the board fills up, the game is a draw.

Gomoku Strategy: Tips to Win

A green check on the point where Black would make a vertical four and a horizontal three at the same time
A four-three — a four and an open three in one move — can’t be stopped.

1. Aim for a four-three

The classic winning move is the four-three: a single stone that makes a four and an open three at the same time. Your opponent has to block the four, and then your three becomes an open four that can’t be stopped. Almost every game of gomoku is won by a four-three or a double-three. (If you are Black with forbidden moves on, double-threes and double-fours aren’t allowed, so the four-three is your main weapon.)

2. Never miss your opponent’s fours and threes

The most common way to lose is to get so focused on your own attack that you miss your opponent’s open three. Before every move, scan the board for any place where your opponent could make a four or an open three next turn. Split threes (three stones with a one-point gap) are especially easy to overlook.

3. Block in a way that helps you

When you block an open three, you can usually choose which end to play. Pick the end that is closer to your own stones. That way the same move defends and builds a two or a three of your own, setting up your next attack.

4. Keep your stones connected

Place new stones near your existing ones so that each stone takes part in several lines — horizontal, vertical and diagonal. A stone that belongs to two or three potential lines makes it much easier to create a four-three or double-three later. Scattered stones rarely become a threat.

5. Use a chain of fours (VCF)

Every time you make a four, your opponent must block it — they have no choice. Playing four after four and finishing with a four-three or an open four is called a victory by continuous fours, often shortened to VCF. It gives your opponent no time to breathe, so it’s deadly when you can find one. When your opponent has many stones gathered in one area, block early so they can’t start one against you.

6. As White, defend first

Playing second, White usually spends the opening blocking Black’s threes and fours. Stay patient, defend solidly, and counterattack once Black’s attack runs out of steam. With forbidden moves on, White has an extra trick: force Black into a position where the only way to block is a forbidden point.

Gomoku FAQ

Is it better to go first or second?

First. In freestyle gomoku, Black can always win with perfect play. For a fairer game, choose “Forbidden moves for Black”, or swap colors after every game.

Can Gomoku end in a draw?

Yes. If the board fills up without anyone making five, it’s a draw. With forbidden moves on, it’s also a draw if the only empty points left are forbidden and both players pass in a row.

What is the difference between Gomoku and Renju?

They share the same goal — five in a row — but Renju is a tournament game with forbidden moves for Black and special opening rules to make the game fair. The “Forbidden moves for Black” setting here uses Renju’s forbidden moves without its opening rules.

Which computer level should I choose?

If you’re new, start with Easy. It’s busy building its own lines, hardly notices your threes, and often forgets to block your fours — make a three, turn it into a four, and you should win. Next, try Normal. It pays some attention to your lines but still misses many threes and sometimes a four. Hard extends its own lines while watching yours and blocks threes more often. It only slips up now and then, so aim for shapes it can’t stop, like two threes at once.

Can I undo a move or get a hint?

Yes. With Undo turned on, the Undo button takes back your last move (together with the computer’s reply). The Hint button shows, with a blue ring, the move the Hard computer would play. The result screen shows how many hints and undos you used.

Can two people play on one device?

Yes. Choose “A friend” as your opponent and take turns. Black moves first, and the bar above the board shows whose turn it is. Undo takes back one move at a time.

The intersections are hard to tap on my phone

Turn on “Confirm before placing” (it’s on by default on phones and tablets). Your first tap shows a faint stone; tap the same spot again or press “Place here” to play. Your game is saved in the browser, so you can close the page and press Continue later on the same device.

History of Gomoku

The name Gomoku comes from the Japanese gomoku narabe, “lining up five stones”. The game is usually traced back to Japan in the mid-Edo period (the 1700s), when a game called itsutsu-ishi (“five stones”) was played, and it spread as an easy game to play with an ordinary Go board and stones. By the late Edo period there were already books explaining how to play it well. In the Meiji era, a newspaper published a way for the first player to win every time, and this led to Renju, a competitive version with forbidden moves for Black and fixed board sizes.

Today Gomoku is played all over the world under its Japanese name, and it has long been a favorite testing ground for computer game research: in the 1990s, researchers proved with computer searches that the first player can always win freestyle gomoku on a 15×15 board. For human players, though, spotting the right four-three at the right moment is as exciting as ever.