About this tool
The Chinese Resident Identity Card number (governed by national standard GB 11643-1999) is an 18-digit identity code. It systematically encodes a 6-digit administrative region code, an 8-digit birth date, a 3-digit sequence code (odd for male, even for female), and a final ISO 7064:1983.MOD 11-2 check digit. This tool validates checksums locally, decodes demographic birth and gender indicators, and verifies geographic registration districts with zero network logging.
How to Use This Tool (Step-by-Step)
Enter ID Card Number
Paste the 18-character identity number into the input field. Lowercase 'x' is normalized to uppercase 'X'.
Validate Checksum & Demographics
The engine runs ISO 7064 Mod 11-2 check math and parses birth date, biological gender, and origin administrative region.
Inspect Validity and Age
Inspect validation results, chronological age calculations, and zodiac signs in a clean summary card.
GB 11643-1999 Standard Compliance
Applies official weighted-sum modulus 11 verification, catching single-digit typos and swapped digits instantly.
Official Administrative Region Mapping
Maps the first 6 digits against official civil affairs databases to reveal exact birth province, prefecture, and district.
100% Client-Side Confidentiality
Calculations run entirely inside your browser runtime. Sensitive citizen credentials and birth details are never uploaded.
Developer Verification & Compliance Gotchas
- โขValid checksum does not equal real person verification: Checksums verify mathematical correctness, not live citizen existence in police databases.
- โขAlways uppercase terminal 'X': The check code only permits 0โ9 or capital 'X'. Normalize user-entered lowercase 'x' into uppercase 'X' before form submit.
- โขHistorical district administrative mergers: While county districts merge over decades, issued identity numbers remain permanent for life. Support legacy district codes.
Code & Transformation Examples
Chinese 18-Digit ID Structure Breakdown Benchmark
110101 19900307 235 9
โ โ โ โโโ ็ฌฌ18ไฝ: ๆ ก้ช็ (0-9 ๆ X)
โ โ โโโโโโโ ็ฌฌ15-17ไฝ: ้กบๅบ็ (็ฌฌ17ไฝๅๆฐ็ท๏ผๅๆฐๅฅณ)
โ โโโโโโโโโโโโโโโโ ็ฌฌ7-14ไฝ: ๅบ็ๅนดๆๆฅ (YYYYMMDD)
โโโโโโโโโโโโโโโโโโโโโโโ ็ฌฌ1-6ไฝ: ๅฐๅ็ (็ๅธๅฟ่กๆฟๅบๅ)โข ๆท็ฑๅฐๅ : ๅไบฌๅธ ไธๅๅบ (110101)
โข ๅบ็ๆฅๆ : 1990ๅนด03ๆ07ๆฅ
โข ๆงๅซๅฑๆง : ็ทๆง (็ฌฌ17ไฝ '5' ไธบๅๆฐ)
โข ๆ ก้ช็ปๆ : ๅๆณๆๆ (ๆ ก้ช็ '9' ๅน้
ๆๅ)* The roman numeral 'X' represents check value 10, keeping all Chinese ID numbers strictly 18 characters long.
JavaScript ISO 7064 Mod 11-2 Implementation
function checkIdCard(id) {
if (!/^\d{17}[0-9Xx]$/.test(id)) return false;
const weights = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
const checkCodes = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'];
const sum = id.slice(0, 17).split('').reduce((acc, c, i) => acc + c * weights[i], 0);
return checkCodes[sum % 11].toUpperCase() === id[17].toUpperCase();
}console.log(checkIdCard("110101199003072359")); // ่พๅบ: true* This algorithm catches 100% of single-digit transcription errors and adjacent transpositions.
Frequently Asked Questions
Q: Why is the check digit sometimes an 'X'?
A: The modulus 11 algorithm yields remainders from 0 to 10. If the remainder is 10, using '10' would make the ID 19 digits. Roman numeral 'X' is used to represent 10.
Q: Why must ID card numbers never be stored in plaintext?
A: ID numbers are protected PII under data privacy laws. Production systems must encrypt them at rest (AES-256) and mask display values (`110101********2359`).
Q: How are legacy 15-digit IDs converted to 18-digit IDs?
A: Insert '19' after the 6th digit to expand the 2-digit birth year into 4 digits, then calculate the 18th check digit using the standard Mod 11 algorithm.