香港身份證號碼校驗

分享:
單位換算

香港身份證號碼校驗

1-2 字母 + 6 數字 + 1 校驗碼 · Mod 11 演算法

作者 來源查核 最後審閱 香港 參考 校驗
你的瀏覽器版本過舊,此工具的互動功能無法運作。請更新至 Safari 13.1、Chrome 或 Edge 80、Firefox 74 或以上版本。

香港身份證號碼校驗

📅 研究資料截至 2026年11月6日 · 來源: 校驗碼:廣為轉載的推算方法(入境事務處並未公布),見電腦學習史網站 HKID Formula (HKID Number Check Digit),2005 年 11 月 1 日,以及中文維基百科「香港身份證」條目修訂版本 93873451;字母前綴:入境事務處依《公開資料守則》於 2020 年 10 月 8 日及 2026 年 8 月 21 日作出的回覆;證件符號:入境事務處表格 ROP133(10/2025)。
標準、已發表的公式與參考資料會隨時間修訂 — 依據這些數字行動前,請對照現行的權威來源確認。
廣告
After results · AD-W1Responsive

使用方法

輸入香港身份證號碼

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 個碰巧通過。

隱私

身份證號碼屬於個人資料;個人資料私隱專員公署的《身份證號碼及其他身份代號實務守則》限制機構在什麼情況下可以收集。本工具不收集:校驗在你的瀏覽器內完成,輸入的內容不會傳送到任何地方,也不會寫入網址或儲存。

廣告
After how-to · AD-W2Responsive

校驗位可以是 A,代表數值十

01

校驗碼是 11 減去餘數(餘數為 0 時為 0),所以餘數為 1 時得 10,寫作 A——括號裡會出現字母就是這個原因。

02

入境處沒有公布校驗碼的演算法;表格 ROP133 只說括號內的字元不屬於身份證號碼,是為方便電腦處理資料而設。

03

打錯一位數字一定會被發現:540 種情形全部改變校驗碼;相鄰兩位數字對調的 450 種也一樣。

04

打錯字母不一定被發現:650 種情形中只有 612 種會被發現。數值相差 11 的字母(A、L、W;B、M、X……)效果相同,所以 A123456(3) 和 L123456(3) 都能通過。

05

格式正確的隨機字串約每 11 個有 1 個(約 9.1%)碰巧通過,因為校驗碼只有 11 種可能。

06

號碼本身看不出持證人是否永久居民:那是身份證正面的符號標記,例如 A 表示有居留權、R 表示有入境權(入境處 ROP133)。

07

1980 年 1 月 1 日起在香港登記出生的人士,出生證明書編號一般就是日後的身份證號碼(入境處,2020)。

08

單字母字頭仍在簽發: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.

資料來源

可能使本頁過時的因素

  • None at runtime; nothing typed is sent anywhere.
廣告
Pre-footer · AD-W3 728 × 90