Skip to main content

Hong Kong HKID Generator

Hong Kong Identity Card (HKID) generator for immigration, financial and banking software testing.

Waiting for generation...

About Hong Kong Identity Card (HKID)

The HKID is the mandatory official identity card issued to residents of Hong Kong aged 11 and above.

It is widely used for e-Channel border clearance, public services, medical care, and banking.

Anatomy & Structure of Hong Kong HKID

Formatted as L(NNNNNN)C or LL(NNNNNN)C:

PositionFieldLengthMeaning & RuleExample
1 (or 1 and 2)Prefix1 or 2 lettersLetters (A-Z) representing issuance category or date eraA
2 to 7 (or 3 to 8)Serial Number6 digitsSequential number allocated by the Immigration Department123456
Final characterCheck Character1 charModulo 11 check character (0-9 or letter "A" for value 10)3

Official Checksum Algorithm (Weighted Modulo 11)

Official formula defined by Hong Kong Immigration Department:

S = (c1 * 9) + (c2 * 8) + (d1 * 7) + (d2 * 6) + (d3 * 5) + (d4 * 4) + (d5 * 3) + (d6 * 2); Remainder = S mod 11; Check = (11 - Remainder) mod 11.
  1. 1. For single-letter prefixes, the first slot is an implicit space (value 36) multiplied by weight 9.
  2. 2. Letters A-Z map to values 10 through 35.
  3. 3. Multiply characters by descending weights [9, 8, 7, 6, 5, 4, 3, 2].
  4. 4. Sum the products and find remainder modulo 11.
  5. 5. Check character is (11 - Remainder) mod 11. If 10, it is represented as letter "A".

Frequently Asked Questions (FAQ)