Skip to content
UniKit

Chinese ID number parser and validator

Parse an 18-digit Chinese resident ID, a 15-digit legacy number, a HK/Macao/Taiwan residence permit or a foreigner permanent residence ID: region code, birth date with leap-year check, gender from the 17th digit, the GB 11643 / ISO 7064 MOD 11-2 check digit, a 15-to-18-digit upgrade and an age computed against a reference date you pick — all locally in your browser.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

ID / residence permit number

The number is parsed locally in your browser only: nothing is uploaded, logged or kept in history.

Fixed default 2026-01-01; the age is computed against this date instead of the system clock.

Parsed result

Every parsed field with its verification result; failed items are flagged.

Enter a number to see the parsed result

What this tool does

  • Check whether a number looks genuine: region, birth date, gender and check digit in one pass, with the 18th character recomputed by the GB 11643-1999 / ISO 7064 MOD 11-2 weighted modulo-11-2 algorithm and compared to your input.
  • Clean up legacy data: 15-digit IDs issued before 1999 have no check digit, so the tool upgrades them to 18 digits (prefixing 19 to the birth year) and computes the missing check digit.
  • Recognise HK/Macao/Taiwan residence permits (fixed 810000 / 820000 / 830000 prefixes) and foreigner permanent residence IDs (3-letter ISO 3166-1 alpha-3 nationality code).
  • Get an age that does not depend on the system clock: the reference date is yours to set (fixed default 2026-01-01), so the same number gives the same result on any machine at any time.

Example

Input

11010519491231002X

Output

Document type: 18-digit resident ID card
Verdict: valid
Region: Chaoyang District, Beijing (110105)
Birth date: 1949-12-31
Sequence code: 002 (third digit of the sequence code: odd = male, even = female)
Gender: female
Check digit: X (matches the computed value)
Age: 76 (reference date 2026-01-01)

The sample number is test data built with the GB 11643-1999 check-digit rule, and the output matches the Example button character for character; the age uses the default reference date 2026-01-01.

Frequently asked questions

Is the number sent to a server?

No. Everything is parsed in your browser, the page makes no network request, and the number is neither logged nor kept in any history — closing the tab loses it. Remember that an ID number is sensitive personal data, so avoid pasting a real one on a shared computer.

If verification passes, is the number real?

It only means the number is formally valid: length, character set, an existing birth date (leap years included) and a matching check digit. Whether the person or the number actually exists can only be confirmed by the authorities; this tool does not go online and queries no database.

Why is the region sometimes only resolved to the province?

The bundled GB/T 2260 table is an excerpt: 34 province-level codes, the districts/counties of the four municipalities and every prefecture-level division (plus five province-administered county-level cities) — 458 entries in total. Most county-level codes (for example 440305, Nanshan District in Shenzhen) are not included, so the tool reports the province and says so in the Notes instead of inventing a district name.

How exactly is the check digit computed?

Multiply the first 17 digits by the weights 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, sum them, take the remainder modulo 11 and look it up in 10X98765432 (remainder 0 → 1, 1 → 0, 2 → X, and so on). That is the ISO 7064 MOD 11-2 check used by GB 11643-1999; the page shows the expected value next to the digit you supplied.

Why does a foreigner permanent residence ID say the check digit is not verified?

Its 15-character layout is public (3-letter nationality code + 8-digit birth date + 3-digit sequence code + 1 check digit), but how the check digit is computed is not documented in an authoritative way, so this tool verifies the length, character set, nationality code and birth date only. HK/Macao/Taiwan residence permits follow the citizen ID number rules, so their check digit is verified as usual.

Why does the age default to 2026-01-01?

The tool never reads the system clock. The age is always computed against the reference date you enter (a birthday must have passed to add a year), and the default is a fixed date so results stay reproducible and testable. If the birth date is later than the reference date the tool reports a negative age.

Keywords:身份证查询身份证校验身份证号码解析身份证校验码15位身份证升级18位港澳台居民居住证外国人永久居留身份证行政区划码id card validatorchinese id numbercheck digitGB 11643

Related tools