The Chinese Resident Identity Card number (居民身份证, standard GB 11643) is an 18-character code that encodes where and when a person was born plus a check digit. This decoder reads the province, date of birth and gender from the number and verifies its check character, so you can validate test data or catch a mistyped ID. It never queries any government database.
How it works
The 18 characters break down as follows:
| Position | Length | Meaning |
|---|---|---|
| 1–2 | 2 | Province / autonomous region / direct-controlled municipality |
| 3–4 | 2 | Prefecture-level city or division |
| 5–6 | 2 | County or district |
| 7–14 | 8 | Date of birth: YYYYMMDD |
| 15–17 | 3 | Sequence number within the county; 17th digit encodes gender |
| 18 | 1 | Check character: 0–9 or X |
The province code maps to one of 34 top-level administrative divisions. For example, 11 = Beijing, 31 = Shanghai, 44 = Guangdong, 51 = Sichuan.
The ISO 7064 MOD 11-2 check
The check character uses the ISO 7064 MOD 11-2 algorithm: the first 17 digits are multiplied by the fixed weights 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, the products are summed, and the sum is taken modulo 11. The remainder maps to a check character as follows:
| Remainder | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Check char | 1 | 0 | X | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 |
When the computed check value is 10, it is written as the letter X because a single digit position cannot hold two characters. The ID is valid only when the 18th character matches the computed check character exactly.
Worked example
Consider a number starting with 110101 19900307 003 X:
- Province code 11 → Beijing
- Date of birth 19900307 → 7 March 1990
- Sequence digit 3 (odd) → male
- Check character X → computed remainder was 2, which maps to X — valid
A single-digit transcription error in positions 7–17 virtually always changes the check value, making the algorithm an effective single-error detector.
What this tool does and does not do
The decoder checks the number’s internal consistency only. It confirms the structure is correct (18 characters), the date is a real date, and the check character is mathematically valid. It does not confirm that the number belongs to a real registered person or that the personal details you supply match any government record. For software developers it is ideal for validating test data and catching user input errors, while keeping all data strictly in the browser — no number you enter is ever transmitted anywhere.