Chinese USCC Validator
Validate Chinese Unified Social Credit Codes (USCC) in real time under GB 32100-2015.
Technical Validation of Chinese USCC
Validation checks Base 31 character constraints and verifies the weighted modulo 31 checksum over the 17 preceding characters.
Essential for testing ERP systems, e-invoicing (Fapiao), and supply chain integrations with Chinese suppliers.
Anatomy & Structure of the USCC (统一社会信用代码)
The Chinese Unified Social Credit Code consists of 18 alphanumeric characters in 5 parts:
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| 1 | Agency Category | 1 char | 1=Government, 5=NGO, 9=Enterprise, Y=Other | 9 |
| 2 | Entity Type | 1 char | Subtype within category (e.g., 1=Individual Business) | 1 |
| 3 to 8 | Regional Code | 6 chars | Administrative division code per GB/T 2260 | 110108 |
| 9 to 17 | Identification Code | 9 chars | Sequential organization number (base-31 charset) | MA01ABCDE |
| 18 | Check Character | 1 char | Calculated via weighted Modulo 31 (GB 32100-2015) | 8 |
Official Algorithm (Weighted Modulo 31 — GB 32100-2015)
USCC integrity is verified via Modulo 31 using positional weights:
S = Σ C[i] × W[i] (i=1..17); R = S mod 31; Check = charset[(31 - R) mod 31]
- 1. Map each character to the base-31 charset (0-9 and letters A-Y, excluding I, O, Z, S, V).
- 2. Multiply the first 17 values by weights: W = [1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28].
- 3. Sum the products and compute R = S mod 31.
- 4. Compute check index: (31 - R) mod 31.
- 5. Retrieve check character from the base-31 charset.