English
This page is available in English
The whole page — instructions, buttons and results.
Switch to English香港身份证号码校验
使用方法
输入香港身份证号码
1-2 个英文字母 + 6 位数字 + 1 位校验码。支持「A123456(3)」「AB1234569」以及中文输入法的全角字符;只输入字母和 6 位数字时,工具会算出校验码应是什么。
自动加权求和
字母按 A=10、B=11……Z=35 取值,数字按本身取值;单字母号码前补一个隐含空格,值为 36。8 个位置依次乘以权重 9、8、7、6、5、4、3、2 后相加。
求和后除以 11
取加权和除以 11 的余数:余数为 0,校验码为 0;否则校验码为 11 减余数,其中 10 写作 A(即余数为 1 时)。结果下方的「计算过程」会逐位列出。
对比校验码
输入的校验码与算法计算的校验码必须一致才算通过。不一致即可能输错或并非真实 HKID。
香港身份证号码校验算法
香港身份证由入境事务处根据《人事登记条例》(第 177 章)签发。号码由 1-2 个英文字母 + 6 位数字组成,后面括号内还有 1 个校验码。入境处的表格 ROP133 说明,括号内的数字或字母「不属于身份证号码的一部分」,只为方便电脑处理资料而设,并没有公布计算方法。本工具与其他校验器一样,使用外界反推、广泛流传的版本(例如一篇 2005 年的中文网志与中文维基百科的校验码一节都有写出),完全在浏览器内运行。
字母前缀记录了什么
入境处在 2020 年和 2026 年按《公开资料守则》答复市民查询时说明:英文字母本身没有特别含意,一个字头的编号快用完时,就改用另一个字母。1983 年 3 月 28 日以前按登记办事处所在地区编配(港岛 A、D、H,九龙 B、E、G,新界 C);此后首次登记的人士依次获 K(1983)、P(1990)、R(2000)、M(2011)、F(2020)字头,2026 年 7 月 27 日起改发 L。1980 年起在香港登记出生的人士,出生证明书编号一般就是日后的身份证号码,依次为 Z、Y(1989)、S(2005)、N(2019)。输入号码后,结果下方会显示入境处对该字头的说明;入境处没有说明的字头,工具不会替它编一个意思。
「校验码拦得住打错的号码,拦不住伪造的号码——它的算法也并未正式公布,只是被外界反推出来、广泛流传。」
校验码能发现什么
本工具把每种情况都算过一遍:打错一位数字的 540 种情形全部能发现,相邻两位数字对调的 450 种也全部能发现;但打错字母时,650 种情形只有 612 种会被发现,因为数值相差 11 的字母(A、L、W;B、M、X……)对校验码的影响相同,例如 A123456(3) 与 L123456(3) 都能通过。随便一串格式正确的字符,约每 11 个就有 1 个碰巧通过。
隐私
身份证号码属于个人资料;个人资料私隐专员公署的《身份证号码及其他身份代号实务守则》限制机构在什么情况下可以收集。本工具不收集:校验在你的浏览器内完成,输入的内容不会发送到任何地方,也不会写入网址或储存。
校验位可以是 A,代表数值十
校验码是 11 减去余数(余数为 0 时为 0),所以余数为 1 时得 10,写作 A——括号里会出现字母就是这个原因。
入境处没有公布校验码的算法;表格 ROP133 只说括号内的字符不属于身份证号码,是为方便电脑处理资料而设。
打错一位数字一定会被发现:540 种情形全部改变校验码;相邻两位数字对调的 450 种也一样。
打错字母不一定被发现:650 种情形中只有 612 种会被发现。数值相差 11 的字母(A、L、W;B、M、X……)效果相同,所以 A123456(3) 和 L123456(3) 都能通过。
格式正确的随机字符串约每 11 个有 1 个(约 9.1%)碰巧通过,因为校验码只有 11 种可能。
号码本身看不出持证人是否永久居民:那是身份证正面的符号标记,例如 A 表示有居留权、R 表示有入境权(入境处 ROP133)。
1980 年 1 月 1 日起在香港登记出生的人士,出生证明书编号一般就是日后的身份证号码(入境处,2020)。
单字母字头仍在签发:F 自 2020 年 2 月起,2026 年 7 月 27 日起改为重新启用的 L(入境处,2026)。
常见问题
不。校验在浏览器内运行,身份证号从不上传、不记录、不储存,也不会写入网址。
不。只表示符合算法:格式正确的随机字符串约每 11 个就有 1 个通过。要确认号码是否真的签发过,只能由入境事务处核实。
可以,只能是 A。校验码是 11 减余数,余数为 1 时得 10,写作 A;余数为 0 时校验码为 0;余数为 2 至 10 时,校验码为 9 至 1。
入境事务处表示英文字母本身没有特别含意,只是编号系列:一个字头快用完就换下一个。它公布过各字头的启用时间,例如首次登记的 K(1983)、P(1990)、R(2000)、M(2011)、F(2020)、L(2026 年 7 月 27 日起),以及香港登记出生的 Z(1980)、Y(1989)、S(2005)、N(2019)。验证一个号码后,结果下方会显示该字头的说明。
可以。不加括号直接输入(例如 A123456),工具会显示按算法校验码应是什么,并列出计算过程;它不会把这样的号码判为通过或不通过。
不。工具会忽略空格、括号、连字符,也接受中文输入法的全角字符。「A123456(3)」和「A1234563」效果完全相同。
是。号码本身无法识别永居与否;居留身份由身份证正面的符号标记显示,例如 A 表示有居留权、R 表示有入境权(入境处表格 ROP133)。
此页一次校验一个——为了隐私。算法已写在「使用方法」中,可以照着在自己的系统里实现,无需任何 API。
方法与来源
计算方式
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.
本工具依据的标准
- 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.
资料来源
- 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…
可能导致本页过时的因素
- None at runtime; nothing typed is sent anywhere.