Chinese Resident ID Validator
Validate Chinese Resident Identity Card numbers in real time under GB 11643-1999 and ISO 7064 MOD 11-2.
How Chinese Resident ID Validation Works
Validation checks all 18 characters: administrative region code, valid birth date in the calendar, and the ISO 7064 MOD 11-2 weighted checksum formula.
It verifies whether the final check character matches the official modulo 11 algorithm defined by China's Ministry of Public Security.
Anatomy & Structure of the Resident ID (居民身份号码)
The Chinese Resident Identity Number consists of 18 characters structured in 4 parts:
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| 1 to 6 | Administrative Code | 6 digits | Administrative division code (province/city/district) per GB/T 2260 | 110101 |
| 7 to 14 | Date of Birth | 8 digits | Date of birth in YYYYMMDD format | 19900307 |
| 15 to 17 | Sequential Code | 3 digits | Differentiates individuals of the same area/date; digit 17 odd = male, even = female | 001 |
| 18 | Check Character | 1 character | Calculated via ISO 7064 MOD 11-2 (values 0–9 or X representing 10) | 7 |
Official Algorithm (ISO 7064 MOD 11-2 — GB 11643-1999)
Resident ID integrity is verified using the ISO 7064 MOD 11-2 algorithm:
S = Σ d[i] × W[i] (i=1..17); R = S mod 11; Check = map[R]
- 1. Multiply the first 17 digits by their positional weights: W = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2].
- 2. Sum all products to get total S.
- 3. Compute remainder R = S mod 11.
- 4. Map R to the check character: {0→1, 1→0, 2→X, 3→9, 4→8, 5→7, 6→6, 7→5, 8→4, 9→3, 10→2}.
- 5. The ID is valid if the 18th character matches the mapped character.