KOJP

Xiangqi (Chinese Chess) Online Game

Cross the river, break into the palace. Three computer levels or two players

Checkmate the enemy general

Tap a piece to see gold dots on every point it can reach and a red ring on every piece it can capture. Red moves first.

Controls

Tap a piece, then a point, or drag and drop
Arrow keys to pick a point, Enter to move
Undo (Ctrl+Z) · 3 computer levels · 2 players

What is Xiangqi?

Xiangqi (象棋), also called Chinese chess, is a board game on a 9 by 10 grid where Red and Black each move 16 pieces in turn and win by checkmating the enemy general (帥 or 將). A river runs across the middle and each side has a palace, and the way pieces change once they cross the river is what makes the game so distinctive.

Pieces sit on the intersections of the lines, not inside the squares. Red moves first. When your general is attacked you are in check and must answer it at once; if no move can escape, it is checkmate and the game is over. This version plays with the full standard rules, offers easy, normal and hard computer opponents, and lets two people share one screen.

How do the Xiangqi pieces move?

Each side has 1 general, 2 advisors, 2 elephants, 2 horses, 2 chariots, 2 cannons and 5 soldiers, 16 pieces in all. The chariot is the strongest, the horse and elephant are blocked when their path is occupied, and the cannon jumps over exactly one piece only when it captures.

PieceRed · BlackMovementValue
General帥 · 將One point orthogonally inside the palace. The two generals may not face each other on an open filenone
Advisor仕 · 士One point diagonally inside the palace2
Elephant相 · 象Exactly two points diagonally. Blocked if the midpoint (the elephant's eye) is occupied, and it may never cross the river2
Horse傌 · 馬One point orthogonally, then one point diagonally outward. Blocked if the first point (the horse's leg) is occupied4
Chariot俥 · 車Any distance orthogonally until something is in the way9
Cannon炮 · 砲Moves like a chariot. To capture it must jump over exactly one piece (the screen) and take the first piece beyond it4.5
Soldier兵 · 卒One point forward. After crossing the river it may also move one point sideways. It never moves backward and is never promoted1 to 2

The values are what the computer uses to judge a position, and a soldier that has crossed the river counts almost double because it can move sideways. Blocking a horse's leg and blocking an elephant's eye are the two classic defensive tricks of the game.

What are the river and the palace?

The band in the middle marked 楚河 漢界 is the river, and the 3 by 3 area with the X at each end is the palace. Elephants cannot cross the river, soldiers must cross it before they can move sideways, and the general and advisors can never leave the palace.

The river is named after the border between the ancient states of Chu and Han. The files look interrupted at the river, but chariots, horses, cannons and soldiers cross it freely. The palace has nine points, and its diagonals are the advisor's paths. A soldier that reaches the enemy palace becomes the cheapest attacker in the game, sliding sideways to squeeze the general.

What are the check rules?

A check must be answered immediately, and you may never make a move that leaves your own general attacked or makes the two generals face each other. If the same position repeats three times and only one side has been giving check the whole time, that side loses.

How is Xiangqi different from Korean Janggi?

The board size and piece count are the same, but Xiangqi has a river, its general cannot move diagonally, its cannon only jumps when capturing, and its elephant moves two points diagonally. Playing both makes the differences obvious. You can also play Janggi against the computer here.

ItemXiangqi (Chinese)Janggi (Korean)
BoardRiver in the middle, files interruptedNo river, all lines continuous
GeneralOrthogonal step in the palace, generals may not face each otherOrthogonal or diagonal step in the palace, facing is allowed
AdvisorDiagonal step onlyOrthogonal or diagonal step like the general
ElephantTwo points diagonally, cannot cross the riverOne orthogonal then two diagonal, anywhere on the board
CannonMoves like a chariot, jumps one piece only to capture. Can jump and take cannonsMust jump even to move, cannot jump or take another cannon
SoldierSideways only after crossing the riverForward or sideways from the start
SetupFixed (chariot, horse, elephant, advisor, general)Players choose one of four horse and elephant arrangements
No legal moveThat side losesDraw, or the side passes
PiecesRound discs with charactersOctagons of different sizes

How strong are the computer levels?

Easy looks two plies ahead and deliberately mixes in shaky moves, normal looks four plies ahead, and hard reads as far as it can within one second, usually five to seven plies. All three avoid moves that would lose by perpetual check.

The engine uses alpha beta pruning with iterative deepening and keeps examining captures until the position is quiet. Hard thinks on a separate worker thread, so the screen never freezes while it calculates. On the first screen you can choose to play Red (moves first) or Black (moves second); choosing Black flips the board so your pieces are at the bottom. Wins, losses and draws are kept per level in this browser.

Tips for Xiangqi beginners

  1. Open with the central cannon. Moving a cannon to the central file (the famous 當頭炮) threatens the central soldier and starts the attack fastest. The usual reply is to jump a horse to defend it.
  2. Get the chariots out early. A 9 point chariot stuck in the corner wastes everything your cannons and horses are doing. Jump a horse first to open a path for the chariot.
  3. Watch the horse's leg. A piece placed right next to an enemy horse stops it jumping that way. Do not park your own soldiers on the points your horse needs.
  4. Steal the cannon's screen. A cannon with nothing to jump over cannot capture. Remove the middle piece on the line it aims along, or give your own cannon a screen to create a threat.
  5. Soldiers double across the river. A sideways moving soldier is the cheapest way to squeeze the enemy palace, but soldiers that have not crossed are easy to lose, so do not push them carelessly.
  6. Use the flying general. In the endgame, put your general on the same file as the enemy general and the piece between them is pinned. Half of all checkmate patterns come from this.

Controls

The pieces use the traditional Chinese characters (Red 帥仕相俥傌炮兵, Black 將士象車馬砲卒). The board and pieces are drawn entirely in code; only your records and settings are stored in this browser and nothing is sent to a server.

Frequently asked questions

Is Xiangqi free to play here?

Yes. No sign up or download, just play on this page. It works on computers, phones and tablets.

Is Xiangqi the same as Chinese chess?

Yes. Xiangqi is the Chinese name of 象棋 and Chinese chess is its English name. It is the game played on a 9 by 10 board with a river in the middle and a palace at each end.

How does the cannon move?

It moves like a chariot, any distance along a line until something blocks it. To capture it must jump over exactly one piece, friend or foe, and take the first enemy piece beyond that screen. Cannons can be screens and can be captured by cannons.

Why can the two generals not face each other?

A move that leaves the two generals on the same file with no piece between them is illegal. The general is treated as attacking along the file like a chariot, so the last piece between them is pinned in place.

What happens if I keep giving check?

When the same position appears for the third time, a side whose every move in between was a check loses. If neither side or both sides were checking, the game is a draw. The computer avoids losing this way too.

What is the biggest difference from Korean Janggi?

Xiangqi has a river, the general and advisors cannot move diagonally, the elephant cannot cross the river, and the cannon does not need to jump when it merely moves. Soldiers move sideways only after crossing, and having no legal move loses instead of drawing.

How strong is the hard computer?

It reads as deep as it can within one second, usually five to seven plies. It almost never gives away a chariot for free, so start on easy or normal if you are new to the game.

Where are my records stored?

Wins, losses and draws per level and your sound and hint settings are stored only in this browser. Nothing is sent to a server, and clearing browser data removes them.