Skip to content
barcoder

Standards/han-xin-code

Han Xin Code

Type2D Matrix
PrimaryCN
Completeness81%high

Overview

Han Xin Code (汉信码) is a two-dimensional matrix barcode symbology consisting of black and white square modules arranged on a square grid, designed primarily to encode Chinese characters natively. Like QR Code, it uses corner finder patterns to allow camera-based readers to locate and orient the symbol [2]. Its distinguishing feature relative to QR Code is built-in support for the full GB 18030 Chinese character set, encompassing up to 1,587,600 distinct Chinese characters [2]. It was developed in China to provide a domestically controlled alternative to the Japanese-originated QR Code, and was internationally standardised as ISO/IEC 20830:2021 [1] [2].

History

Han Xin Code was invented in 2007 by the Article Numbering Center of China (中国物品编码中心), explicitly to break QR Code's market dominance and to provide a symbology with native Chinese character support [2]. Its standardisation timeline:

  • 2007 — Published as the Chinese national standard GB/T 21049-2007 [2].
  • 2011 — AIM (Association for Automatic Identification and Mobility) released the ISS Han Xin Code symbology specification [2].
  • 2015 — ISO/IEC JTC 1/SC 31 began work to adopt Han Xin Code as an international standard [1] [2].
  • 2021 — Issued as ISO/IEC 20830:2021 [1] [2].
  • 2022 — The Chinese national standard was updated to GB/T 21049-2022 and aligned with the ISO version [2].

ISO/IEC 20830:2021 specifies the symbology characteristics, the data encoding process, the symbol structure, dimensions and print-quality requirements, error-correction rules, the reference decoding algorithm, and user-selectable application parameters [1].

Technical specification

Module / symbol structure. Han Xin Code defines 84 versions, ranging from 23×23 modules (Version 1) to 189×189 modules (Version 84). The symbol size in modules follows the formula Size = 23 + (Version − 1) × 2 [2].

Finder patterns. Four Position Detection Patterns are located at the corners of the symbol; each is 7×7 modules of concentric squares. The scanning ratio across each Position Detection Pattern is 1:1:1:1:3 (or 3:1:1:1:1), which differs from QR Code's 1:1:3:1:1 ratio [2]. Alignment patterns are introduced from Version 4 onward and consist of step-wise alignment lines and assistant patterns [2].

Error correction. Han Xin Code uses Reed–Solomon error correction with four user-selectable levels [2]:

Level Recovery capacity
L1 ~8%
L2 ~15%
L3 ~23%
L4 ~30%

Data capacity (maximum, Version 84). [2]

  • Numeric: 7,827 digits
  • Text (alphanumeric / ISO/IEC 646 Latin): 4,350 characters
  • Binary (bytes): 3,261 bytes
  • Chinese characters: 1,044–2,174 (depending on which character region is used)

Encoding modes. Han Xin Code defines several encoding modes, including Numeric (3.3 bits/char), Text (6 bits/char), Binary Byte (8 bits/char), four Chinese-character modes, ECI, Unicode, GS1, and URI modes [2].

Chinese-character (GB 18030) modes. Four dedicated modes encode Chinese characters [2]:

  1. Common Region One — 4,074 characters, 12 bits each
  2. Common Region Two — 3,008 characters, 12 bits each
  3. 2-byte Region — 23,940 characters, 15 bits each
  4. 4-byte Region — 1,587,600 characters, 21 bits each

This native, compact encoding of the full GB 18030 repertoire is the symbology's primary design goal [2].

Use cases

Han Xin Code is used predominantly within China, where its native GB 18030 support makes it efficient for encoding Chinese text such as addresses, product names, and document content [2]. Despite its concentration in the Chinese market, most modern barcode printers and scanners support the symbology, and it is readable by camera apps on iOS and Android devices [2].

Implementations

  • Zint — C, BSD-3 (library) / GPLv3 (CLI/GUI); ~771 stars; active in 2026. A general barcode-encoding library supporting over 50 symbologies, including Han Xin (Chinese Sensible) Code, alongside QR, Micro QR, rMQR, Data Matrix/DMRE, and DotCode [6].
  • BWIPP — Barcode Writer in Pure PostScript — PostScript; ~499 stars; active in 2026. Documents and renders Han Xin Code among its symbology set [7].
  • AIMHanXinCode.Net — Visual Basic / .NET; ~12 stars; last active 2019. An implementation of the AIM International Technical Specification Han Xin Code encoding library for .NET [5].

Comparison

Compared to QR Code, Han Xin Code's chief advantage is native Chinese-character encoding: it encodes Chinese characters from the GB 18030 codepage directly, whereas QR Code natively encodes Japanese Kanji (Shift-JIS) and would require byte/ECI modes to carry Chinese text [2]. Han Xin Code also encodes the full ISO/IEC 646 Latin character set rather than QR Code's restricted alphanumeric set [2]. Both symbologies share a similar visual structure (square modules, corner finder patterns) and both use Reed–Solomon error correction, but they use different finder-pattern scanning ratios (Han Xin 1:1:1:1:3 vs QR 1:1:3:1:1), so the two are not interchangeable to scanners [2]. Unlike Data Matrix or DotCode, Han Xin Code does not target high-speed inkjet/dot-marking use cases.

Fun facts

  • The Han Xin Code 4-byte Chinese region alone can address 1,587,600 distinct characters — far more than the assigned Unicode code points in common use — reflecting a design built around the full GB 18030 standard rather than a subset [2].
  • The name "Han Xin" (汉信) combines 汉 (Han, referring to Han Chinese / the Chinese language) with 信 (information/message) [2].

Status

Active and current. Han Xin Code is an international standard, ISO/IEC 20830:2021, and a Chinese national standard, GB/T 21049-2022 [1] [2].

Sources

1 ISO/IEC 20830:2021 — Information technology — Han Xin Code bar code symbology specification — ISO, 2021 2 Han Xin code — Wikipedia, 2026 5 AIMHanXinCode.Net — Benjamin Shi / GitHub, 2019 6 Zint barcode encoding library — Zint Project / GitHub, 2026 7 Barcode Writer in Pure PostScript (BWIPP) — Terry Burton / GitHub, 2026

Deployments

No country reports mention this standard by name.

source · docs/standards/han-xin-code/index.md