Shogi notation

Shogi notation is the set of various abbreviatory notational systems used to describe the piece movements of a shogi game record or the positions of pieces on a shogi board.
A record of an abstract strategy board game such as shogi is called kifu (棋譜) in Japanese.
The system used in English language texts to express shogi moves was established by George Hodges and Glyndon Townhill in 1976 by the second issue of Shogi magazine. A slightly modified version was used in Hosking (1996). It is derived from the algebraic notation used for chess, but differs in several respects. A typical move might be notated P86 or P-8f. The notation format has the following 5 part structure:
An example using all 5 parts is S72x83+ or S7bx8c+. All parts are obligatory except for the origin and promotion parts. (Thus, most notation strings only contain 3 parts.) The origin part is only indicated when needed to resolve ambiguity. The promotion part is only needed when there is the possibility of promotion.
Western notation is not used in Japanese language texts, as it is no more concise than traditional notation with Japanese characters (kanji) and two ciphers which originated in the Edo period.
The first letter represents the piece moved. For instance, P is for Pawn. Below are the abbreviations used.
Promoted pieces are indicated by a + preceding the letter. For example, +P is a promoted pawn (と tokin), +R is a promoted rook (that is, a dragon 龍).
Some Japanese websites (such as 81Dojo) and Japanese authors use two different abbreviations for the promoted rook and promoted bishop in a way more similar to Japanese notation. Thus, D (for dragon) instead of +R and H (for horse) instead of +B. Additionally, a promoted pawn can be encountered as T (for tokin) instead of +P.
In cases where the moving piece is ambiguous, the starting square is added after the letter for the piece but before the movement indication.
For example, in diagrams below, Black has three golds which can move to square 78. Thus, simply notating G-78 is not enough to indicate the move. The three possible moves are distinguished via the origin specification as G77-78, G68-78, or G79-78.
Following the abbreviation for the piece is a symbol for the type of move. There are 3 different indications:
As examples, P-24 indicates moving one's pawn to the 2d square (without capture), Px24 indicates moving one's pawn to the 24 square and capturing the opponent's piece that was on 24, and P*24 indicates dropping one's pawn in hand to the previously empty 24 square. (Note the x indication is a significant departure from Japanese notation, which has no way of signaling whether a piece was captured.)
There is some variation for the drop symbol. A * (asterisk) is often used, but some books (e.g. Hosking (1996) use a ’ (apostrophe) instead. Thus, Hosking B’56 is equivalent to Hodges B*5f.
The simple movement indication (the hyphen -) is not used by Hosking (1996) who does not use a movement symbol. Thus, Hosking P26 is equivalent to Hodges P-2f.
After the movement piece indication is the square on which the piece lands. This is indicated by a numeral for the file (1–9) and the rank (1–9), with 11 being the top right corner from Black's perspective and 99 being the bottom left corner. This is based on Japanese notation conventions.
Hosking differs from Hodges in that Hosking uses numerals for the rank notation whereas Hodges uses letters (a–i) for the rank.
If a move entitles the player to promote, then a + is added to the end if the promotion was taken or an = if it was declined. For example, Nx73= indicates an unpromoted knight capturing on 73 without promoting while Nx73+ indicates an unpromoted knight capturing on 73 and promoting. The promotion status is always omitted in situations where promotion is not possible. When promotion is possible, then the promotion status is obligatorily notated.
Game moves in western notation are always numbered (unlike Japanese game records). Additionally, what is numbered are pairs of two moves – the first move by Black, the second by White – instead of numbering each move by each player. This also differs from the Japanese system. For instance, three pairs of moves (or six individual moves) are numbered as 1.P-76 P-34 2.P-26 P-44 3.S-48 S-32. However, in the British Shogi magazine of the 1970s and 1980s, the pair number convention was not used for tsumeshogi problems, in which case the each player's move is number just as in the Japanese notation conventions.
Following western chess conventions, omitted moves are indicated with an ... ellipsis. As a consequence of the way moves are numbered in the western system, all moves by White are notated with an ellipsis prefix in texts. For example, ...P-55 indicates a move by White while P-55 indicates a move by Black. In handicap games, White plays first, so Black's first move is replaced by an ellipsis. For example, 1...G-32 2.P-76 G-72.
Unlike western chess, game states like check or checkmate are not typically notated. However, the use of question marks and exclamation points to indicate questionable and good moves, respectively, are occasionally used.
The earliest way to indicate game records in Japan during the Edo period was to use descriptive sentences such as Open the bishop's diagonal, push the rook's pawn, close the bishop's diagonal and the like. Soon afterward, a notational system was developed which is mostly the same as what is used in the present day in Japan.
In Japanese notation, the notation string has the following five-part format:
A typical move is indicated like ８六歩 (equivalent to western P-86). An example that uses all five parts is ☗８三銀引成 (which could be either S72-83+ or S72x83+ in western notation). The player's side information is optional and the movement and promotion indications are only used in order to resolve ambiguity.
It is common for the White (gote) and Black (sente) player to be indicated at the beginning of the notation string with either black and white triangles (▲/△) or shogi-piece-shaped pentagons (☗/☖), such as ▲７六歩△３四歩▲２六歩△３二金 or ☗７六歩☖３四歩☗２六歩☖３二金. However, this is not obligatory: several books notate shogi moves without explicit indication of which player is making the moves. (See the adjacent image for an example.) In such cases, knowing which player the move refers to can be determined by the context in the book. This white/black convention is more common when the moves are not numbered (which is also optional to notate).
For the board's coordinates, the file is indicated with an Arabic numeral followed by the rank indicated with a Japanese numeral (instead of an Arabic number or letter like in the western system). For example, square 23 in Japanese notation is ２三.
Earlier (for instance, in the Edo period), only Japanese numerals were used for both file and rank coordinate.
There is also an abbreviatory convention: when a piece moves to the same coordinates as the previous move's piece (as in a capture), the position is simply indicated with 同 (which is pronounced dō or onajiku) instead of the file-rank coordinate numbers. For example, if Black's pawn moved to a square in which White's pawn captured Black's pawn and then both players' bishops recaptured followed by a rook recapture, this could be notated as ☗２四歩 ☖同歩 ☗同角 ☖同角 ☗同飛 which would be equivalent to the western notation sequence 1.P-24 Px24 2.Bx24 Bx24 3.Rx24. 同 always implies a capture (although not all captures will use 同, of course). In some cases where the coordinates may be forgotten by the reader (for instance, if its antecedent is separated by a page turn or several paragraphs of text), then the number coordinates will precede 同 to aid the reader like this: ☖２四同歩. An alternate symbol 仝 is used instead of 同 in older books.
It is also possible to encounter Arabic numerals for both the file and rank coordinates, such as ☗２４歩 instead of ☗２四歩.
Also, since Japanese is often written vertically from top to bottom, the notation may be written vertically as well with the top number indicating the file and rank number below the file number. Finally, in older books of the Edo period, the notation may be written from right to left (as is the case with traditional vertical writing) even when the notation is written horizontally. However, this older practice is not used in the modern period, where horizontally writing is read from left to right following European language traditions. (See the 1839 game record image below for such an example.)
Pieces are indicated with kanji (instead of letters as in the western system). The piece's kanji follows the piece's board coordinates. The following symbols are used.
Promoted pieces are indicated with a 成 prefix except for the promoted pawn, promoted bishop, and promoted rook, which are と, 馬, 龍, respectively.
The character for dragon 龍 can also be encountered as its shinjitai form 竜 as well.
兵 is used instead of 歩 in some older texts.
In tsumeshogi, the character 合 is used essentially as a variable that represents a piece of any value. It is used to indicate to an interposing piece (of any kind) that is placed between the king and the opponent's checking piece.
When there is ambiguity in piece movement, there is a complex system of movement description using the symbols below. The movement descriptors consist of (a) a dropped piece indicator, (b) movement indicators, and (c) relative piece origin indicators.
The symbol for a dropped piece is 打 following the piece's character. In the usual course of a game, most dropped pieces will probably be unambiguous. In these unambiguous cases, explicit notation for the dropped piece is not required and usually omitted (unlike in western notation where the drop notation is obligatory). For example, a western notation such as P*23 will be notated simply as ２三歩 instead of ２三歩打. In other situations, there is a possibility that either a piece that is already in play on the board can move to a certain square or a piece of the same kind that is held in hand can be dropped to that square. In this case, when the piece on the board moves to that square, the notation simply notates the move as usual with no drop indication. However, when the piece in hand is dropped to that location, then the drop indication must be present in the notation in order to resolve the ambiguity. In other words, 打 is only used when the following two conditions are met: (i) a piece is dropped and (ii) there is ambiguity with another piece on the board.
For ambiguity resolution with pieces on the board, the main notation symbols are 引 for downward movement, 寄 for horizontal movement, and 上 for upward movement. Note that these three indicators describe movement toward their destination square.
In the example below, three golds can move to the ７八 square. The gold that originates on ７七 and moves down is notated as ７八金引 (= G77-78). The other two possibilities are notated as ７八金寄 (= G68-78) and ７八金上 (= G79-78).
The 引 and 上 indicate downward and upward movement, respectively, that can be both vertical as well as diagonal.
Unofficially, in some literature there exist two alternate symbols that are used instead of 上: 行 and 入. However, these alternate symbols are reserved for indicating only the two most powerful promoted dragon 龍 and horse 馬 pieces. Thus, ５五龍行 or ５五龍入 instead of ５五龍上, but not ５五金行 or ５五金入.
In certain situations, an indication of movement toward the destination square (that is, with 引, 寄, 上) is not sufficient to resolve ambiguity. In these cases, the origin square of the piece is notated with a relative positional indicator. These are 右 for a piece moving from the right (and thus moving leftward) and 左 for a piece moving from the left (rightward). For silvers, golds, and promoted pieces with gold-like movements (成銀, 成桂, 成香, と), if there is ambiguity and the pieces are side-by-side, then a piece moving straight forward is indicated by 直.
This positional information is relative to each player's directions. Thus, △５二金右 (literally: "white 5-2 gold right") refers to the gold general on the right from White's perspective (which would be on the left from Black's perspective).
If there are three or more identical pieces, it is possible that an origin indicator (左 or 右) followed by a movement indicator (上 or 引) will be needed.
Additionally, the 直 indicator tends to always be used for vertical movement even when simply using 右 ("right") and 左 ("left") would suffice. Relatedly, 直 is not recommended to be used for dragons and horses.
A piece that promotes is indicated with 成 (naru) following the piece's character, such as ７三桂成 (N-73+). If a piece does not promote, this is indicated with 不成 (narazu) following the piece's character, such as ７三桂不成 (N-73=).
There is an alternate symbol for non-promotion: 生 is sometimes used instead of 不成 – for instance, ７三桂生 instead of ７三桂不成.
Unlike western notation, numbering Japanese game records is not obligatory. Although players' moves often are not numbered, shogi moves are always counted per player's move. This is commonly seen in checkmate problems where a 3-move (３手) checkmate problem would mean a move sequence of black-white-black. This is unlike western chess which counts each pair of moves as one move. (In western notation for shogi, the move numbering tends to follow western chess notation conventions.)
Shogi games are officially over when a player formally resigns. The resignation is notated as 投了 tōryō. Other possible endings include rare 千日手 draw by repetition, 反則手 illegal move, and the very rare 持将棋 draw by impasse.
Unlike western notation, a capture of a piece is never explicitly notated in the Japanese system since the capture can be understood in the context of the game. However, when 同 is used, it always implies a capture. So, in this sense 同 is a notated capture. But, other captures of pieces that do not have the same coordinates as the preceding move are simply not indicated in the notation system.
In addition to the usual kanji symbols, there are also shorthand versions of piece symbols that can be written very quickly. For several of the symbols, there is variation in what shorthand symbol is used – the ones listed here may not be exhaustive of all the alternatives used in Japan.
A notation used in older times was the iroha notation. It used the syllables of the Japanese poem Iroha (いろは歌) (as well as other Japanese characters) to label each square on the shogi board.
For example, the 23 square was indicated by the symbol を. Tokugawa Ieharu (the tenth shōgun 1760–1786) favored this notational system. Therefore, it was used for all castle game records during his reign.
The Kitao–Kawasaki notation is a hybrid notation introduced by the Nekomado publishing company in English translations of shogi books by Madoka Kitao and Takashi Kaneko. The system incorporates elements of both the western and the Japanese notation systems.
The order of elements is the same as the western system except that a player's side argument is added.
A typical move is indicated like ☗歩-86 (western equivalent: P-86). An example that uses all 6 parts is ☗銀(72)x83+ (S72x83+ in western notation).
As an example, a Tempo Loss Bishop Exchange game might proceed and be notated like this:
Below is another notated game (Ishida opening) showing the more typical Japanese notation where moves are not numbered, dropped pieces are not indicated, and white/black turns are marked. It also shows an example of ambiguity resolution (G69-58/５八金左) and a piece entering a promotion zone that remains unpromoted (Sx23=/２三銀不成).
SFEN is an extension of Forsyth–Edwards Notation (FEN) used for describing board positions of shogi games.
Formally, an SFEN is a text string of ASCII characters. It has four fields that are separated by a space. The fields:
The following is an example (from a Tempo Loss Bishop Exchange opening)
In this example, the first field is lnsgk2nl/1r4gs1/p1pppp1pp/1p4p2/7P1/2P6/PP1PPPP1P/1SG4R1/LN2KGSNL, the second is b, and the third is Bb. The fourth field is omitted, which is allowed.
For the first field, each piece is represented with a single letter. Gote's pieces are lowercase letters while Sente's pieces are uppercase letters. The set of letters used are the same as the ones used in western notation (p, +p, l, +l, n, +n, s, +s, g, b, +b, r, +r, k). Each rank is separated by a forward slash (/). The listing of ranks is from top (rank 1) to bottom (rank 9), and the order to pieces is from file 9 to file 1 (in other words, from left to right as viewed on typical shogi diagram with gote as the top player and sente as the bottom player). Empty squares are indicated with numeral corresponding to the number of adjacent empty squares on the same rank. In the example, rank 1 is lnsgk2nl which indicates sequence of lance, knight, silver, gold, king followed by two empty squares to the right of the king and a sequence of knight and lance.
The second field can be either b for Black's turn to play or w for White's turn to play. In the example, b indicates that Black has the next move.
The third field contains all of the pieces in hand held by each player. Black's pieces in hand use capital letters while White's pieces in hand use lowercase. In the example, the Bb indicates that Black has one bishop in hand (B), and White also has one bishop in hand (b). In SFEN holdings, if there are more than one piece of a type in hand, it is preceded by the piece count, e.g. 3P for three pawns in hand.
The fourth field is a integer representing the current move of the game. Moves are counted under shogi convention, meaning the move count is incremented with a single player's action. This field is specified as optional, but a program may require it for reading SFENs; for that reason, most programs will include the move count field when exporting positions.
Below is another example showing the board position for Yoshiharu Habu's famous 52 silver drop in an NHK game (Bishop Exchange Climbing Silver opening) with Hifumi Katoh.
The KIF file format is used for saving full games of shogi. Internally, it uses Japanese notation in the UTF-8 text encoding, and each move is disambiguated with an origin square.
The KI2 file format is similar to the KIF format but more compact. Moves are only disambiguated with the standard Japanese relative direction kanji.
Another format for saving positions and games of shogi, which only uses ASCII internally. Mostly used in the computer shogi arena.
Portable Shogi Notation is a derivative of the Portable Game Notation used in chess, expanded to specify shogi pieces and drops. It uses the Hodges coordinate system. It has little support outside of GNU Shogi.
GNU Shogi also uses EPD instead of SFEN: the same board description, but with holdings appended in square brackets. Each held piece is listed, e.g. PPP for three pawns in hand. The following field for player to move has colors reversed from SFEN: w for sente, and b for gote.