DevTools Logo

Hong Kong HKID Generator

Hong Kong HKID Generator

Generate Hong Kong identity card numbers with the mod-11 check character — 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

    Single-letter HKID

    Input
    HKID · Generate
    Output
    A123456(3)

    Letter A, six digits and check character 3 in brackets.

    Two-letter HKID

    Input
    HKID · Generate
    Output
    AB987654(3)

    Two letters use both letter weights before the six digit weights.

    Wrong check character

    Input
    A123456(4)
    Output
    Invalid — check character is 4 but A123456 requires 3

    The validator names the character the body requires.

    About this tool

    The Hong Kong HKID Generator produces identity card numbers as one or two letters, six digits and a check character in brackets, for example A123456(3). Two-letter cards such as AB987654(3) are supported, and the brackets are presentation only — the validator accepts the number with or without them.

    The check character comes from letter values A=10 through Z=35, with a missing first letter counted as 36 for single-letter cards. The two letter positions are weighted 9 and 8, the six digits 7 down to 2, and the check is 11 minus the sum mod 11; a result of 10 is written A and a result of 11 is written 0.

    These are synthetic values for QA and development, never for real applications, KYC checks, tax filings or identity documents; a random value can coincidentally match a real, issued number, and DevTools accepts no liability for how generated data is used. Everything runs locally in your browser.

    What this tool does not do

    • Validation confirms the check character only, not that the card was issued.
    • The generator draws from a small letter set, so not every valid prefix appears in output.
    • The card layout, photo and other printed features are outside this tool.
    • No Immigration Department lookup is performed.

    How to use this tool

    1. Generate one HKID

      Click Generate to create a letter, six digits and the mod-11 check character in brackets.

    2. Copy the value

      Copy the formatted number or download it as a .txt file.

    3. Validate either form

      Switch to Validate and paste a value with brackets, without brackets, or in lowercase; the parser normalizes it.

    Use cases

    Hong Kong onboarding

    Fill identity fields with HKIDs that pass the mod-11 check before testing account creation.

    Bracket and case handling

    Confirm that your parser normalizes brackets, spaces and lowercase letters.

    Single versus two letters

    Exercise the 36 placeholder value that applies when the first letter is missing.

    HKID structure and check

    PartRule
    Format1 or 2 letters + 6 digits + check character
    Letter valuesA=10 through Z=35; a missing first letter counts 36
    WeightsLetters 9 and 8; digits 7, 6, 5, 4, 3, 2
    Check formula11 − (sum mod 11)
    Check mapping10 is written A, 11 is written 0
    BracketsNot part of the number and optional on input

    Both single-letter and two-letter cards are generated and validated.

    Common mistakes

    Mistake:Storing the brackets

    Fix:They are display characters; the number is the letters, digits and check character.

    Mistake:Computing a single-letter card as if it had two letters

    Fix:A missing first letter counts as 36 in the first weighted position.

    Mistake:Rejecting check character A or 0

    Fix:10 maps to A and 11 maps to 0, so both are valid.

    Frequently asked questions

    Are these real HKIDs, and can I use them in production?

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

    How is the HKID check character calculated?

    Letters map to A=10 through Z=35, with a missing first letter counting as 36. Letters are weighted 9 and 8 and digits 7 down to 2, and the check is 11 minus the sum mod 11.

    Why can the check character be A or 0?

    A result of 10 is written as A and a result of 11 as 0, so both appear as valid check characters.

    Do I need the brackets?

    No. The brackets are presentation only, and the validator accepts A123456(3), A1234563 or a lowercase version of either.

    Are two-letter HKIDs supported?

    Yes. Both single-letter and two-letter numbers are generated and validated, using the 36 placeholder when the first letter is absent.

    References & standards