atmathExploreไทย

Everyday math · Phones & documents

How is the last digit of a Thai ID number worked out?

Short answer: digit 13 isn’t random. It is computed from the first 12 digits using “the remainder after dividing by 11” (mod 11), to catch typos. If 1 digit is mistyped, the result usually no longer matches the last digit, so a system can tell right away that the number is probably wrong.

What the 13 digits tell you

Digit 1 gives the type of person, followed by the area code where the person was registered and the sequence number in the register. The last digit (digit 13) is a check digit computed from the first 12

How digit 13 is computed (the commonly used formula)

  1. Multiply the first 12 digits by 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2 in that order
  2. Add up all the products
  3. Divide by 11 and look at the remainder (call it r)
  4. Compute 11 − r · if that has 2 digits, use the ones digit ⇒ that is digit 13

Example (made-up number 1-1223-34455-66)

Wide table ⇒ swipe left and right to see all 12 digits

Digit123456789101112
Value112233445566
× weight1312111098765432
= product131222202724282425201812

Sum = 245 · 245 ÷ 11 = 22 remainder 3 · 11 − 3 = 8 ⇒ digit 13 = 8

So the full number is 1-1223-34455-66-8 (still a made-up number)

Try it

Type 12 digits to see what digit 13 should be, or 13 digits to check · use made-up numbers only (everything runs on your device; nothing is sent anywhere)

How many typos does it catch?

Counted exactly over every 12-digit number whose first digit is 1–8 (800,000,000,000 numbers) · compare the old book number ISBN-10, which also uses mod 11 but writes “X” for 10 and has no weight of 11, so it catches every 1-digit typo and every neighbor swap

The math behind it

Good to know

References

Accessed 12 Nov 2026 · the numbers on this page were computed from the formula ourselves

← More from Explore