Home › Code and dev › Chinese ID Number Checker
🔧

Chinese ID Number Checker

Validate the check digit of an 18-digit Chinese ID and read province, birth date, sex and age

号码解读
批量校验
输入身份号码

演示号码为按规则构造的样例,仅用于查看解析过程。号码只在本机浏览器内计算,不上传、不缓存、不写入任何记录。

批量校验

About this tool

Is this number correct and where exactly is it wrong are two different questions. This tool does more than return pass or fail: it splits the 18 digits and lays out the weighted check-digit arithmetic step by step, so a typing mistake can be located instead of merely rejected:

  • Check digit: recompute the 18th digit with the GB 11643-1999 weighted modulo 11 algorithm and show the expected value
  • Digit table: the 17 digits, weights, products, weighted sum, remainder modulo 11 and mapped result, all shown
  • Four segments: a 6-digit address, 8-digit birth date, 3-digit sequence and 1-digit check, color coded
  • Region and person: the first two address digits give the province; the birth date gives the birthday, age and Chinese zodiac; the parity of the sequence digit gives sex
  • Date validity: catch February 30, month 13 and leap-year mismatches, where the format looks right but the date does not exist
  • 15-digit legacy numbers: insert 19 for the century, upgrade to 18 digits and show the full result
  • Batch mode: paste many numbers and get the pass count, province, birthday, sex and the corrected check digit

When to use it

  • Validate user input during form development and data migration
  • Clean an Excel list and filter out mistyped, short or checksum-failing records
  • Verify 15-digit legacy numbers in old records
  • Understand what each segment means and estimate province and age range
  • Debug a valid-looking number that fails because of the final X or a stray space

Check digit algorithm

StepRule
1. Weights7 9 10 5 8 4 2 1 6 3 7 9 10 5 8 4 2
2. Multiply and sumMultiply each of the first 17 digits by its weight and add the products to get S
3. RemainderY = S mod 11
4. Map0 to 1, 1 to 0, 2 to X, 3 to 9, 4 to 8, 5 to 7, 6 to 6, 7 to 5, 8 to 4, 9 to 3, 10 to 2
5. CompareThe number passes when the mapped value matches the 18th digit; a remainder of 2 maps to the Roman letter X, not a multiplication or plus sign

FAQ

  • Does passing mean the number really exists? No. The check digit only finds typing errors; any digit string that satisfies the weighted modulo rule passes. Real existence must be verified by the official population system
  • Why not resolve city and county? Digits 3 to 4 are the prefecture code and digits 5 to 6 the county code, which need the full GB/T 2260 division table. Divisions also change over time, so an old number may reference a name that no longer exists. This tool guarantees province level only
  • Why does the sequence digit reveal sex? It orders people born on the same day in the same place, and the 17th digit is odd for male and even for female by standard, not by convention
  • How do Hong Kong, Macao and Taiwan residents work? Their residence permits use the same 18-digit rule and the same checksum, with address codes starting 81, 82 or 83
  • Are 15-digit numbers still valid? The first generation lacked the century and check digit and was upgraded to 18 digits when cards were renewed. The upgrade here is for checking old records only

To hide sensitive numbers in a list, use the privacy mask tool; to turn numbers into QR codes or barcodes for materials, use the QR code and barcode generators; the weighted modulo idea is worth comparing with the Luhn check on bank cards. All computation runs in your browser and numbers are never sent to a server.