Home › Developer Tools › Check Digit Calculator

Check Digit Calculator

Pick a standard, type the code and get its check digit, or paste a full code to see whether it is valid. The weighted sum is laid out digit by digit, and related forms (GTIN-14, EAN-13, ISBN-10 or ISBN-13) are shown too.

Last updated:

Enter the code without its check digit to calculate it, or the full code to validate it.

Enter your values to see the result.
Advertisement
Advertisement

How to use the Check Digit Calculator

  1. Choose the standard, for example UPC-A or ISBN-10.
  2. Enter the code without its check digit to calculate it, or in full to validate it.
  3. Click Calculate (results also update as you type).
  4. Read the check digit or verdict and the converted forms.
  5. Follow the weighted sum in the table if you want to check the maths by hand.

Check digit rules at a glance

StandardLengthWeightsCheck digitExample
UPC-A123, 1 from the right(10 − sum mod 10) mod 10036000291452
EAN-13 / GTIN-13133, 1 from the right(10 − sum mod 10) mod 104006381333931
EAN-883, 1 from the right(10 − sum mod 10) mod 1096385074
GTIN-14 / ITF-14143, 1 from the right(10 − sum mod 10) mod 1010012345000017
SSCC183, 1 from the right(10 − sum mod 10) mod 10shipping container code
ISBN-13131, 3 from the left(10 − sum mod 10) mod 109780306406157
ISBN-101010, 9 … 2(11 − sum mod 11) mod 11, 10 = X0306406152
ISSN88, 7 … 2(11 − sum mod 11) mod 11, 10 = X0317-8471
Mod 11 (2–7)any2, 3, 4, 5, 6, 7 from the right, repeating(11 − sum mod 11) mod 11123455

Worked example: UPC-A 03600029145

From the right: 5×3 + 4×1 + 1×3 + 9×1 + 2×3 + 0×1 + 0×3 + 0×1 + 6×3 + 3×1 + 0×3 = 15 + 4 + 3 + 9 + 6 + 0 + 0 + 0 + 18 + 3 + 0 = 58. The next multiple of 10 is 60, so the check digit is 2 and the full UPC is 036000291452.

Tips

  • Counting weights from the right means the same rule works for every GS1 length: the digit next to the check digit always gets weight 3.
  • An ISBN-13 is just an EAN-13 with a 978 or 979 prefix. An ISSN becomes a 977 EAN-13 barcode with a two-digit issue code before the new check digit.
  • For card numbers and IMEIs, which use the Luhn algorithm, use the Luhn Algorithm Checker.

Frequently asked questions

How is a UPC or EAN check digit calculated?

Starting from the digit next to the check digit and moving left, multiply the digits alternately by 3 and 1, then add the products. The check digit is the amount needed to reach the next multiple of 10: (10 − sum mod 10) mod 10. For the UPC 03600029145 the sum is 58, so the check digit is 2.

Is the GTIN check digit the same for UPC, EAN and GTIN-14?

Yes. All GS1 identifiers use the same mod 10 rule with weights 3 and 1 counted from the right. That is why you can pad a UPC-A or EAN-13 with leading zeros to 14 digits and the check digit stays the same.

Why does an ISBN-10 sometimes end in X?

ISBN-10 uses mod 11, so the check value can be 0 to 10. A single character is needed for 10, and the Roman numeral X is used. ISSN uses the same idea.

How do I convert a UPC-A to EAN-13?

Put a 0 in front. The 13-digit code has the same check digit because the leading zero adds nothing to the weighted sum.

What does a check digit protect against?

It catches typing and scanning mistakes. The GS1 rule catches all single-digit errors and most swaps of neighbouring digits; mod 11 schemes like ISBN-10 catch all single errors and all adjacent swaps.

Does a valid check digit mean the product or book exists?

No. It only shows the number is internally consistent. Barcode numbers must still be licensed from GS1, and ISBNs and ISSNs are assigned by their national agencies.

Can I calculate other schemes?

Yes. Choose Custom weights to enter any weight pattern (such as 7, 3, 1), the direction they are applied, the modulus and whether the check is the remainder or its complement.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Luhn Algorithm CheckerValidate numbers with the Luhn mod 10 check or calculate the missing check digit, step by step.ISBN Converter & ValidatorConvert ISBN-10 to ISBN-13 and back, validate check digits and hyphenate, one or in bulk.Barcode GeneratorCreate Code 128, EAN-13, UPC-A, EAN-8, Code 39 and ITF-14 barcodes as PNG or SVG.Checksum CalculatorCompute 8-bit sum, two's complement LRC, XOR/BCC, NMEA, Fletcher and Internet checksums of bytes.JSON FormatterBeautify, minify and validate JSON, with a collapsible tree view.SQL Formatter & BeautifierFormat, beautify or minify SQL queries for MySQL, PostgreSQL and more.JavaScript BeautifierFormat and beautify messy or minified JavaScript, or minify it.HTML FormatterBeautify and indent HTML code with a live preview.CSS FormatterBeautify CSS with indent controls and optional property sorting.XML FormatterBeautify, validate and minify XML with a collapsible tree view.ZIP File CreatorCompress files and folders into a ZIP.YAML Validator & FormatterValidate, format and minify YAML, and convert YAML to JSON or back.HTML MinifierMinify HTML: strip comments and whitespace safely and see how many bytes you save.CSS MinifierMinify CSS with csso or a built-in engine and see the size saved instantly.JavaScript MinifierMinify JavaScript with Terser: compress, mangle and see how many bytes you save.JSON MinifierMinify and validate JSON, sort keys and see exactly how many bytes you save.Code Diff CheckerCompare two code files side by side or unified, with syntax colors and changes highlighted.IPv6 Expander & CompressorExpand IPv6 addresses to full form or compress them per RFC 5952, one or many at once.GraphQL FormatterPretty-print and indent GraphQL queries, mutations and schemas, or minify them, instantly.CSS ValidatorValidate CSS: syntax errors, unknown properties and invalid values by line, plus auto-fix.Gzip Compress / DecompressGzip or deflate text and files, get Base64 output, and decompress Base64 or .gz files.IBAN ValidatorCheck an IBAN's mod-97 checksum, country and length, and see its bank code and account parts.JavaScript Syntax CheckerCheck JavaScript for syntax errors with line and column, for any ES version, script or module.JSON Schema ValidatorValidate JSON against a JSON Schema (draft-07, 2019-09, 2020-12) with clickable error paths.Markdown FormatterBeautify Markdown with Prettier: list markers, prose wrap, aligned tables and live preview.PHP FormatterBeautify PHP code with Prettier PHP: PSR-12 style, indent and brace options, syntax errors.TypeScript FormatterFormat TypeScript and TSX code with Prettier: width, tabs, semicolons and quotes options.XML MinifierMinify and validate XML: strip whitespace and comments, keep CDATA, see the size savings.C# FormatterBeautify C# code online: Allman or K&R braces, indent size and line width, clang-format option.HTML ValidatorCheck HTML for errors and warnings with line numbers, locally or with the W3C Nu checker.Java FormatterBeautify Java code online: indent size, brace style and line width, with clang-format option.JavaScript ObfuscatorObfuscate JavaScript with string encoding, renaming and control-flow flattening presets.Phone Number FormatterFormat and validate lists of phone numbers to E.164, international or national style.Python FormatterFormat Python code in Black/Ruff style: line length, quote style, indent, copy or download.Responsive Design CheckerPreview any website at phone, tablet, laptop and desktop sizes side by side, with rotate and zoom.Browser Compatibility CheckerSearch CSS, JavaScript and HTML features and see which browser versions support them.Core Web Vitals CheckerCheck real-user LCP, INP and CLS for any URL or site and see if it passes Core Web Vitals.Heading Structure CheckerPaste HTML to see its H1-H6 outline and catch missing H1s, multiple H1s and skipped levels.Strftime Format BuilderBuild Python and C strftime format strings by clicking tokens, with a live preview and reference.Website Hosting CheckerFind out who hosts a website: hosting provider, IP addresses, ASN, network owner and location.Routing Number ValidatorCheck a US ABA routing number's checksum and format and see its Federal Reserve district.Spam Word CheckerScan an email subject and body for spam trigger words, excess caps, exclamation marks and risky links.XSD ValidatorValidate XML against an XSD schema in your browser and see each error with its line number.
See all 41 Code Formatters & Validators →