Hong Kong HKID Format Validator (香港身份证)
1-2 letter + 6 digit + check character · Mod 11 algorithm
Hong Kong HKID Format Validator (香港身份证)
How to use
Enter HKID
1-2 letter prefix + 6 digits + 1 check character. "A123456(3)", "AB1234569" and full-width characters from a Chinese IME are all accepted. Enter the letters and six digits alone and the tool says what the check character would be.
Weighted sum
Letters are valued A=10, B=11 … Z=35 and digits at face value; a one-letter number gets an implied leading space worth 36. The eight positions are multiplied by the weights 9, 8, 7, 6, 5, 4, 3, 2 and added up.
Divide by 11 → check
Take the remainder of the sum divided by 11. A remainder of 0 gives check 0; otherwise the check is 11 minus the remainder, and 10 (a remainder of 1) is written A. The working under the result lists every step.
Compare check character
Your entered check character must match the computed one. Mismatch = typo or not a real HKID.
About the Hong Kong HKID checksum
The Hong Kong identity card is issued by the Immigration Department under the Registration of Persons Ordinance (Cap. 177). The number is one or two letters and six digits, followed by a check character in brackets. The department's form ROP133 says the bracketed digit or letter "is not part of the identity card number" and is there to facilitate computer data processing; it has not published how it is computed. Like every validator, this one uses the widely reproduced reconstruction (written down, for example, in a 2005 post on the 電腦學習史 blog and in the Chinese Wikipedia article's check-digit section), and it runs entirely in your browser.
What the letter prefix records
Answering access-to-information requests in 2020 and 2026, the Immigration Department said the letters carry no special meaning in themselves: when one series is nearly used up, numbering moves to another letter. Before 28 March 1983 prefixes went by registration office (A, D and H on Hong Kong Island, B, E and G in Kowloon, C in the New Territories). First registrations since then have run through K (1983), P (1990), R (2000), M (2011) and F (2020), and from 27 July 2026, L. Since 1980 a Hong Kong birth certificate number normally becomes the holder's identity card number, in the series Z, then Y (1989), S (2005) and N (2019). Enter a number and the result shows what the department has said about its prefix; where it has said nothing, the tool does not invent a meaning.
"The check character catches a mistyped number, not a forged one — and its rule has not been officially published, only reconstructed and widely shared."
What the check character catches
Counted over every case rather than assumed: all 540 ways to mistype one digit change the check, and so do all 450 swaps of two neighbouring digits. A mistyped letter is another matter: only 612 of the 650 possible one-letter slips are caught, because letters 11 apart in value (A, L and W; B, M and X; and so on) move the check the same way, so A123456(3) and L123456(3) both pass. A random string of the right shape passes about one time in eleven.
Privacy
An identity card number is personal data, and the Privacy Commissioner for Personal Data's Code of Practice on the Identity Card Number and other Personal Identifiers limits when an organisation may collect one. This tool does not collect it: the check runs in your browser, and what you type is not sent anywhere, not put in the address bar and not stored.
The check character can be A, which stands for ten
The check is 11 minus the remainder (0 when the remainder is 0), so a remainder of 1 gives 10, written A — which is why the bracket can hold a letter.
The Immigration Department has not published the algorithm; its form ROP133 says only that the bracketed character is not part of the number and is there to facilitate computer data processing.
A mistyped digit is always caught: all 540 one-digit slips change the check, and so do all 450 swaps of two neighbouring digits.
A mistyped letter is not always caught: 612 of the 650 one-letter slips are. Letters 11 apart in value (A, L and W; B, M and X; and so on) count the same, so A123456(3) and L123456(3) both pass.
A random string of the right shape passes about one time in eleven (9.1%), because the check has only 11 possible values.
The number does not say whether the holder is a permanent resident; symbols on the card face do — A for the right of abode, R for the right to land (Immigration Department, ROP133).
For births registered in Hong Kong since 1 January 1980, the birth certificate number normally becomes the identity card number (Immigration Department, 2020).
Single-letter prefixes are still being issued: F from February 2020, then L, brought back on 27 July 2026 (Immigration Department, 2026).
Frequently Asked Questions
No. Validation runs entirely in your browser — your HKID is never uploaded, logged, stored or put in the address bar.
No. It only means the number satisfies the algorithm — about one random string of the right shape in eleven does. Whether a number was ever issued is something only the Immigration Department can confirm.
Yes, but only A. The check is 11 minus the remainder, so a remainder of 1 gives 10, written A; a remainder of 0 gives 0, and remainders 2 to 10 give 9 down to 1.
The Immigration Department says the letters carry no special meaning in themselves — they are numbering series, and the next letter starts when one runs low. It has given the dates: first registrations K (1983), P (1990), R (2000), M (2011), F (2020) and L (from 27 July 2026), and Hong Kong-registered births Z (1980), Y (1989), S (2005) and N (2019). Validate a number and the result shows the note for its prefix.
Yes. Type it without brackets (A123456, say) and the tool shows what the check would be, with the working; it does not call such a number valid or invalid.
No. The tool ignores spaces, parentheses and hyphens, and accepts full-width characters from a Chinese IME. "A123456(3)" and "A1234563" are treated identically.
Yes — the number alone cannot distinguish permanent from non-permanent. Residential status is shown by symbols on the card face, such as A for the right of abode and R for the right to land (Immigration Department form ROP133).
This page validates one at a time, for privacy. The rule is set out in "How to use", so you can implement it in your own system — no API is needed.
Method & sources
How it computes
An HKID is one or two letters, six digits and a check character. Letters A=10 to Z=35, an implied leading space worth 36 for a one-letter number, weights 9 to 2, check = 11 − (sum mod 11), with 0 for remainder 0 and A for 10 — the reconstruction, not an official rule. The page shows the working, says what check a bare body would take, and gives the Immigration Department's own notes on the letter prefix.
What this tool implements
- Corrected 2026-11-06: the how-to valued letters A=1, B=2 ... Z=26. The reconstruction, and this tool's arithmetic, value them A=10 ... Z=35 with a space worth 36; with A=1 a reader following the steps by hand got a different check. The fact card and FAQ that said the check is A when the remainder is 10 now say what the rule gives: A stands for 10, which a remainder of 1 produces.
- Corrected 2026-11-06: fact cards and FAQs that were wrong or had no source were removed or rewritten — an HKID is not "11 or 12 characters" (8 or 9, plus the brackets as printed); "~37,000 letter-prefix combinations" (26 + 676 = 702 are possible); double-letter prefixes "introduced in the 1970s as the population grew from 2M to 7M" (the Immigration Department says XA, XB, XC ... went to people without a Chinese name before 1983); "smart ID now 100% adopted", "child HKIDs under 11", "paper HKIDs phased out 2003-2014" and a Home Return Permit number of "11 digits" had no source; "zero-network design fully complies" with the PDPO overclaimed (the tool collects nothing).
- The check character is NOT officially published. The Immigration Department's form ROP133 (10/2025) says the bracketed digit or letter is not part of the identity card number and is used to facilitate computer data processing. The page uses the reconstruction as written down in a 2005 blog post and the Chinese Wikipedia article, and pins that article's worked examples G123456(A), L555555(0) and AB987654(3) in its tests.
- Added: the working table for every check, a bare body (letters and six digits) answered with the check it would take rather than called invalid, full-width input from a Chinese IME accepted, and counts of what the check catches computed over every case: all 540 one-digit slips and all 450 adjacent-digit swaps, but only 612 of 650 one-letter slips, because letters 11 apart in value (A, L, W) give the same check.
- Added: what a letter prefix records, only as the Immigration Department has stated it in two replies under the Code on Access to Information (8 Oct 2020 and 21 Aug 2026), including that the letters carry no special meaning in themselves; a prefix it has not described is shown as undescribed, not given a meaning.
- THIS VALIDATES A FORMAT, NOT A PERSON. A number that passes is well-formed; about one random string in eleven passes. Input is checked in the browser and is neither stored, transmitted nor put in the URL.
Sources
- Immigration Department, HKSAR. Form ROP133 (10/2025), Information on the Front of the Hong Kong Identity Card — the bracketed character is not part of the number; residential-status and other symbols on the card face. Cited by title.
- Immigration Department, HKSAR. Reply under the Code on Access to Information, ref. L/M (82) in RP 32/230/R, 8 Oct 2020 (prefix letters and dates of issue), published on AccessInfoHongKong: https://accessinfo.hk/zh_HK/request/you_guan_xiang_gang_shen_fen_…
- Immigration Department, HKSAR. Reply under the Code on Access to Information, ref. L/M (239) in RP 32/230/R, 21 Aug 2026 (F issued 24 Feb 2020 to 26 Jul 2026; L from 27 Jul 2026), published on AccessInfoHongKong: https://www.accessinfo.hk/request/guan_yu_xiang_gang_shen_fen_zhen/
- 電腦學習史. HKID Formula (HKID Number Check Digit) 香港身份證號碼計算. Blog post, 1 Nov 2005 — the reconstruction written out: space = 36, A = 10 ... Z = 35, weights 9 to 2, remainder 0 gives 0, 1 gives A, otherwise 11 minus the remainder: https://computerterminal.blogspot.com/2005/11/hkid-calculation.html
- Wikipedia contributors. 香港身份證, §校驗碼 (Chinese Wikipedia, revision 93873451, 13 Aug 2026) — the same reconstruction with worked examples G123456(A), L555555(0), AB987654(3): https://zh.wikipedia.org/w/index.php?title=%E9%A6%99%E6%B8%AF%E8%…
- Hong Kong, China. Information on Tax Identification Numbers (OECD AEOI portal, PDF of 29 May 2023): the HKID check digit "has 11 possible values from 0 to 9 and A". https://www.oecd.org/content/dam/oecd/en/topics/policy-issue-focu…
What can make this go out of date
- None at runtime; nothing typed is sent anywhere.