🎉 We're live on Product Hunt! Support us with your feedback
back

ID Number Validator & Generator

Check a Hong Kong HKID or Taiwan National ID against its checksum, or generate valid test numbers for your fixtures. Runs entirely in your browser.

This checks arithmetic only. A number can pass the checksum and still not belong to anyone. Nothing you type is sent anywhere.

What this checks, and what it cannot

Both the HKID and the Taiwan National ID carry a check digit derived from the other characters. This tool recomputes it. That catches typos and transcription errors, which is what it is for. It cannot tell you whether a number was ever issued, whether it is currently valid, or who holds it — that requires the issuing authority.

How the HKID check digit works

An HKID is one or two letters, six digits and a check character in parentheses. Letters are valued A=10 through Z=35; a missing first letter counts as 36. The eight body characters are multiplied by weights 9 down to 2, summed, and the check character is whatever makes the total divisible by 11. A remainder of 10 is written as the letter A.

For A123456: 36×9 + 10×8 + 1×7 + 2×6 + 3×5 + 4×4 + 5×3 + 6×2 = 481. 481 mod 11 = 8, and 11 − 8 = 3, so the number is A123456(3).

How the Taiwan check digit works

A Taiwan ID is one letter and nine digits. The letter maps to a two-digit code for the county or city of first household registration. That code contributes its first digit at weight 1 and its second at weight 9; the following eight digits carry weights 8 down to 1, and the final check digit carries weight 1. A valid number sums to a multiple of 10.

The first digit after the letter is the gender marker: 1 for male, 2 for female. Since 2021 the numbers 8 and 9 mark the unified numbers issued to foreign residents.

Generating test data

The Generate tab produces numbers that satisfy the checksum and nothing else. They are not issued to anyone and will not pass a real identity check — they exist so you can exercise a form validator, seed a staging database, or write a fixture without using a real person's number. Because the checksum algorithm is public, generating a valid-looking number reveals nothing that reading this page did not already tell you.

Do not use generated numbers in production records, and do not treat a passing checksum as identity verification anywhere. Real verification means checking against the issuing authority.

When you need this

  • Validating a form field before it reaches your database
  • Auditing a legacy dataset for transcription errors
  • Generating well-formed test data that will pass your own validation
  • Working out why a third-party API rejected a number

Rocks Dev Dock Released 🥳

Press '+' inside the tool to add your favorite tools to your dock.

No data collection when you use our tools, just tools.