Skip to content
gohacks.dev
Tooling

Check Digit Calculator

Validate or compute check digits for card numbers and IMEIs (Luhn), EAN-13, EAN-8, UPC-A and GTIN-14 barcodes, and ISBN-10 and ISBN-13, with ISBN conversion.

Free · No sign-up · Your inputs stay in your browser

Input

Validate and compute check digits (Luhn, EAN, ISBN)

Output

5 of 5 valid

InputTypeResultAlso
4539 1488 0343 6467Luhn (card, IMEI, SIN)validCheck digit for 4539148803436467 itself: 8
978-0-596-52068-7ISBN-13 / EAN-13validISBN-10: 0596520689
0-596-52068-9ISBN-10validISBN-13: 9780596520687
4006381333931GTIN-13 (EAN-13)valid-
490154203237518Luhn (IMEI or card)validCheck digit for 490154203237518 itself: 3

Luhn (mod 10) protects card numbers and IMEIs; GTIN weights digits 3,1,3,1 from the right and covers EAN, UPC and ISBN-13; ISBN-10 uses weights 10 down to 2 with X for 10. A check digit catches typos, not fraud: a valid Luhn number says nothing about whether the card exists. Use your payment provider's published test numbers for test payments.

Runs in this browser. Nothing you paste is sent to a server.

What a check digit catches

Check digits detect typing errors: every single wrong digit and most swaps of two adjacent digits. They prove nothing about whether a card, product or book exists. Validate format early in a form to catch typos, and leave real validation to the payment provider or the catalogue.

Test card numbers

Payment providers publish test numbers that pass Luhn and work only in test mode, such as Stripe's 4242 4242 4242 4242. Use those rather than generating numbers that might belong to someone. The GTIN algorithm is documented by GS1.

Share

Frequently asked questions

How does the Luhn algorithm work?
Starting from the right, double every second digit, subtract 9 from any result above 9, and add everything up. The number is valid if the total is a multiple of 10.
How do I convert ISBN-10 to ISBN-13?
Prefix 978, drop the old check digit and compute a new one with the EAN weights. The tool does this for every valid ISBN-10.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools