Skip to content
barcoder

Standards/japan-post-4-state

Japan Post 4-State

Type4-State Postal
PrimaryJP
Completeness70%high

Overview

The Japan Post Customer Barcode (カスタマバーコード, kasutama bākōdo, "customer barcode") is the four-state barcode that mailers in Japan print under the address so that Japan Post's sorting machines can sort letters down to delivery order 111. It carries the 7-digit postal code followed by a 13-character address display number (住所表示番号) taken from the block, house and room numbers of the address, then a modulo-19 check character 35. Each character is three bars, and each bar has one of four shapes, which Japan Post calls "4-state 3-bar" (4ステイト3バー) 2. The symbol always has 67 bars. Printing it is optional; mailers print it to earn a postage discount on bulk letters and postcards 114.

Encoder libraries also call it the Japanese Postal Code, the Japan Post 4-State Customer Code or the Kasutama barcode 202432.

History

Japan introduced three- and five-digit postal codes in 1968 and the seven-digit system in 1998 17. Japan Post's manual dates the new seven-digit system to February 1998 (平成10年2月) and gives its purpose as wider mechanisation of mail handling in a business where staff costs were about 80% of all costs 12.

The customer barcode came with that system. A Fujitsu patent application with an April 1999 priority date says that with the new postal code, the Ministry of Posts and Telecommunications built a customer barcode value from the 7-digit code and up to 13 characters taken from the address, that new sorters printing the barcode were being installed at post offices, and that the Ministry already reduced postage for senders who printed the barcode themselves 18. No Japan Post page found gives the date the customer barcode or its discount first applied, and no source names its designers.

On 1 May 2011 Japan Post changed the acceptance conditions for barcoded mail. For mail paid by postage-paid imprint (料金別納) or deferred payment (料金後納), the area where the customer barcode may be printed was enlarged 15.

Open-source support followed: BWIPP added the symbology on 10 February 2009 22, and tc-lib-barcode added it on 1 September 2026 28.

Technical specification

All rules below are from Japan Post's 郵便番号・バーコードマニュアル (Postal Code and Barcode Manual) unless another source is cited.

Three kinds of barcode. Japan Post's sorters read the postal code and address and print an in-office barcode (局内バーコード) and an ID barcode (IDバーコード) in a special transparent ink. The customer barcode is the one the sender prints in advance. It is different from the other two and is the only one that earns a discount 1.

Bar shapes. Four bar shapes, numbered 1 to 4 2:

Value Name Shape
1 ロングバー (long bar) extends up and down
2 セミロングバー(上) (semi-long bar, up) extends upward only
3 セミロングバー(下) (semi-long bar, down) extends downward only
4 タイミングバー (timing bar) centre section only

The Japanese Wikipedia article gives the length ratio of long, semi-long and timing bars as 3:2:2:1 19.

Character table. Each data character is three bars 2:

Char Bars Char Bars Char Bars
1 114 8 231 CC4 432
2 132 9 411 CC5 243
3 312 0 144 CC6 423
4 123 - (hyphen) 414 CC7 441
5 141 CC1 324 CC8 111
6 321 CC2 342 Start 13
7 213 CC3 234 Stop 31

The start and stop codes are two bars each 2.

Letters. A letter is a control code followed by a digit, and counts as two barcode characters: A–J are CC1 + 0–9, K–T are CC2 + 0–9 and U–Z are CC3 + 0–5. So A is CC1 0 (324144) and Z is CC3 5 (234141) 23.

Format. Start code + postal code (7) + address display number (13) + check digit (1) + stop code. The hyphen between the third and fourth digits of the postal code, and the hyphen joining the postal code to the address number, are left out 3. That gives 2 + 21 × 3 + 2 = 67 bars. An address number shorter than 13 characters is padded with CC4. A longer one is cut at 13 characters, except that if the 13th character is the control code of a letter, that control code is kept 37.

Check digit. Each character of the postal code and the address number is replaced by a check value, and the check character is chosen so that the total is a multiple of 19 38:

Character 0–9 - CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC8
Check value 0–9 10 11 12 13 14 15 16 17 18

A check value of 10 is printed as the hyphen character, and 11–18 as CC1–CC8 8. The manual names CC4 as the padding code and CC1–CC3 as the letter codes. In the pages read, CC5–CC8 appear only as check characters 310.

Worked example. For 東京都千代田区霞が関1丁目3番2号 郵便プラザ503室, the postal code is 100-0013 and the address number 1-3-2-503. The 20 characters are 1000013 + 1-3-2-503 + 4 × CC4. Their check values add up to 105; the next multiple of 19 is 114, so the check digit is 9 58.

Building the address number. The manual splits the address into part A (up to the town-area name, which the postal code covers) and part B (the rest), then extracts characters from part B 56:

  1. Lower-case letters become capitals, and &, /, ・ and . are removed.
  2. Arabic digits, hyphens and single letters (not runs of two or more) are kept.
  3. Kanji, kana, spaces, kanji numerals and runs of two or more letters in front of a kept character become one hyphen; repeated hyphens become one, and a leading hyphen is dropped.
  4. Kanji numerals before 丁目, 丁, 番地, 番, 号, 地割, 線, の or ノ are converted to digits.
  5. An F (floor) after a digit is dropped, or becomes a hyphen if more data follows.
  6. Hyphens next to a letter are removed.

So 東3丁目-20-5 郵便・A&bコーポB604号 becomes 3-20-5B604 6. If the joined postal code and address number exceed 20 characters, the rest is cut off, keeping a letter's control code that falls in position 20 7.

Special numbers. For large-volume businesses and PO boxes with their own individual postal code, only that code is encoded, and all 13 address positions are CC4. For a PO box under a shared code (***-8691 or **-91), the PO box number (1–4 digits) goes in the address number 9. For Business Reply mail (料金受取人払) under a shared code (-8790 or ***-**90), the address number holds a 3-digit sorting number assigned by the post office, padded with CC4 913.

Verification sheet. Japan Post publishes 16 addresses with the character string each should produce, including the check character, so that address-conversion software can be tested 10.

Dimensions. The table is set for 10-point size, and sizes from 8 to 11.5 points are allowed (8 ≤ a ≤ 11.5) 3:

Element Nominal (mm) Tolerance (mm)
Long bar length 3.6 × a/10 3.40–3.60 × a/10
Timing bar length 1.2 × a/10 1.05–1.35 × a/10
Bar pitch 1.2 × a/10 0.95–1.30 × a/10
Bar width 0.6 × a/10 0.50–0.70 × a/10
Space 0.6 × a/10 0.45–0.60 × a/10

At 10 points, 67 bars at a 1.2 mm pitch span about 80 mm (computed). Japan Post's Business Reply barcode tool asks for a printed length of 64–88 mm 16.

Printing 4:

  • a clear margin of at least 2 mm on all four sides, also between the barcode and a window edge, however the contents shift;
  • for horizontal addresses, directly under the addressee's name; for vertical addresses, to the left, right or below;
  • inside the face of the item, excluding 10 mm from the edges (15 mm where possible on one side) and the 70 × 35 mm cancellation area;
  • a white or pale plain background;
  • skew of the barcode against the edge of the item within 5°, bar tilt within 1.5°, and the sum of both under 5°;
  • black or dark blue ink, the same as normal address printing;
  • paper reflectance of at least 50% and a Print Contrast Signal (PCS) of at least 0.5, or PCS 0.7 on brown kraft paper with 40–50% reflectance.

The manual also asks senders not to print any other information on the mail face in the same 4-state 3-bar format 4.

Use cases

  • Barcode discount on bulk letters and postcards. Standard-size letters up to 6 mm thick, ordinary and return postcards (not Japan Post-issued postcards or election postcards) qualify. At least 1,000 items must be posted at once and paid by imprint, deferred payment or meter. The discount is 1%, and it is added to the advertising-mail or presorted-mail discount if those also apply 14. The items must be machinable: the manual sets rules for thickness, weight and paper, and detailed conditions for plastic envelopes 1134.
  • Local special mail (郵便区内特別郵便物). Barcoded standard-size letters posted at designated machine-sorting offices cost 94 yen up to 50 g, or 83 yen for 1,000 or more 14.
  • Business Reply mail. Printing the customer barcode with the number the delivery office assigns is a condition of using Business Reply for standard letters and postcards. Japan Post offers a web tool that draws the barcode from a postal code and sorting number, and asks for three printed samples to be checked before an envelope is printed 91316.
  • Large-volume recipients and PO boxes. Mail to a business or PO box with its own postal code carries only that code 9.
  • Quality inspection. Japan Post inspects barcodes when mail is accepted and recommends an inspection in advance 11.

No use outside Japan Post's domestic letter mail was found.

Implementations

Library Language Stars Last active Japan Post support
metafloor/bwip-js JavaScript 2,431 Aug 2026 japanpost, a port of BWIPP 23
bwipp/postscriptbarcode PostScript 504 Oct 2026 japanpost since February 2009; option includecheckintext 2022
zint/zint C 828 Oct 2026 BARCODE_JAPANPOST (76) 2425
woo-j/OkapiBarcode Java 399 Oct 2026 JapanPost class 26
productdevbook/etiket TypeScript 492 Oct 2026 jppost, postal code and address as separate fields 27
tecnickcom/tc-lib-barcode PHP 302 Nov 2026 JapanPost class, added 1 Sep 2026 28

Star counts and activity were read from the GitHub API on 9 November 2026.

Input. All of them take digits, A–Z and the hyphen, and add the check character themselves 202426. BWIPP, Zint and Okapi take a single string of at most 20 symbol characters, with each letter counting as two, and reject anything longer instead of truncating it as the manual does 20212526. etiket takes the 7-digit postal code and the address separately, pads with CC4 and cuts the result at 20 characters 27. None of them converts a Japanese address into the address number: that extraction is the user's job 27.

Decoders. ZXing and zxing-cpp do not list any four-state postal code among their formats 2930, and no open-source decoder was found. The commercial Scanbot SDK lists a JAPAN_POST barcode format 31.

About the Try-it encoder. The panel renders bwip-js japanpost with data 6540123789-A-K-Z:

  • The data is the example in BWIPP's wiki and source 2021. It is not from Japan Post's manual.
  • It encodes postal code 654-0123 and address number 789-A-K-Z, that is 6 5 4 0 1 2 3 7 8 9 - CC1 0 - CC2 0 - CC3 5. That is 19 characters, padded with one CC4. The check values add up to 130, so the check character is 3 (130 + 3 = 133 = 7 × 19). Two local implementations of the manual's tables, and bwip-js 4.11.0, produce the same 67 bars.
  • 654-0123 is a real postal code, for 兵庫県神戸市須磨区清水台 (Shimizudai, Suma-ku, Kobe) 33. The address part names no real address. Under the manual's rule 6 the hyphens around single letters would be removed, so the extraction would never produce the string 789-A-K-Z 6. The data is valid at the symbol level, but not a realistic customer barcode.
  • bwip-js and BWIPP get one check value in 19 wrong. The manual's verification sheet includes 千葉県鎌ケ谷市右京塚 東3丁目-20-5 郵便・A&bコーポB604号, which should end in check character 0 10. BWIPP computes the check as 19 − (sum mod 19) without a final mod 19 21. When the sum is already a multiple of 19 it looks up entry 19 of its table, which holds a two-bar start/stop pattern. bwip-js 4.11.0 therefore draws 27301023-20-5B604 with a wrong check character and an empty 66th bar (local check). Zint, Okapi, etiket and tc-lib-barcode all map 19 to 0 25262728. The other 16 rows of the manual's examples, and Zint's documented example 15400233-16-4-205, agree between bwip-js and an independent implementation (local check) 24.

Comparison

Japan Post customer barcode RM4SCC KIX Australia Post 4-State
Data 7-digit postal code + 13-char address number postcode + house number, 0–9 and A–Z 11 characters, 0–9 and A–Z FCC + 8-digit DPID (+ customer data)
Letters control code + digit (two characters) one character each one character each C table, customer data only
Check modulo-19 character check digit none Reed–Solomon
Length fixed, 67 bars variable fixed, 11 characters 37, 52 or 67 bars

Sources: 324.

Royal Mail's RM4SCC and the Dutch KIX encode a letter in one character. The Japanese code has only 19 data characters (0–9, hyphen and CC1–CC8), so a letter costs two of its 20 positions 224. Australia Post's code carries a Delivery Point ID number 24. The Japanese address number is instead taken directly from the printed address by fixed rules, so a mailer needs only the postal code and the address to make it 6. The Japanese code has a single check character and no error correction 3.

Fun facts

  • The hyphen is a real barcode character (414), not only a separator: 1-3-2-503 uses four of the 13 address positions on hyphens 25.
  • A floor number after a digit is not encoded: in 6丁目7-14 ABCビル2F the F is dropped, giving 6-7-14-2 6.

Status

In use. Japan Post's barcoded-mail page still offers the 1% barcode discount for 1,000 or more items and the barcoded local special mail rates, and shows a customer barcode printing example 14. The barcode manual and the Business Reply barcode tool remain online 316. Seagull Scientific's guide says CC4 means "normal priority" and CC7 "highest priority" 32. The Japan Post manual pages read here give CC4 only as the padding code, and use CC7 only as a check character 310. No successor symbology has been announced.

Sources

Deployments

No country reports mention this standard by name.

source · content/standards/japan-post-4-state/index.md