The IMEI (International Mobile Station Equipment Identity) is a 15-digit number to uniquely identify a mobile phone device. IMEISV (IMEI Software Version) is a 16-digit number with the IMEI and an additional software version number.
As of 2004, the formats of the IMEI and IMEISV are
AA-BBBBBB-CCCCCC-EE respectively. The definition of the formats can be found below.
- TAC : Type Allocation Code
- SN : Serial Number
- CD : Check Digit based on Luhn algorithm
- SVN : Software Version Number
If you notice the format, the 15th digit of the IMEI is a check digit and the IMEISV has a 2-digit software version number but without the check digit.
To retrieve information of a mobile device, we normally perform an IMEI lookup rather than an IMEISV lookup. To retrieve the IMEI from the IMEISV , we need to perform the following steps:
- Remove the last 2 digits (SVN) from IMEISV, leaving us with the IMEI but without the check digit
- Compute the check digit based on the Luhn algorithm
Luhn Algorithm Check Digit Computation
- Starting from the right, double every other digit (e.g., 8 → 16).
- Sum the digits (e.g., 16 → 1 + 6).
- The sum plus the check digit must be divisable by 10 (e.g., sum is 52, check digit must be 8, since 60 is divisable by 10).
35576205279323?, the check digit computation is as follows.
|Double every other||3||10||5||14||6||4||0||10||2||14||9||6||2||6||?|
|Sum digits||3 +||1 + 0||5 +||1 + 4 +||6 +||4 +||0 +||1 + 0 +||2 +||1 + 4 +||9 +||6 +||2 +||6 +||? = 55 + ?|
For the sum to be divisible by 10, we need to set ? = 5, so the IMEI is