Skip to main content

Chinese Resident ID Generator

Generate and format valid Chinese Resident Identity Card numbers for software testing and QA.

Waiting for generation...

About the Chinese Resident Identity Card

The Resident Identity Card of China (居民身份证) is the official identity document issued to Chinese citizens under the GB 11643-1999 standard by the Ministry of Public Security.

It consists of 18 alphanumeric characters: 6 digits for administrative division, 8 digits for birth date, 3 digits for sequence and gender, and a checksum character computed via ISO 7064 MOD 11-2 (0-9 or 'X').

Anatomy & Structure of the Resident ID (居民身份号码)

The Chinese Resident Identity Number consists of 18 characters structured in 4 parts:

PositionFieldLengthMeaning & RuleExample
1 to 6Administrative Code6 digitsAdministrative division code (province/city/district) per GB/T 2260110101
7 to 14Date of Birth8 digitsDate of birth in YYYYMMDD format19900307
15 to 17Sequential Code3 digitsDifferentiates individuals of the same area/date; digit 17 odd = male, even = female001
18Check Character1 characterCalculated via ISO 7064 MOD 11-2 (values 0–9 or X representing 10)7

Official Algorithm (ISO 7064 MOD 11-2 — GB 11643-1999)

Resident ID integrity is verified using the ISO 7064 MOD 11-2 algorithm:

S = Σ d[i] × W[i] (i=1..17); R = S mod 11; Check = map[R]
  1. 1. Multiply the first 17 digits by their positional weights: W = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2].
  2. 2. Sum all products to get total S.
  3. 3. Compute remainder R = S mod 11.
  4. 4. Map R to the check character: {0→1, 1→0, 2→X, 3→9, 4→8, 5→7, 6→6, 7→5, 8→4, 9→3, 10→2}.
  5. 5. The ID is valid if the 18th character matches the mapped character.

Frequently Asked Questions & Technical Guidelines