← Back

Chinese ID Card Validator

Validate an ID number and extract birth date & gender

All calculations run entirely in your browser — no ID number is uploaded to any server. Region info is only resolved down to the province level (not city/district), to avoid giving wrong results from incomplete or outdated administrative data. This tool only checks format and checksum validity — it cannot verify whether the number actually exists or belongs to a real person.

About Chinese ID Card Validator

This tool checks whether an 18-character mainland China resident ID number is internally consistent in format and check digit, and, if it passes, reads three pieces of information encoded in the number: the province, the date of birth and the gender. It follows the GB 11643 check-digit method: each of the first 17 digits is multiplied by a fixed weight, the products are added up, the sum is taken modulo 11, and a lookup table gives the expected 18th character, which is compared with the one actually typed. Its limits matter. It can only tell you the number 'adds up'. It cannot prove that the number exists, was ever issued, or belongs to a real person. It does not support the old 15-digit format, does not look up city or county, and must not be used to verify anyone's identity.

How to use it

  1. Type or paste the 18-character number into 'ID card number (18 characters)'. The field holds at most 18 characters, and a final X can be upper or lower case.
  2. A 'Result' section appears as soon as the field has content. There is no submit button, and nothing is shown while the field is empty.
  3. If the check passes you see four items: 'Checksum · Valid ✓', 'Province', 'Date of birth' (year-month-day) and 'Gender' (Male or Female).
  4. If it fails, a red message says whether the length or format is wrong or the checksum does not match. For a checksum mismatch, the message states what the check digit should be according to the first 17 digits.

A worked example

The numbers below are made up purely for illustration and belong to nobody. For 110101199003071233, the first 17 digits 11010119900307123 give an expected check digit of 3, which matches the last character, so it passes. The leading 11 maps to Beijing, the date of birth reads 1990-03-07, and the 17th digit is 3 (odd), so gender shows Male. For 440306198512310049 the expected check digit is 9 and it passes; the leading 44 is Guangdong, the birth date is 1985-12-31, and the 17th digit is 4 (even), so gender shows Female. Change the first number's last digit to 4, giving 110101199003071234, and the tool reports a checksum mismatch: the correct check digit should be 3 but the last character is 4. All of this was produced by running the page's own algorithm.

What each part of the number means

Reading the 18 characters from left to right: a 6-digit area code (the first two digits are the province-level code), an 8-digit birth date (4-digit year, 2-digit month, 2-digit day), a 3-digit sequence code whose 17th digit is odd for male and even for female, and a final check character that is either a digit 0 to 9 or X (standing for 10). This tool interprets only the province from the first two digits, the birth date and the 17th digit. It ignores digits 3 to 6.

Supported features and known limits

  • Only 18 characters are accepted: the first 17 must be digits, and the last is a digit or X (a lowercase x is converted to uppercase). Leading and trailing spaces are trimmed, but the input box itself accepts at most 18 characters.
  • Old 15-digit ID numbers are not supported and are reported as a length or format error.
  • The order of checks is format, then checksum, and only after both pass are the province and date read. A number with a wrong check digit therefore shows no province or birth date.
  • The province is looked up from the first two digits in the national province code table, which covers the 31 provinces, autonomous regions and municipalities plus Taiwan, Hong Kong and Macau. If the first two digits are not in the table the checksum can still pass, but the province is shown as unknown.
  • The birth date gets only a rough range check: the month must be 1 to 12 and the day 1 to 31. The tool does not check how many days a particular month has, leap years, whether the year is plausible or whether the date is in the future. A number with 30 February in it, for example 110101199002301236, shows as valid with no warning as long as the check digit is right. If the month or day is outside the ranges, '(date out of range)' is added after the date, though the checksum line still says valid.
  • A passing checksum only means internal consistency. A randomly invented number passes roughly one time in eleven, so passing says nothing about authenticity.
  • Gender comes only from whether the 17th digit is odd or even and is not checked against any record.

Does 'valid' mean the ID card is genuine?

No. The check-digit method is public, and anyone can construct a number that is correct in form. Only the public security authority's verification systems can confirm that a number is real and matches a given name. This tool is suited to catching typing mistakes, such as a digit that was dropped, doubled or shifted when entering a form, and to producing test data during development.

Why does it say 'Checksum mismatch' when I am sure the number is right?

Look first for a typing error, especially two neighbouring digits swapped, 0 confused with O, 1 confused with l, or a trailing X typed as another character. A document issued long ago or in unusual circumstances might in theory not follow the general algorithm; in that case the issuing authority and the card itself are the reference. The 'should be' digit in the message helps you see whether only the last character is wrong.

What does '(date out of range)' mean?

The month is outside 1 to 12 or the day is outside 1 to 31. Even if the checksum happens to match, such a number is not a normal one. The opposite does not hold, though: the absence of the note does not prove the date exists, because the tool does not check month lengths.

Can it tell me the city or district?

No. Digits 3 to 6 do carry city and county information, but administrative divisions change and the code table is large. The tool deliberately stops at province level to avoid giving wrong results from incomplete or outdated data.

Privacy and processing

Validation happens entirely in your browser. The code only does arithmetic and table lookups on the string you type, sends the number to no server and stores nothing; the input is cleared when you refresh. An ID number is sensitive personal information, so even though nothing is uploaded, avoid entering a real number on a shared computer and close the page when you finish.