Skip to content

China Resident ID Validator - 18-digit Checksum

Validate 18-digit China resident IDs (division, birthdate, MOD 11-2 checksum) and parse gender locally — format only, no authenticity lookup.

Was this result helpful?

This tool runs in your browser: what you enter is processed on your device and normally never appears in a request to any server.

Next steps

Usage Guide

China 18-digit resident ID numbers pack division code, birthdate, sequence, and a check digit (GB 11643). Production bugs usually accept impossible birthdays or implement ISO 7064 MOD 11-2 incorrectly and reject real cards. This tool parses division, birthdate, and gender and verifies the check digit locally — format and checksum only: no issuance lookup, no watch-list check, and not a substitute for legal identity verification.

1. How to use

All checks run in the browser. Use this for form-rule regression — not as a stand-in for official issuance status.

  1. Paste an 18-digit ID (trailing X may be either case).
  2. On success, inspect division, birthdate, and gender; on failure, use the error class (length / charset / division / birthdate / checksum) to fix input or business validation.
  3. For QA, generate valid samples with the China test data generator, then flip one digit to confirm rejection.

2. How the 18 digits break down

The first 6 digits are the administrative division code; the next 8 are birthdate YYYYMMDD; then a 3-digit sequence (parity of the last sequence digit encodes gender: odd male, even female); finally the check digit. This page applies a coarse province-prefix division check and a real-calendar birthdate check — enough to catch obvious forgeries and implementation bugs, without claiming the number was ever issued.

3. Check digit and sequence

Weighted sum of the first 17 digits modulo 11 maps to 0–9 or X per GB 11643. Odd/even gender encoding is a public rule, not a leak by itself. The sensitive part is storing the number next to name, address, or phone. Split format validation (local) from legal identity verification (authoritative sources and proper consent only).

4. Valid format ≠ identity verification

  • A passing checksum only means the string matches encoding rules — not that the card is active, uncancelled, or presented by the right person.
  • This tool does not query authenticity databases, run face match, or call police population systems.
  • If product copy says “real-name verified”, you need a licensed verification path; treating this page’s pass as legal identity is out of scope.

5. Too loose vs too strict

Too loose: accept any 18-digit / X pattern without birthdate or checksum — garbage enters the database. Too strict: wrong weights, rejecting trailing X, or an outdated division allowlist that blocks real users. The loop is: generator produces valid samples → your app should accept → flip one digit → your app should reject. If valid samples fail, compare against this page’s parse to see whether birthdate, division, or checksum logic is at fault.

6. Practical tips

  • Upgrade legacy 15-digit numbers before applying the 18-digit formula.
  • Coarse province checks can still accept retired division codes — refresh production allowlists against published administrative codes.
  • Avoid logging full numbers; mask middle digits in UI and support tickets.

FAQ

No. This tool only validates the division code, birthdate, and MOD 11-2 check digit, plus gender parsing. Issuance and cancellation status must be confirmed through official channels — a format pass is not identity verification.

Yes. Input is normalized; the standard writes uppercase X when the check value is 10. Rejecting uppercase X is an over-strict implementation bug.

It applies a coarse province-prefix check plus a real-calendar birthdate check — enough to catch obvious forgeries and encoding bugs, without claiming the county code is still published or the number was ever issued.

No. Legal identity verification needs licensed data sources and user consent; this page only checks the national encoding rules. Product copy claiming a verified identity needs a separate compliant pipeline.

No. Validation is pure local computation: the number is submitted nowhere, and no authenticity lookup of any kind is performed.

No. A legacy 15-digit number must first be upgraded to 18 digits per the rules; pasting it directly fails the length check.

Related Tools

Related Articles