China Resident ID (身份证) format validator using the ISO 7064 MOD 11-2 algorithm. 18 digits: 6 region + 8 birthdate + 3 serial + 1 check. Browser-only.
China Resident ID Format Validator (中国身份证)
How to use
Enter the 18-digit ID
Format: 6-digit administrative region + 8-digit birthdate (YYYYMMDD) + 3-digit serial + 1 check digit (0-9 or X).
Identify province
First 2 digits = province code (11=Beijing, 44=Guangdong, 31=Shanghai, etc.). First 6 digits go down to county/district.
Parse birth date + gender
Digits 7-14 are the birth date; the tool checks for a real calendar date. The 17th digit's parity = gender (odd=male, even=female).
ISO 7064 MOD 11-2 check
Apply weights [7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2] to the first 17 digits, mod 11, lookup the expected check character.
About China's 18-digit Resident ID
The PRC Resident Identity Card (居民身份证) is issued by the public security authorities. The State Council brought in the citizen ID number system from 1 October 1999, with numbers built to national standard GB 11643-1999 (in force 1 July 1999, replacing GB 11643-1989) — 18 digits in place of the old 15. The new format adopts the ISO 7064 MOD 11-2 international standard for its check digit — meaning the ID can be validated anywhere in the world, offline.
What the 18 digits mean
Every digit carries meaning: digits 1-2 = provincial region (11=Beijing, 31=Shanghai, 44=Guangdong...); digits 3-4 = prefecture city; digits 5-6 = county/district; digits 7-14 = birth date YYYYMMDD; digits 15-17 = serial (the 17th digit's parity = gender); digit 18 = check character (0-9 or X, where X = Roman numeral 10).
"China's Resident ID is the world's most data-dense national ID — 18 digits packing 7 semantic segments (province / prefecture / county / year / month / day / serial + checksum)."
Practical use cases
The ID is everywhere in China: train tickets, hotel check-in, bank accounts, app signups, ride-hailing, SIM card registration. What the 18th check digit buys is catching typing errors: any single wrong digit, and any two adjacent digits swapped, always fails the check.
Privacy stance
This tool runs entirely in your browser; the ID is never uploaded, logged, or stored. China's Personal Information Protection Law (PIPL) classifies the Resident ID as sensitive personal information — our zero-network design fully complies.
The 17th digit is odd for male and even for female
The 18-digit format took effect on 1 October 1999, replacing the older 15-digit format.
The check algorithm follows international standard ISO 7064 MOD 11-2 — it catches every single wrong digit and every swap of two adjacent digits.
The check character can be "X" — representing Roman numeral 10 when mod 11 remainder = 2.
Modern hardware can validate millions of IDs per second — pure offline, no DB lookup needed.
The first 6 digits go down to county/district — 3,000+ administrative codes (GB/T 2260 standard).
As of 2026, China has ~1.37 billion active Resident IDs — the world's largest single national ID system.
The 17th digit's parity determines gender (odd=male, even=female). China is one of few countries encoding gender directly into the ID.
HK/Macau/Taiwan Resident Permits (since 2018) also use the 18-digit format with address code 810000 = HK, 820000 = Macau, 830000 = Taiwan (State Council Office, 2018, No. 81).
The old 15-digit format = 6 region + 6 birth (YYMMDD, no century) + 3 serial (no checksum). Discontinued for new issuance after 1999.
China's PIPL classifies the Resident ID as sensitive personal information — this tool's zero-network design fully complies.
Frequently Asked Questions
No. The validation runs entirely in your browser — the ID is never uploaded, logged, or stored.
No. It only confirms the ID satisfies the ISO 7064 algorithm + has a real birth date. Real authenticity needs an MPS networked lookup.
Yes. When mod 11 remainder = 2, the check character is X (Roman numeral 10). About 9% of IDs end in X.
Administrative codes (GB/T 2260): first 2 = province, first 4 = prefecture city, first 6 = county/district. E.g. 110105 = Chaoyang District, Beijing.
Currently only to province level (33 provinces/municipalities/autonomous regions/SARs). County/district resolution needs a 3000+ row lookup table — planned for a future version.
No. This tool supports the current 18-digit format only. Old 15-digit IDs need to be upgraded to 18 digits at an MPS office first.
Yes. Digits 7-14 are the birth date in YYYYMMDD format — the tool displays the parsed birth date.
Yes. Official spec: 17th digit odd=male, even=female. Unchanged since 1999.
Yes. HK/Macau/Taiwan resident permits (since 2018) also use 18-digit ISO 7064 with prefix 81=HK, 82=Macau, 83=Taiwan.
Yes. All RECATOOLS tools are 100% free, ad-supported. No signup, no paywall.
Method & sources
How it computes
18 characters per GB 11643-1999: 6-digit address code, 8-digit birth date, 3-digit sequence (odd = male) and an ISO 7064 MOD 11-2 check: weights 2^(17−i) mod 11 over the first 17 digits, check = (12 − sum mod 11) mod 11, with 10 written X.
What this tool implements
- GB 11643-1999 《公民身份号码》, in force from 1 July 1999; the State Council brought the ID-number system in from 1 October 1999 (国发〔1999〕15号).
- Residence permits for Hong Kong, Macau and Taiwan residents use address codes 810000, 820000 and 830000 (国办发〔2018〕81号); the tool accepts all three.
- The check digit catches every single wrong digit and every swap of two adjacent digits — confirmed by brute force over 489,000 substitutions and 45,920 transpositions.
Sources
- 国家标准 GB 11643-1999《公民身份号码》, national standards portal record. https://openstd.samr.gov.cn/bzgk/gb/newGbInfo?hcno=080D6FBF2BB468…
- 国务院关于实行公民身份号码制度的决定(国发〔1999〕15号), 1999. https://www.gd.gov.cn/zwgk/gongbao/1999/27/content/post_3359762.html
- 国务院办公厅关于印发《港澳台居民居住证申领发放办法》的通知(国办发〔2018〕81号). https://www.gov.cn/zhengce/content/2018-08/19/content_5314865.htm
Pick up where you left off
Stored only in this browser — never sent to our servers.