How the IMEI Check Digit Works (Luhn Algorithm) + Free Calculator
Learn how the IMEI check digit is calculated with the Luhn algorithm, step by step with a real example, then validate any IMEI with our free online calculator.
Updated · 4 min read
In this article
The last digit of every IMEI isn’t part of the phone’s serial number at all. It’s a check digit — a single number calculated from the first 14 digits so that typing mistakes and many made-up IMEIs can be caught instantly, without contacting any database.
The formula is called the Luhn algorithm (also known as “mod 10”). It’s the same method that protects credit card numbers. Once you see it worked through, you can verify any IMEI with pen and paper in under a minute.
Where the check digit sits in an IMEI
A 15-digit IMEI is made of an 8-digit TAC (Type Allocation Code — brand and model), a 6-digit serial number and the final check digit. The check digit depends on all 14 digits before it, so changing any single digit almost always breaks it. (Want the bigger picture? Read what is an IMEI number and what a TAC code is.)
The 16-digit IMEISV some phones display has no check digit — its last two digits are a software version number. Only the 15-digit IMEI uses Luhn.
The Luhn algorithm in four rules
- Take the first 14 digits of the IMEI.
- Starting from the left, double every second digit (positions 2, 4, 6, 8, 10, 12 and 14).
- If doubling gives a two-digit number, add its two digits together (for example 16 becomes 1 + 6 = 7). This is the same as subtracting 9.
- Add everything up. The check digit is the number you need to add to reach the next multiple of 10. If the total already ends in 0, the check digit is 0.
Worked example: 35693803564380
Let’s calculate the check digit for the first 14 digits 35693803564380, step by step.
Step 1: Write out the digits and mark every second one
| Position | Digit | Doubled? | Result | Digit sum |
|---|---|---|---|---|
| 1 | 3 | No | 3 | 3 |
| 2 | 5 | Yes | 10 | 1 + 0 = 1 |
| 3 | 6 | No | 6 | 6 |
| 4 | 9 | Yes | 18 | 1 + 8 = 9 |
| 5 | 3 | No | 3 | 3 |
| 6 | 8 | Yes | 16 | 1 + 6 = 7 |
| 7 | 0 | No | 0 | 0 |
| 8 | 3 | Yes | 6 | 6 |
| 9 | 5 | No | 5 | 5 |
| 10 | 6 | Yes | 12 | 1 + 2 = 3 |
| 11 | 4 | No | 4 | 4 |
| 12 | 3 | Yes | 6 | 6 |
| 13 | 8 | No | 8 | 8 |
| 14 | 0 | Yes | 0 | 0 |
Step 2: Add the undoubled digits
Positions 1, 3, 5, 7, 9, 11, 13: 3 + 6 + 3 + 0 + 5 + 4 + 8 = 29.
Step 3: Add the doubled digit sums
Positions 2, 4, 6, 8, 10, 12, 14: 1 + 9 + 7 + 6 + 3 + 6 + 0 = 32.
Step 4: Find the check digit
Total: 29 + 32 = 61. The next multiple of 10 is 70, and 70 − 61 = 9. So the check digit is 9 and the complete IMEI is 356938035643809.
Common mistakes when calculating by hand
The math is simple, but four slips account for almost every wrong answer:
- Doubling the wrong digits. Double positions 2, 4, 6… 14, counted from the left of the 14 digits. Doubling the odd positions instead gives a different (wrong) answer. Generic Luhn tutorials count from the right; for an IMEI that reaches the same digits, but counting from the left is easier to get right.
- Adding 10 instead of 1 + 0. A doubled 5 becomes 10, which contributes 1, not 10. Likewise 18 contributes 9 and 16 contributes 7.
- Using all 15 digits to calculate. When you calculate, leave the 15th digit out. When you validate by summing, include it but don’t double it.
- Forgetting the zero case. If the total is already a multiple of 10 (say 60), the check digit is 0, not 10.
A useful sanity check: the doubled-and-summed value of a digit is always 0, 2, 4, 6, 8, 1, 3, 5, 7 or 9 for inputs 0 through 9. Memorize that sequence and you can do the whole calculation in your head.
Why IMEIs use Luhn at all
IMEIs are copied by hand all the time — read off a box, typed into a carrier form, sent over WhatsApp to a buyer. The GSM standards body adopted the Luhn formula because it’s fast to compute on any device, needs no lookup table and catches the errors people actually make. Phone software, carrier portals and check services can reject a mistyped IMEI instantly, before it ever reaches a database.
How to validate a full 15-digit IMEI
To check an IMEI you already have, there are two equivalent ways:
- Recalculate: run the steps above on the first 14 digits and compare your answer with the 15th digit.
- Sum all 15: apply the same doubling to positions 2–14, add every digit including the check digit, and the total must end in 0. For our example: 61 + 9 = 70 — valid.
Or let the calculator do it. Paste a 15-digit IMEI to validate it, or 14 digits to calculate the missing check digit:
Try it in the terminal
Prefer the command line? In the terminal below, type checkdigit 35693803564380 and press Enter — it returns 9. Then type imei 356938035643809 to see the full breakdown, or change one digit and watch it fail.
Developers can reproduce the same calculation with a one-line Python command:
python3 -c "d='35693803564380';s=sum(int(c) if i%2==0 else sum(divmod(int(c)*2,10)) for i,c in enumerate(d));print((10-s%10)%10)"Replace the 14 digits inside the quotes with your own. The script doubles every second digit, sums the digits of each product, and prints the check digit.
What a valid check digit does — and doesn’t — prove
Luhn is a typo detector, not a security system. It catches every single mistyped digit and almost every swap of two neighboring digits (the one exception is swapping 09 and 90). That’s why it’s perfect for spotting copy errors when someone sends you an IMEI over chat.
But anyone who knows the formula can generate a “valid” number. A passing check digit tells you nothing about:
- whether the IMEI was ever actually assigned to a real phone;
- which brand and model it belongs to;
- whether it is blacklisted, carrier-locked or iCloud-locked.
Next step: check the records
Once the number passes, look up what’s actually recorded against it. Confirm the brand and model with a manufacturer + model check, run a GSMA blacklist check, and for iPhones get the All-in-one Basic Info report (or the All-in-one by IMEI/serial for other devices). Our IMEI check page brings it all together, and this guide shows every way to find the number first.
Frequently asked questions
What is the check digit in an IMEI?
It is the 15th digit, calculated from the first 14 digits using the Luhn algorithm. It helps detect typos and invalid numbers.
How do I calculate an IMEI check digit?
Double every second digit of the first 14, add the digits of each product, add everything together, then subtract the total from the next multiple of 10.
Does a valid check digit mean the phone is genuine?
No. It only proves the number is well-formed. Use an IMEI check to confirm the model and blacklist status.
What does it mean if my IMEI is invalid?
Most often it is a typo. If the phone itself displays an invalid IMEI with *#06#, the device may be counterfeit or its IMEI may have been altered.
Does the IMEISV have a check digit?
No. The 16-digit IMEISV ends with a two-digit software version number instead of a check digit.