The IMEI's Luhn Check Digit: How to Catch Typos
· TR Vertriebs GmbH
How the final IMEI digit is computed with the Luhn algorithm and which entry errors it reliably catches.
The 15th digit of an IMEI is not random but a check digit. It is computed from the preceding 14 places using the Luhn algorithm and serves a single purpose: entry and transmission errors should stand out before they cause harm. Anyone who types or scans many serial numbers each day can use this check to catch a large share of the classic transposed and mistyped digits automatically. This article explains the method step by step and shows what it can and cannot do.
The Luhn algorithm, named after Hans Peter Luhn, is a widely used check-digit scheme. It appears in credit card numbers, among other places, and indeed in the IMEI. It is deliberately simple so it can be followed without a calculator, and it detects the most common input errors. Importantly, the Luhn value only confirms the formal consistency of a number. It says nothing about whether the IMEI actually belongs to a real, unproblematic device.
Here is how the calculation works: number the 15 places from the left, 1 to 15. Every digit in an even position, that is position 2, 4, 6 and so on up to 14, is doubled. If the doubling produces a two-digit value, subtract 9, which is the same as adding the two digits together. Then add all these processed values to the unchanged digits in the odd positions, including the check digit. If the sum divides evenly by 10, the IMEI is valid by Luhn.
An example with the frequently used test IMEI 490154203237518: the even positions carry the digits 9, 1, 4, 0, 2, 7 and 1. Doubled and reduced by 9 where needed, they become 9, 2, 8, 0, 4, 5 and 2, totalling 30. The odd positions 4, 0, 5, 2, 3, 3, 5 and 8 also total 30. The overall sum of 60 divides by 10, so the number is formally valid. Change a single digit and the sum no longer works out.
The Luhn method reliably catches every single mistyped digit value. Most swaps of two adjacent digits are caught too, with one known exception: swapping 0 and 9 goes undetected, because both contribute the same amount to the checksum. The method also cannot rule out some more complex double errors. In practice this means Luhn is a very good first filter, but no guarantee that a number was copied correctly.
At goods-in it pays to run the Luhn check right at the point of entry. A mistyped IMEI is then rejected immediately instead of surfacing later as a booking error. Many barcode and Data Matrix scanners already deliver a validated IMEI, but with manual entry or poorly legible labels the check is invaluable. It remains important that a formally valid IMEI is not yet a verified IMEI. For blocklist, provenance and activation status you need a real query against the relevant data sources.
In summary, the Luhn check digit guards against exactly the errors that most often occur when numbers are typed and transmitted. It does not replace a substantive check, but it saves time and prevents follow-on errors in stock and paperwork. Once you have understood the calculation, you can expose an obviously wrong IMEI with pen and paper alone. In automated workflows the Luhn check should sit ahead of every further check as a fast, free pre-filter.