All Tools

🇨🇳 China — Resident Identity Card (居民身份证)

Generate random valid-format Resident Identity Card (居民身份证) numbers for testing

Format: 18 digits
An 18-digit number encoding province/city/district code, date of birth, sequence number, and a weighted check digit.
⚠ These numbers are randomly generated for testing and development purposes only. They follow the correct format and checksum rules but do not belong to any real person.

Validate

Paste a Resident Identity Card (居民身份证) below to check whether it has a valid format and correct checksum.

What Is the Chinese Resident Identity Card Number?

The Resident Identity Card number (居民身份证号码) is an 18-character national identification number assigned to Chinese citizens by the Ministry of Public Security. Introduced in the 1980s and expanded from 15 to 18 digits in 1999, it encodes administrative location, date of birth, a sequence number, and a check digit — making it uniquely identifiable while simultaneously carrying structured demographic information.

Structure of the 18-Digit ID Number

The first six digits form the administrative division code, indicating province (first two), city (middle two), and district or county (last two) of household registration. The next eight digits encode the date of birth as YYYYMMDD. Digits 15 through 17 form a sequence number — odd numbers are assigned to males and even numbers to females. The 18th character is a check digit that can be a digit 0–9 or the letter 'X' (representing the value 10).

Check Digit Algorithm

The check digit uses a weighted modulo-11 algorithm: each of the first 17 digits is multiplied by a weight from the sequence [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2], the products are summed, and the sum modulo 11 is mapped to a final character via the lookup table ['1','0','X','9','8','7','6','5','4','3','2']. Any 18-character string that fails this check is structurally invalid, regardless of what the other digits contain.

Testing Chinese ID Numbers in Software

Applications operating in China — e-commerce platforms, fintech services, ride-sharing apps, and government portals — all require valid Chinese ID numbers for user registration and KYC flows. Generating correctly formatted fake IDs with valid checksums and realistic region and date combinations allows developers to test input validation, age verification (derived from the birthdate segment), and gender detection logic safely and without legal risk.

Region Codes and Administrative Divisions

China's administrative division codes follow the GB/T 2260 standard, covering 34 provincial-level divisions including 23 provinces, 4 municipalities (Beijing, Shanghai, Tianjin, Chongqing), 5 autonomous regions, and 2 special administrative regions. The first two digits of a valid ID will always correspond to one of these divisions: 11 for Beijing, 31 for Shanghai, 44 for Guangdong, and so on. IDs with unrecognized region prefixes are considered invalid even if their check digit is correct.