TToolbox
๐Ÿ“‡

Chinese ID Validator

Validate and decode Chinese ID numbers

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)

1

Enter ID Card Number

Paste the 18-character identity number into the input field. Lowercase 'x' is normalized to uppercase 'X'.

2

Validate Checksum & Demographics

The engine runs ISO 7064 Mod 11-2 check math and parses birth date, biological gender, and origin administrative region.

3

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

18-Digit Structure
110101 19900307 235 9
โ”‚      โ”‚        โ”‚   โ””โ”€โ”€ ็ฌฌ18ไฝ: ๆ ก้ชŒ็  (0-9 ๆˆ– X)
โ”‚      โ”‚        โ””โ”€โ”€โ”€โ”€โ”€โ”€ ็ฌฌ15-17ไฝ: ้กบๅบ็  (็ฌฌ17ไฝๅ•ๆ•ฐ็”ท๏ผŒๅŒๆ•ฐๅฅณ)
โ”‚      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ็ฌฌ7-14ไฝ: ๅ‡บ็”Ÿๅนดๆœˆๆ—ฅ (YYYYMMDD)
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ ็ฌฌ1-6ไฝ: ๅœฐๅ€็  (็œๅธ‚ๅŽฟ่กŒๆ”ฟๅŒบๅˆ’)
Decoded Identity Data
โ€ข ๆˆท็ฑๅœฐๅ€ : ๅŒ—ไบฌๅธ‚ ไธœๅŸŽๅŒบ (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

Modulus 11 Verification Snippet
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();
}
Execution
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.

Related Tools

All processing happens locally in your browser. Your data is never uploaded to a server.
/