Skip to main content
ponderloop

Check Digit Calculator and Validator

Pick the kind of number, type it, and the tool says whether its check digit is right or works the digit out, with the arithmetic shown line by line and nothing uploaded. The example 9780306406157 is an ISBN-13: the 12 digits 978030640615 weighted 1 and 3 add up to 93, so the check digit is (10 − 93 mod 10) mod 10 = 7, and the number is valid. It covers Luhn (card numbers and IMEI), ISBN-10 and ISBN-13 with conversion between them, UPC-A, EAN-8, EAN-13 and GTIN-14, IBAN for 40 countries, and the Verhoeff and Damm algorithms. A valid check digit only shows a number is well formed: it does not show that a card, account or product exists.

Updated Runs in your browser: nothing you enter is uploadedHow this tool works

Which number?

13 digits including the check digit (it starts with 978 or 979). Spaces and hyphens are ignored.

What to do

Made on your device: nothing you type is uploaded, saved or put in the address of this page. This tool checks and completes numbers you enter; it does not make up card numbers.

Result

Valid Valid: the check digit 7 is correct.

Number
9780306406157
Check digit
7 (correct)
Algorithm
ISBN-13, GS1 modulo 10

Step-by-step working

  1. Sum of the products: 93.
  2. Check digit = (10 − 93 mod 10) mod 10 = 7.
  3. The last digit you entered is 7: it matches.
PositionDigitWeightProduct
1919
27321
3818
4030
5313
6030
7616
84312
9010
106318
11111
125315
  • The ISBN-13 check digit is the same GS1 modulo 10 digit as an EAN-13: an ISBN-13 is an EAN-13 for a book.
  • A valid check digit only shows the number is well formed, so a typing slip would be caught. It does not mean a card, account, book, product or phone exists, or that anyone issued it.

The number types and an example of each

Examples are public documentation or test numbers, shown with the check digit the tool works out for them. For IBAN the check digits are the two after the country code.
TypeLengthAlgorithmExampleCheck digit(s)
Luhn (card numbers, IMEI)2 to 40 digitsLuhn, modulo 10 (ISO/IEC 7812-1)799273987133
ISBN-1313ISBN-13, GS1 modulo 1097803064061577
ISBN-1010ISBN-10, modulo 1103064061522
UPC-A12GS1 modulo 100360002914522
EAN-88GS1 modulo 10735135377
EAN-1313GS1 modulo 1040063813339311
GTIN-1414GS1 modulo 10140063813339388
IBAN15 to 31 characters, by countryISO 13616 IBAN, ISO 7064 MOD 97-10DE8937040044053201300089
Verhoeff2 to 40 digitsVerhoeff, dihedral group D523633
Damm2 to 40 digitsDamm, totally anti-symmetric quasigroup57244

Worked example: the check digit of 9780306406157

GS1 modulo 10, also used by ISBN-13, EAN-13, UPC-A, EAN-8 and GTIN-14: weights 3 and 1 from the right, so for a 12-digit body the first digit has weight 1. The sum is 93 and the check digit is (10 − 93 mod 10) mod 10 = 7.
PositionDigitWeightProduct
1919
27321
3818
4030
5313
6030
7616
84312
9010
106318
11111
125315

Worked example: the ISBN-10 check digit of 0306406152

ISBN-10 weights its nine digits 10 down to 2 and adds. Sum of the products: 130. Check value = (11 − 130 mod 11) mod 11 = 2. The same book as an ISBN-13 is 9780306406157.
PositionDigitWeightProduct
10100
23927
3080
46742
54624
6050
76424
8133
95210

Worked example: Luhn on 79927398713

From the digit next to the check digit, every second digit is doubled (9 is taken off a result above 9). Sum of the counted values: 67. Check digit = (10 − 67 mod 10) mod 10 = 3. This is the example used in the Luhn algorithm's documentation, not a card number.
PositionDigitDoubledCounts as
17No7
299 × 2 = 189
39No9
422 × 24
57No7
633 × 26
79No9
888 × 2 = 167
97No7
1011 × 22

Worked example: the IBAN DE89 check digits

For the documented German example DE89 3704 0044 0532 0130 00, the account part 370400440532013000 is followed by DE00, letters become numbers (D = 13, E = 14) and the number 370400440532013000131400 is reduced mod 97 in pieces of nine digits. The remainder is 9, so the check digits are 98 − 9 = 89.
StepDigits takenRemainder mod 97
137040044023
223532013070
370001314030
43009

IBAN length by country (40 countries)

The IBAN is 15 to 34 characters; each country has one fixed length. In this table Norway is the shortest at 15 and Malta the longest at 31. The tool checks this length and the modulo 97 check, not a country's own bank and account rules. Lengths follow the SWIFT IBAN Registry as summarised in the sources below.
CountryCodeIBAN lengthAccount part (BBAN) length
United Arab EmiratesAE2319
AustriaAT2016
BelgiumBE1612
BulgariaBG2218
SwitzerlandCH2117
CyprusCY2824
Czech RepublicCZ2420
GermanyDE2218
DenmarkDK1814
EstoniaEE2016
SpainES2420
FinlandFI1814
FranceFR2723
United KingdomGB2218
GreeceGR2723
CroatiaHR2117
HungaryHU2824
IrelandIE2218
IsraelIL2319
IcelandIS2622
ItalyIT2723
LiechtensteinLI2117
LithuaniaLT2016
LuxembourgLU2016
LatviaLV2117
MonacoMC2723
MaltaMT3127
NetherlandsNL1814
NorwayNO1511
PolandPL2824
PortugalPT2521
QatarQA2925
RomaniaRO2420
SerbiaRS2218
Saudi ArabiaSA2420
SwedenSE2420
SloveniaSI1915
SlovakiaSK2420
TürkiyeTR2622
UkraineUA2925

Damm table

The Damm algorithm starts with an interim digit 0 and replaces it, for each digit, by the entry in that row and column. For 572 the interim digits are 9, 7, 4, so the check digit is 4 and the number 5724.
Row \ digit0123456789
00317598642
17092154863
24206871359
31750983426
46123045978
53674209581
65869720134
78945362017
89438617205
92581436790

How to calculate or validate a check digit

  1. Choose the number type. Pick Luhn, ISBN-13, ISBN-10, ISBN conversion, UPC-A, EAN-8, EAN-13, GTIN-14, IBAN, Verhoeff or Damm. The hint under the box says how many digits to type.
  2. Type the number. Spaces and hyphens are ignored, so you can paste 978-0-306-40615-7 as printed. With "Check a number" include the check digit; with "Calculate the check digit" leave it off.
  3. Read the result and the working. The result says valid or not valid, or gives the check digit, and shows the table of weights or steps. If the digit is wrong, the correct number is shown, and Copy puts it on the clipboard.
  4. Convert an ISBN if you need the other form. Choose ISBN-10 ↔ ISBN-13 conversion and enter either form: 0306406152 becomes 9780306406157, and 9780306406157 becomes 0306406152.

Frequently asked questions

Is my number sent anywhere?
No. The check digit is calculated by code running in your browser. The number is not uploaded, stored or put in the address of the page, and the only analytics event records that a check or calculation happened, never the number or its type.
Does a valid check digit mean the card, account or ISBN exists?
No. A valid check digit only shows the number is well formed, so a typing slip would be caught. It does not mean a card, account, book, product or phone exists, or that anyone issued it. Whether a card is open, an account is active or a book was published can only be confirmed with the issuer, the bank or a catalogue.
What is a check digit for?
It is a digit (or two, for an IBAN) calculated from the other digits, so that a typing slip or a misread digit usually makes the number fail the check. It protects against accidents, not against fraud: anyone can calculate a correct check digit.
Does this tool generate credit card numbers?
No. It checks and completes numbers you type, and the only examples are public documentation numbers such as an ISBN and the Luhn example from the algorithm's documentation. It does not produce card numbers for any issuer or random valid-looking numbers.
How is the check digit of an ISBN-13, EAN-13 or UPC-A calculated?
The digits are weighted 3 and 1 alternately starting from the digit next to the check digit, added, and the check digit is what brings the total to a multiple of 10. For 978030640615 the sum is 93 and the check digit 7. The tool uses the same function as the Barcode Generator for this digit.
How do I convert an ISBN-10 to an ISBN-13?
Put 978 in front of the first nine digits of the ISBN-10, drop its check digit and calculate a new GS1 check digit. 0306406152 becomes 9780306406157. Going back, drop 978 and the check digit and calculate an ISBN-10 check digit: 9780306406157 becomes 0306406152. ISBN-13s that start with 979 have no ISBN-10.
Why does an ISBN-10 sometimes end in X?
The ISBN-10 check value is calculated modulo 11, so it can be 0 to 10. Ten is written as the letter X, a Roman numeral. For 030640615 the check value is 2, so no X is needed here.
What does the tool tell me if the check digit I typed is wrong?
It shows the digit that is expected and the corrected number. For example 9780306406158 gives: Not valid: the check digit is 8, but it should be 7 (9780306406157).
How is an IBAN checked?
Move the first four characters (country code and check digits) to the end, replace each letter by a number (A = 10 to Z = 35) and divide the long number by 97. A valid IBAN leaves a remainder of 1. For DE89 3704 0044 0532 0130 00 the remainder is 1. The tool also checks that the length is right for the country, from a table of 40 countries (Norway 15 to Malta 31). It does not check each country's bank and account structure, and passing says nothing about whether the account exists.
Which check digit algorithm is the best?
Verhoeff and Damm are designed to catch every single wrong digit and every swap of neighbouring digits, which Luhn and the GS1 digit do not quite manage (Luhn misses 09 and 90 swapped, GS1 misses swaps of digits that differ by 5). But a scheme is chosen when a numbering system is created, so you use the one the system defines.

How it works

Each type has one function that takes the digits before the check digit and returns the check digit and the table behind it. Validation calculates the check digit from the digits you typed and compares it with the last one. Luhn doubles every second digit from the right of the body and sums the digits of the results (example 79927398713: check digit 3). The GS1 digit (UPC-A, EAN-8, EAN-13, GTIN-14, ISBN-13) is the function the Barcode Generator uses. ISBN-10 weights 10 to 2 modulo 11 with X for ten. IBAN rearranges the number, turns letters into 10 to 35 and takes the remainder mod 97 in pieces of nine digits (ISO 7064 MOD 97-10); the country table gives the required length. Verhoeff folds the digits, rightmost first, through eight position permutations and the multiplication table of the dihedral group D5; Damm uses one 10 by 10 table whose diagonal is zero. Everything runs in your browser. Anything the page quotes as an example is a public documentation number.

Sources

All text & filesAll toolsHome & DIY calculators