Play Xiangqi

Xiangqi endgames, solved

With few pieces left, xiangqi is small enough to work out completely. We ran every legal position of these endgames through the rules engine used on this site and traced each one back from checkmate. The tables below are the results, so you can decide whether to trade down before you do it.

How to read the tables

We also compared 625 sampled positions with Pikafish, a strong open-source engine. Win or draw and mate length agreed on all of them.

Against a lone general

Stronger side hasWinsLongest
Chariot100%2
Horse100%7
Cannon0%—
Soldier84.7%10
Cannon + advisor100%9
Cannon + elephant0%—
Cannon + soldier84.7%10
Two soldiers97.8%10

A chariot finishes almost at once, since no position needs more than two moves. Your own general does half the work by closing a file.

Black is not in check, but the chariot on f8 covers e8 and f9, and Red's general closes the d-file. Having no legal move loses the game.

A cannon alone cannot win, not from a single position. Add an advisor and every position becomes a win. An elephant does not do the same job: cannon and elephant win none of them. Our guess at the reason is that a cannon needs a screen to give check, and the advisor can provide one close to the palace.

Keep your soldier off the last rank

The 84.7% for a lone soldier hides a sharp rule: a soldier anywhere but the last rank always wins, and a soldier on the last rank never does. It wins from all 2,394 positions on the other ranks, including from its own side of the river, and from none of the 432 on the last rank.

This soldier has reached the last rank. From here it can only step sideways, and no position of this kind can be forced to a win.

Soldiers cannot go backward, so this is the most expensive mistake in the small endgames. When you are winning with a soldier, do not hurry it forward. Two soldiers win far more often, and they mate side by side.

The soldier on e8 gives check. The soldier on f8 protects it and guards f9, and Red's general closes the d-file.

Against defenders

Attacker vs defendersWinsLongest
Chariot vs advisor100%5
Chariot vs elephant100%6
Chariot vs two advisors100%10
Chariot vs two elephants100%12
Chariot vs advisor + elephant100%8
Horse vs advisor99.7%19
Horse vs elephant24.1%16
Horse vs two advisors7.3%22
Horse vs advisor + elephant9.1%22
Horse vs two elephants0.5%15
Soldier vs advisor8.4%7
Soldier vs elephant3.5%7

A chariot beat every defence of up to two pieces in this table. A horse is a different story: one advisor almost always falls, but one elephant holds in about three positions out of four, and a pair of defenders usually holds.

The tables stop at three pieces besides the generals, so they do not cover a chariot against a full set of advisors and elephants.

What to do with this

  1. Before trading into a cannon endgame, check you still have an advisor. Without one, the cannon cannot finish.
  2. Against a horse, keep two defenders if you can. One advisor almost always loses, while two defenders usually hold.
  3. Count the soldier's rank before you push. One step too many turns a sure win into a draw.

You can play these out against the computer or test yourself on endgame puzzles. The mates they end in are in checkmate patterns.


Play a game