DevTools Logo

China Resident ID Generator

China Resident ID Generator

Generate 18-digit Chinese Resident Identity Card numbers with region, birth date and ISO 7064 check — synthetic test data only

Runs in your browser

For Development & Testing Purposes Only - Synthetic Mock Data

Settings

1 value

Generates one value with a valid checksum. Press ⌘/Ctrl+Enter for a fresh one.

Generated value

No value yet

Set options, then press Generate.

Generated values are valid in shape but randomized (Test Data).

Legal Disclaimer: Generated data is for software testing and validation purposes only (e.g. verifying input masks, form validation, or database seeding). It is randomly generated and not taken from any real record, but a random value can coincidentally match a real, issued number, so never use it in real applications, payments, KYC or official forms. Using it to impersonate real people or for any fraudulent activity is illegal. DevTools accepts no liability for how generated data is used.

    Examples

    The GB 11643 example

    Input
    11010519491231002X
    Output
    Valid — region 110105, born 31 Dec 1949, check character X

    This is the worked example printed in the standard, so it exercises the X branch of the checksum.

    Wrong check character

    Input
    110105194912310021
    Output
    Invalid — check character is 1 but the first 17 digits require X (ISO 7064 MOD 11-2)

    Only the final character differs, isolating the checksum from the date check.

    Impossible birth date

    Input
    110105194913310028
    Output
    Invalid — digits 7-14 (19491331) are not a valid birth date

    Month 13 is rejected before the check character is computed.

    About this tool

    The China Resident ID Generator creates one 18-character Resident Identity Card number following GB 11643-1999. The parts are a 6-digit administrative division code from GB/T 2260, an 8-digit YYYYMMDD birth date, a 3-digit sequence where odd values are male and even values are female, and a check character computed with ISO 7064 MOD 11-2 that can be the letter X.

    Generation draws the division code from county-level codes in Beijing, Shanghai, Guangzhou, Shenzhen, Hangzhou, Chengdu, Wuhan and Nanjing and picks a birth date between 1950 and 2005, so outputs look like the records your form will see. The validator checks the province prefix against the GB/T 2260 list, rejects impossible dates such as month 13, and recomputes the ISO 7064 check character.

    These numbers are synthetic test data for QA and development: never use them on real applications, KYC checks, tax filings, or identity documents, and DevTools accepts no liability for how generated data is used. Everything runs locally in your browser.

    What this tool does not do

    • The generator uses a small set of county codes, so outputs cluster around eight large cities.
    • The check character validates the digits; it cannot confirm that the identity exists or that the details are real.
    • The validator accepts any 1900-or-later birth date, not just dates inside the generator's 1950–2005 range.
    • The 3-digit sequence is random, so generated values do not preserve any real registration ordering.

    How to use this tool

    1. Choose the Resident ID option

      The tool is pinned to the 18-character Resident Identity Card number with the ISO 7064 MOD 11-2 check.

    2. Generate a value

      Click Generate to create one number with a county division code, a birth date and a 3-digit sequence.

    3. Validate or copy

      Switch to Validate to check a pasted number's province, date and check character, or copy the result and download it as .txt.

    Use cases

    KYC form fixtures

    Populate identity fields in staging with values that pass province, date and checksum rules.

    Date-branch coverage

    Test that your parser rejects month 13 and accepts 29 February in a leap year.

    X check character

    Use the standard example to confirm your implementation handles the letter X as well as digits.

    Resident ID number layout

    PositionsMeaning
    1-6Administrative division code (GB/T 2260)
    7-14Birth date, YYYYMMDD
    15-17Sequence; odd = male, even = female
    18Check character, ISO 7064 MOD 11-2 (0-9 or X)
    ValidationProvince prefix, real birth date and check character

    Generated division codes come from Beijing, Shanghai, Guangzhou, Shenzhen, Hangzhou, Chengdu, Wuhan and Nanjing.

    Common mistakes

    Mistake:Assuming the sequence is the person's age or region

    Fix:The 3-digit sequence encodes sex by parity only and is otherwise issuer-assigned.

    Mistake:Dropping the X check character

    Fix:X is a valid check character, not an error; accept it in both lowercase and uppercase.

    Mistake:Using any 6-digit prefix

    Fix:The first two digits must be a province code listed in GB/T 2260.

    Frequently asked questions

    Are these real Chinese Resident IDs?

    No. They are synthetic values for QA and development, never for real applications, KYC checks, tax filings, or identity documents. The structure is real, so a random value can coincide with an issued number; DevTools accepts no liability for how generated data is used.

    What do the 18 characters mean?

    Six digits are an administrative division code from GB/T 2260, eight are the YYYYMMDD birth date, three are a sequence where odd is male and even is female, and the last is an ISO 7064 MOD 11-2 check character.

    Why can the last character be an X?

    ISO 7064 MOD 11-2 yields eleven possible values, and 10 is written as X. Treat X as a valid check character, not an error.

    Why is a month of 13 rejected?

    Digits 7 to 14 must be a real calendar date. The validator checks the date before it recomputes the check character, so an impossible month fails first.

    Which region codes does the generator use?

    It draws county-level codes from Beijing, Shanghai, Guangzhou, Shenzhen, Hangzhou, Chengdu, Wuhan and Nanjing rather than the full GB/T 2260 table.

    References & standards