Every IMEI number contains a built-in self-check — a single digit at the end that mathematically proves the rest of the number is valid. That digit is calculated using the Luhn algorithm, a formula so elegant that it has been used to validate credit card numbers, social insurance numbers, and national ID codes for over 60 years. This guide explains exactly how it works and why it matters for your phone’s IMEI.

Table of Contents
- What Is the Luhn Algorithm?
- How the IMEI Uses the Luhn Check Digit
- Step-by-Step Luhn Validation of an IMEI
- Worked Example
- Why the Check Digit Matters
- What Happens When the Luhn Check Fails?
- Luhn Algorithm in Other Identifiers
- How IMEI Checkers Use Luhn Validation
- Frequently Asked Questions
What Is the Luhn Algorithm?
The Luhn algorithm (also called the Luhn formula or mod 10 algorithm) is a simple checksum calculation invented by Hans Peter Luhn, an IBM scientist, in 1954. It was originally designed to protect against accidental number transcription errors. Today it is used across many identification systems worldwide — including all IMEI numbers, virtually every credit and debit card number, and many national ID codes.
The algorithm works by performing a specific series of mathematical operations on a sequence of digits and checking whether the result is divisible by 10. If it is, the number is valid. If it is not, the number contains an error — either a transcription mistake or a deliberate fabrication.
How the IMEI Uses the Luhn Check Digit
An IMEI is 15 digits long. The first 14 digits carry actual information — the TAC (manufacturer and model) and the serial number. The 15th and final digit is the Luhn check digit: a number calculated from the preceding 14 digits using the Luhn formula.
The check digit is chosen such that when you apply the Luhn algorithm to all 15 digits together, the result is exactly divisible by 10. Any single-digit transcription error (typing 3 instead of 5, for example) will break this divisibility, immediately revealing the mistake.
The GSMA mandated the use of the Luhn check digit in IMEI numbers specifically to allow instant validation without querying any database. A carrier, a law enforcement officer, or a consumer can verify that an IMEI is structurally valid in under a second — before doing anything else with it.
Step-by-Step Luhn Validation of an IMEI
Here is the exact process for validating any IMEI using the Luhn algorithm:
- Write out all 15 digits of the IMEI from left to right.
- Double every second digit, starting from the second-to-last digit and moving left (i.e., positions 14, 12, 10, 8, 6, 4, 2 counting from the right).
- If doubling produces a number greater than 9, subtract 9 from it (or equivalently, sum its two digits).
- Sum all digits — both the unchanged ones and the doubled (and adjusted) ones.
- Check the total: if it is divisible by 10 (i.e., ends in 0), the IMEI is valid. If not, it is invalid.
Worked Example
Let us validate the IMEI 490154203237518:
| Position (right to left) | Digit | Action | Result |
|---|---|---|---|
| 1 (rightmost) | 8 | Keep as-is | 8 |
| 2 | 1 | Double → 2 | 2 |
| 3 | 5 | Keep as-is | 5 |
| 4 | 7 | Double → 14 → 14-9=5 | 5 |
| 5 | 3 | Keep as-is | 3 |
| 6 | 2 | Double → 4 | 4 |
| 7 | 3 | Keep as-is | 3 |
| 8 | 3 | Double → 6 | 6 |
| 9 | 0 | Keep as-is | 0 |
| 10 | 2 | Double → 4 | 4 |
| 11 | 4 | Keep as-is | 4 |
| 12 | 5 | Double → 10 → 10-9=1 | 1 |
| 13 | 1 | Keep as-is | 1 |
| 14 | 9 | Double → 18 → 18-9=9 | 9 |
| 15 (leftmost) | 4 | Keep as-is | 4 |
Sum: 8+2+5+5+3+4+3+6+0+4+4+1+1+9+4 = 60
60 ÷ 10 = 6, remainder 0. ✅ Valid IMEI.
Why the Check Digit Matters
The Luhn check digit catches the most common types of identifier errors instantly and without any network access:
- Transcription errors — mistyping one digit when writing or entering an IMEI
- Single-digit fabrications — changing one digit of a valid IMEI to create a fake one
- Accidental transpositions — swapping two adjacent digits (though not all transpositions are caught)
This is particularly important for law enforcement and carriers processing theft reports. An officer entering an IMEI manually from a police report can verify its structural validity immediately, before submitting it to a blacklist database. Submitting a structurally invalid IMEI to a national registry wastes processing time and may result in the wrong device being flagged.
What Happens When the Luhn Check Fails?
If you enter an IMEI into any checker tool and the Luhn check fails, you will typically see a message like “Invalid IMEI” or “IMEI format error” — before any blacklist database is even queried. The tool will not proceed with a blacklist check on a structurally invalid IMEI.
A Luhn failure means one of three things: the IMEI was mistyped, it was deliberately fabricated, or it belongs to a counterfeit device with a non-standard identifier. Counterfeit phones often use IMEIs that have been cloned from legitimate devices (which will pass the Luhn check but will show up as blacklisted or already assigned to a different model) or simply invented numbers that fail the check entirely. How to spot IMEI-related scams and fraud.
Luhn Algorithm in Other Identifiers
| Identifier | Uses Luhn? | Notes |
|---|---|---|
| IMEI | ✅ Yes | 15th digit is Luhn check digit |
| Credit / debit card number | ✅ Yes | Last digit is Luhn check digit |
| Canadian Social Insurance Number | ✅ Yes | Used for SIN validation |
| MEID (mobile) | Partial | Checksum used but different formula |
| ISBN (book identifier) | ❌ No | Uses mod 10 or mod 11, different formula |
| Serial Number | ❌ No | Manufacturer-defined, no universal checksum |
How IMEI Checkers Use Luhn Validation
Every legitimate IMEI check tool runs the Luhn validation as the first step — before making any API call to a blacklist database. This is a simple local computation that takes microseconds and filters out invalid inputs immediately, saving unnecessary database queries.
If you are building a system that processes IMEIs — for example, a device management platform, a second-hand marketplace verification tool, or a carrier onboarding system — implementing Luhn validation as a client-side check before any server request is a standard best practice. It reduces invalid submissions, cuts API costs, and improves user experience by giving instant feedback on input errors. Check any IMEI using official online tools.
What is the Luhn algorithm used for in IMEI numbers?
The Luhn algorithm generates the 15th digit (check digit) of every IMEI. This check digit allows instant mathematical validation of whether the IMEI is correctly formed — without querying any database. If the Luhn check fails, the IMEI is either mistyped or fabricated.
How do I validate an IMEI using the Luhn algorithm?
Double every second digit from the right (positions 2, 4, 6, 8, 10, 12, 14). If doubling produces a number over 9, subtract 9. Sum all digits. If the total is divisible by 10, the IMEI is valid. Most IMEI checker tools do this automatically before querying any blacklist database.
Does a valid Luhn check mean my IMEI is not blacklisted?
No. The Luhn check only confirms the IMEI is structurally valid — correctly formed according to the algorithm. It does not check blacklist status. A valid IMEI can still be blacklisted. You need to run a full IMEI check against an official database to confirm blacklist status.
What does it mean if my IMEI fails the Luhn check?
A Luhn failure means the IMEI number is invalid — either it was mistyped, it is fabricated, or it belongs to a device with a non-standard or cloned identifier. Legitimate IMEIs issued by the GSMA always pass the Luhn check.
Who invented the Luhn algorithm?
The Luhn algorithm was invented by Hans Peter Luhn, an IBM scientist, in 1954. It was originally designed to protect against accidental transcription errors. Today it validates credit card numbers, IMEI numbers, national identification codes, and many other numeric identifiers worldwide.