# IMEI calculator

The last number of the IMEI is a check digit. The Check Digit is calculated according to Luhn formula.

The Check Digit is a function of all other digits in the IMEI. The purpose of the Check Digit is to help guard against the possibility of incorrect entries to the CEIR and EIR equipment.

**The check digit is validated in three steps:**

- Starting from the right, double a digit every two digits (e.g., 5 → 10).
- Sum the digits (e.g., 10 → 1+0).

Check if the sum is divisible by 10. - Conversely, one can calculate the IMEI by choosing the check digit that would give a sum divisible by 10.

**For example:**

IMEI: 35145120840121

- (5x2, 4x2, 1x2, 0x2, 4x2, 1x2, 1x2) = (10, 8, 2, 0, 8, 2, 2)
- (1+0+8+2+0+8+2+2) + (3+1+5+2+8+0+2 ) = 44
- Luhn Digit : 6

IMEI: 351451-20-840121-**6**