How to Compute IMEI from IMEISV

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-D and 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:

  1. Remove the last 2 digits (SVN) from IMEISV, leaving us with the IMEI but without the check digit
  2. Compute the check digit based on the Luhn algorithm

Luhn Algorithm Check Digit Computation

  1. Starting from the right, double every other digit (e.g., 8 → 16).
  2. Sum the digits (e.g., 16 → 1 + 6).
  3. 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).

For IMEI 35576205279323?, the check digit computation is as follows.

Double every other310514640102149626?
Sum digits3 +1 + 05 +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 355762052793235.

ibrahim = { interested_in(unix, linux, android, open_source, reverse_engineering); coding(c, shell, php, python, java, javascript, nodejs, react); plays_on(xbox, ps4); linux_desktop_user(true); }