ID Number Parsing: Format Checks Are Not Authenticity

Open Tool Chinese ID Card Parser

How eighteen digits divide

An eighteen-digit ID splits into four parts: the first six are an administrative region code, the seventh through fourteenth the birth date, the fifteenth through seventeenth a sequence where odd means male and even female, and the eighteenth a check character, a digit or the letter X. The check comes from weighted summation and modulus, with fixed weights and a fixed map from remainder to character. The tool separates those parts, reports region, birth date, sex and age, and verifies the check. It judges whether the number follows the encoding rules, never whether it exists.

Steps

  1. Paste the eighteen digits, spaces removed.
  2. Parse to get region, birth date, sex, age and check result.
  3. Verify the check: a failure means the number was altered or mistyped.
  4. Read the region name, remembering that boundary changes leave older numbers on retired place names.
  5. Copy the result for reconciliation, clear the field, or load the sample format.
  6. Mask other people's numbers first, keeping three characters at each end or only the check result.

Check digit, regions and masking

The algorithm multiplies each of the first seventeen digits by a fixed weight, sums, takes the remainder of division by eleven and maps it to a character, so editing any single digit breaks the check. Region codes follow administrative divisions, and one city may hold several, while retired codes persist on old numbers. The birth date is validated for real calendar dates, rejecting February thirtieth and similar. The sequence is assigned locally and carries nothing further. Masking is the floor for handling such data: show the first three and last four in reports, keep plaintext out of logs, and restrict access to exports.

Common mistakes

Treating a passing check as proof of identity mistakes format for authenticity. Reading the region as residence ignores relocation. Taking the seventeenth digit as sole sex evidence, which modification can fake. Storing plaintext in a test database invites exposure. Handling eighteen digits as a number breaks on the final X. And looking up a retired region code against current maps suggests a false error.

Where parsing must stop

Real identity verification belongs to authorised bodies or compliant real-name services. Account opening, contracting and onboarding need the number checked with the physical document and a liveness check. Forging, altering or trading identity documents is unlawful, and this tool serves none of it. Storage follows personal information protection: minimum necessary, encrypted, deleted on schedule. And parsed output is not a judgment of authenticity nor a legal basis.

⏫︎