Chinese Resident ID Generator
Generate and format valid Chinese Resident Identity Card numbers for software testing and QA.
Waiting for generation...
About the Chinese Resident Identity Card
The Resident Identity Card of China (居民身份证) is the official identity document issued to Chinese citizens under the GB 11643-1999 standard by the Ministry of Public Security.
It consists of 18 alphanumeric characters: 6 digits for administrative division, 8 digits for birth date, 3 digits for sequence and gender, and a checksum character computed via ISO 7064 MOD 11-2 (0-9 or 'X').
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.