Gomoku - Free Online Five in a Row Game
Play the ancient strategy game of Gomoku. Connect five stones in a row to win. Challenge our AI or play against a friend.
About Gomoku
Gomoku, also known as Five in a Row, Gobang, or Wuzi Qi, is an ancient strategy board game that originated in China over 2,000 years ago during the Han Dynasty. Historical records suggest the game was played as early as 200 BC, making it one of the oldest known abstract strategy games still widely played today. The game spread throughout East Asia via trade routes and became particularly popular in Japan, where it's known as "Gomoku Narabe" (five stones in a row) and developed into a serious competitive pursuit.
The game is played on a grid of intersecting lines, traditionally 15x15 but sometimes on the larger 19x19 Go board. Two players take turns placing black and white stones on the intersections, with Black always moving first. The objective is elegantly simple yet deeply strategic: be the first to create an unbroken line of exactly five stones horizontally, vertically, or diagonally. Unlike Go, stones in Gomoku cannot be captured and remain on the board until the game ends, making position and foresight crucial elements of successful play.
While the rules are simple enough for anyone to learn in minutes, Gomoku offers surprising strategic depth that has captivated players for millennia. The game was mathematically "solved" in 1994, proving that with perfect play, the first player (Black) can always force a win on a standard 15x15 board. This discovery led to the development of Renju, a professional variant with additional rules to balance play. Despite being "solved," Gomoku remains immensely popular because finding perfect moves requires calculation beyond normal human capability, making every game a fresh strategic challenge.
How to Play Gomoku
- Choose Game Mode: Play against AI (Easy, Medium, or Hard) or with a friend
- Black Goes First: The black player always makes the opening move
- Place Stones: Click any empty intersection to place your stone
- Alternate Turns: Players take turns placing one stone at a time
- Win Condition: Connect exactly five stones in a row (horizontal, vertical, or diagonal)
- Draw: The game is a draw if the board fills without a winner
Rules and Gameplay
- Board Setup: The game is played on a 15x15 grid. The board starts empty, and players place stones on the intersections.
- Turn Order: Black always plays first. Players alternate turns, placing one stone per turn.
- Stone Placement: Stones are placed on empty intersections only. Once placed, stones cannot be moved or removed.
- Win Condition: The first player to get exactly five stones in a continuous row (horizontal, vertical, or diagonal) wins.
- Overlines: In standard Gomoku, six or more stones in a row also counts as a win. In professional Renju, this is forbidden for Black.
- Draw: If all 225 intersections are filled without either player achieving five in a row, the game is a draw (extremely rare).
- No Captures: Unlike Go, stones cannot be captured in Gomoku - the board only gets fuller as the game progresses.
Strategy Tips
- Control the Center: The center of the board offers the most connection possibilities
- Create Open-Ended Threes: An open-ended three (no blocked ends) threatens two ways to make four
- Double Threats: Creating two threats simultaneously is key to winning
- Block Opponent's Fours: Always check if your opponent has four in a row before making offensive moves
- Think Ahead: Consider how your move enables future positions
- Use Forcing Moves: Make moves that require immediate response from your opponent
- Build Connected Groups: Keep your stones connected to maximize future options for creating five in a row.
- Watch Diagonals: Diagonal threats are often harder to spot. Check all four directions before and after each move.
Gomoku vs Renju
Renju is a professional variant of Gomoku with additional rules to balance the game, as standard Gomoku is technically "solved" in favor of the first player. In Renju, the black player faces restrictions such as not being able to create "overlines" (more than five) or certain "double threats." Our version plays standard Gomoku rules.
Frequently Asked Questions
Is Gomoku a solved game?
Yes, Gomoku was proven to be a theoretical win for the first player (Black) in 1994 by Victor Allis. With perfect play, Black can always force a win on a standard 15×15 board. However, playing perfectly requires computing millions of positions, making the game still challenging for humans.
What's the difference between Gomoku and Connect Five?
Gomoku is played on intersections of a grid with stones, traditionally on a Go board. Connect Five typically refers to similar games played in squares like Tic-Tac-Toe. The fundamental objective is the same: connect five in a row.
Why does Black go first?
Black moving first is a traditional convention from the game of Go, from which Gomoku derives. Since going first provides an advantage, some tournament rules include swap rules or opening restrictions to balance play.
What is an "overline" in Gomoku?
An overline is a row of six or more stones of the same color. In standard Gomoku, this counts as a win. In professional Renju, Black cannot win with an overline (it's forbidden), while White can. Our version allows overlines as wins.
How does the AI difficulty work?
Easy AI makes mostly random moves with basic threat detection. Medium AI evaluates positions looking several moves ahead and prioritizes center control. Hard AI uses advanced pattern recognition and deeper search to play near-optimally.
Can I undo moves?
Yes, click the "Undo" button to take back your last move. In 2-player mode, this undoes one move. Against AI, it undoes both your move and the AI's response.
What is a "double three" or "double four"?
A double three is a move that creates two open-ended three-in-a-rows simultaneously. A double four creates two four-in-a-rows. These are very powerful moves because the opponent can only block one threat. In Renju, Black is forbidden from making these moves.
Is there a professional Gomoku scene?
Yes, primarily through Renju, which is the professional variant. The Renju International Federation organizes world championships, and the game has a particularly strong following in Japan, Russia, China, and Eastern Europe.
What board size is standard?
The standard board is 15×15, though the game can be played on a 19×19 Go board. Smaller boards (9×9 or 13×13) are sometimes used for beginners. Our version uses the standard 15×15 size.
Can I play on mobile?
Yes, our Gomoku game is fully responsive and works on touchscreens. Simply tap any intersection to place your stone. The interface adapts to different screen sizes for comfortable gameplay.
What is the relationship between Gomoku and Go?
While Gomoku and Go share the same board and stones, they are fundamentally different games. Go involves capturing territory and opponent's stones through surrounding, while Gomoku focuses solely on connecting five stones in a row. Gomoku is much simpler to learn but Go offers deeper strategic complexity. Historically, Gomoku was likely developed as a simpler game using existing Go equipment.
What is a "threat" in Gomoku?
A threat is a position where a player can win on their next move if not blocked. For example, having four stones in a row with an empty space to complete five is a direct threat. Understanding threats is crucial - you must always check if your opponent has a winning threat before making your own offensive moves, and creating multiple simultaneous threats is the key to winning.