Transparent checksum math for developers and QA

ICCID Luhn Calculator

Generate the final check digit from an 18-digit ICCID body or validate a complete 19-digit SIM or eSIM identifier. Inspect every doubled digit, contribution, sum, and remainder.

Calculator / 01

Calculate or validate

The input length selects the mode automatically.

18 digits: generate a check digit. 19 digits: validate the final digit. Spaces and hyphens are accepted.

The calculator module does not send the identifier to this site's processing server. A checksum pass verifies Luhn math only—not ICCID conformance, SIM existence, ownership, activation, or network access. Privacy boundary →

Ready to calculate

Paste 18 digits to generate the final digit, or 19 digits to compare the supplied checksum with the expected value.

How to calculate an ICCID check digit.

For the current 19-digit E.118 ICCID structure, the first 18 digits form the body and the last digit is the Luhn checksum. The alternating transformation is anchored at the body's rightmost digit.

18-digit body 891011234567890123
Transformed sum 72
Check digit (10 − 72 mod 10) mod 10 = 8
Completed ICCID 8910112345678901238

Transform alternating digits

Starting at the right edge of the 18-digit body, double every other digit. Keep the digits between them unchanged.

Reduce two-digit products

When doubling produces a value above 9, subtract 9. For example, 9 becomes 18 and contributes 9 to the sum.

Complete the next multiple

Add all transformed contributions. The check digit is the value required to make the final total divisible by 10.

Portable reference / 03

ICCID Luhn code for JavaScript and Python.

Both implementations use the same right-to-left parity as the live calculator and return the nineteenth digit for an 18-digit body.

JavaScript18 digits → 1 digit
function iccidCheckDigit(body) {
  if (!/^\d{18}$/.test(body)) {
    throw new TypeError("Use an 18-digit string");
  }

  let sum = 0;
  let shouldDouble = true;
  for (let index = body.length - 1; index >= 0; index -= 1) {
    let digit = Number(body[index]);
    if (shouldDouble) {
      digit *= 2;
      if (digit > 9) digit -= 9;
    }
    sum += digit;
    shouldDouble = !shouldDouble;
  }
  return String((10 - (sum % 10)) % 10);
}
Python18 digits → 1 digit
def iccid_check_digit(body: str) -> str:
    if len(body) != 18 or not body.isdigit():
        raise ValueError("Use an 18-digit string")

    total = 0
    for offset, char in enumerate(reversed(body)):
        digit = int(char)
        if offset % 2 == 0:
            digit *= 2
            if digit > 9:
                digit -= 9
        total += digit
    return str((10 - total % 10) % 10)
18-digit body Expected digit Complete 19-digit value
89101123456789012388910112345678901238
89441234567890123488944123456789012348
89491234000000000128949123400000000012
89000000000000000038900000000000000003

Implementation rule: keep ICCIDs as strings, not integers or floating-point values. String storage preserves every digit and avoids JavaScript's unsafe-integer range for 19-digit identifiers.

Primary reference

ITU numbering model.

The current ITU-T E.118 recommendation defines a 19-digit PAN for ICCID numbering and requires the telecommunications major industry identifier 89. This calculator exposes the Luhn calculation separately: a checksum pass without 89 is valid math, not a conformant ICCID.

FAQ / 04

ICCID checksum questions

Clear answers about input length, the Luhn method, telecom prefixes, validation limits, and privacy.

How is an ICCID check digit calculated?

Starting at the rightmost digit of the 18-digit body, double every other digit, subtract 9 from products above 9, and add the contributions. The check digit makes the final total divisible by 10.

What does a valid ICCID Luhn result prove?

It confirms that the digits satisfy the checksum formula. It does not prove that a SIM exists, is active, belongs to a carrier, or can access a network.

Should I enter 18 or 19 digits?

Enter 18 digits when you want the calculator to generate the final check digit. Enter a complete 19-digit value when you want to validate its supplied final digit.

Why does an ICCID usually start with 89?

The major industry identifier 89 is assigned for telecommunication purposes. The calculator still shows the checksum for other digit strings but flags the missing telecom prefix.

Is the ICCID uploaded or saved?

The ICCID calculator module normalizes input, calculates checksums, copies results, and creates JSON in the browser without sending the identifier to this site's processing server. The page still loads site files and Google advertising and consent services; see the methodology page for the exact boundary.