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?
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
- Sum of the products: 93.
- Check digit = (10 − 93 mod 10) mod 10 = 7.
- The last digit you entered is 7: it matches.
| Position | Digit | Weight | Product |
|---|---|---|---|
| 1 | 9 | 1 | 9 |
| 2 | 7 | 3 | 21 |
| 3 | 8 | 1 | 8 |
| 4 | 0 | 3 | 0 |
| 5 | 3 | 1 | 3 |
| 6 | 0 | 3 | 0 |
| 7 | 6 | 1 | 6 |
| 8 | 4 | 3 | 12 |
| 9 | 0 | 1 | 0 |
| 10 | 6 | 3 | 18 |
| 11 | 1 | 1 | 1 |
| 12 | 5 | 3 | 15 |
- 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
| Type | Length | Algorithm | Example | Check digit(s) |
|---|---|---|---|---|
| Luhn (card numbers, IMEI) | 2 to 40 digits | Luhn, modulo 10 (ISO/IEC 7812-1) | 79927398713 | 3 |
| ISBN-13 | 13 | ISBN-13, GS1 modulo 10 | 9780306406157 | 7 |
| ISBN-10 | 10 | ISBN-10, modulo 11 | 0306406152 | 2 |
| UPC-A | 12 | GS1 modulo 10 | 036000291452 | 2 |
| EAN-8 | 8 | GS1 modulo 10 | 73513537 | 7 |
| EAN-13 | 13 | GS1 modulo 10 | 4006381333931 | 1 |
| GTIN-14 | 14 | GS1 modulo 10 | 14006381333938 | 8 |
| IBAN | 15 to 31 characters, by country | ISO 13616 IBAN, ISO 7064 MOD 97-10 | DE89370400440532013000 | 89 |
| Verhoeff | 2 to 40 digits | Verhoeff, dihedral group D5 | 2363 | 3 |
| Damm | 2 to 40 digits | Damm, totally anti-symmetric quasigroup | 5724 | 4 |
Worked example: the check digit of 9780306406157
| Position | Digit | Weight | Product |
|---|---|---|---|
| 1 | 9 | 1 | 9 |
| 2 | 7 | 3 | 21 |
| 3 | 8 | 1 | 8 |
| 4 | 0 | 3 | 0 |
| 5 | 3 | 1 | 3 |
| 6 | 0 | 3 | 0 |
| 7 | 6 | 1 | 6 |
| 8 | 4 | 3 | 12 |
| 9 | 0 | 1 | 0 |
| 10 | 6 | 3 | 18 |
| 11 | 1 | 1 | 1 |
| 12 | 5 | 3 | 15 |
Worked example: the ISBN-10 check digit of 0306406152
| Position | Digit | Weight | Product |
|---|---|---|---|
| 1 | 0 | 10 | 0 |
| 2 | 3 | 9 | 27 |
| 3 | 0 | 8 | 0 |
| 4 | 6 | 7 | 42 |
| 5 | 4 | 6 | 24 |
| 6 | 0 | 5 | 0 |
| 7 | 6 | 4 | 24 |
| 8 | 1 | 3 | 3 |
| 9 | 5 | 2 | 10 |
Worked example: Luhn on 79927398713
| Position | Digit | Doubled | Counts as |
|---|---|---|---|
| 1 | 7 | No | 7 |
| 2 | 9 | 9 × 2 = 18 | 9 |
| 3 | 9 | No | 9 |
| 4 | 2 | 2 × 2 | 4 |
| 5 | 7 | No | 7 |
| 6 | 3 | 3 × 2 | 6 |
| 7 | 9 | No | 9 |
| 8 | 8 | 8 × 2 = 16 | 7 |
| 9 | 7 | No | 7 |
| 10 | 1 | 1 × 2 | 2 |
Worked example: the IBAN DE89 check digits
| Step | Digits taken | Remainder mod 97 |
|---|---|---|
| 1 | 370400440 | 23 |
| 2 | 235320130 | 70 |
| 3 | 700013140 | 30 |
| 4 | 300 | 9 |
IBAN length by country (40 countries)
| Country | Code | IBAN length | Account part (BBAN) length |
|---|---|---|---|
| United Arab Emirates | AE | 23 | 19 |
| Austria | AT | 20 | 16 |
| Belgium | BE | 16 | 12 |
| Bulgaria | BG | 22 | 18 |
| Switzerland | CH | 21 | 17 |
| Cyprus | CY | 28 | 24 |
| Czech Republic | CZ | 24 | 20 |
| Germany | DE | 22 | 18 |
| Denmark | DK | 18 | 14 |
| Estonia | EE | 20 | 16 |
| Spain | ES | 24 | 20 |
| Finland | FI | 18 | 14 |
| France | FR | 27 | 23 |
| United Kingdom | GB | 22 | 18 |
| Greece | GR | 27 | 23 |
| Croatia | HR | 21 | 17 |
| Hungary | HU | 28 | 24 |
| Ireland | IE | 22 | 18 |
| Israel | IL | 23 | 19 |
| Iceland | IS | 26 | 22 |
| Italy | IT | 27 | 23 |
| Liechtenstein | LI | 21 | 17 |
| Lithuania | LT | 20 | 16 |
| Luxembourg | LU | 20 | 16 |
| Latvia | LV | 21 | 17 |
| Monaco | MC | 27 | 23 |
| Malta | MT | 31 | 27 |
| Netherlands | NL | 18 | 14 |
| Norway | NO | 15 | 11 |
| Poland | PL | 28 | 24 |
| Portugal | PT | 25 | 21 |
| Qatar | QA | 29 | 25 |
| Romania | RO | 24 | 20 |
| Serbia | RS | 22 | 18 |
| Saudi Arabia | SA | 24 | 20 |
| Sweden | SE | 24 | 20 |
| Slovenia | SI | 19 | 15 |
| Slovakia | SK | 24 | 20 |
| Türkiye | TR | 26 | 22 |
| Ukraine | UA | 29 | 25 |
Damm table
| Row \ digit | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 3 | 1 | 7 | 5 | 9 | 8 | 6 | 4 | 2 |
| 1 | 7 | 0 | 9 | 2 | 1 | 5 | 4 | 8 | 6 | 3 |
| 2 | 4 | 2 | 0 | 6 | 8 | 7 | 1 | 3 | 5 | 9 |
| 3 | 1 | 7 | 5 | 0 | 9 | 8 | 3 | 4 | 2 | 6 |
| 4 | 6 | 1 | 2 | 3 | 0 | 4 | 5 | 9 | 7 | 8 |
| 5 | 3 | 6 | 7 | 4 | 2 | 0 | 9 | 5 | 8 | 1 |
| 6 | 5 | 8 | 6 | 9 | 7 | 2 | 0 | 1 | 3 | 4 |
| 7 | 8 | 9 | 4 | 5 | 3 | 6 | 2 | 0 | 1 | 7 |
| 8 | 9 | 4 | 3 | 8 | 6 | 1 | 7 | 2 | 0 | 5 |
| 9 | 2 | 5 | 8 | 1 | 4 | 3 | 6 | 7 | 9 | 0 |
How to calculate or validate a check digit
- 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.
- 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.
- 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.
- 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
- GS1 General Specifications (check digit calculation for GTIN-8, GTIN-12, GTIN-13 and GTIN-14)
- International ISBN Agency, ISBN Users' Manual and ISO 2108 (ISBN-10 and ISBN-13 check digits, 978 and 979 prefixes)
- SWIFT, IBAN Registry (ISO 13616: IBAN structure and length by country)
- ISO 13616-1 (IBAN) and ISO/IEC 7064:2003 (check character systems, MOD 97-10)
- Wikipedia, International Bank Account Number (country lengths and the documented DE89 example), and the EUIPO list of EU IBAN lengths
- H. P. Luhn, "Computer for verifying numbers", US patent 2,950,048 (1960); ISO/IEC 7812-1 (identification cards, which specifies the Luhn check)
- J. Verhoeff, "Error Detecting Decimal Codes", Mathematical Centre Tract 29, Mathematisch Centrum, Amsterdam, 1969
- H. M. Damm, "Totally anti-symmetric quasigroups for all orders n ≠ 2, 6", Discrete Mathematics 307 (2007) 715–729
More free tools
- Barcode GeneratorMake Code 128, EAN-13, UPC-A, EAN-8 and Code 39 barcodes with check digits and quiet zones. Download PNG or SVG at your size and DPI. Made on your device.
- Hash GeneratorHash text or a file with SHA-256, SHA-1, SHA-384, SHA-512, MD5 and CRC32, add an HMAC key, and check a checksum. Runs in your browser; nothing is uploaded.
- UUID GeneratorGenerate random v4 and time-ordered v7 UUIDs on your device, up to 1,000 at a time, and inspect any UUID for its version, variant and embedded timestamp.
- Number Base ConverterConvert whole numbers between binary, octal, decimal, hex and any base from 2 to 36, up to 5,000 digits, with grouped digits and a two’s-complement view.
- Random Number GeneratorPick a random number between any two numbers, draw several with or without repeats, flip a coin or roll dice. Fair, unbiased and drawn on your device.
- Sort Lines AlphabeticallySort text lines A to Z, Z to A, naturally (file2 before file10), by number or length, or shuffle them. Handles big lists and stays in your browser.