A useful first step. No signup.

GTIN, UPC and EAN Check Digit Calculator

Paste up to 5,000 barcodes to check them all at once, or add the check digit to base numbers. It also finds the damage spreadsheets do to product codes.

Free to useNo email requiredYour entries stay in this page

Check your barcodes

Example codes are shown. Paste up to 5,000. Nothing leaves your browser.

How the check digit works

The last digit of a GTIN, UPC or EAN is worked out from the others, so a scanner can spot a misread. Every format uses the same steps:

  1. Starting from the right of the number without its check digit, multiply the digits by 3, 1, 3, 1 and so on.
  2. Add the results.
  3. The check digit is whatever brings that total up to the next multiple of 10.

A worked example

Take the first twelve digits of an EAN-13: 590123412345.

  1. From the right, the digits 5, 3, 1, 3, 1, 9 are multiplied by 3, giving 15, 9, 3, 9, 3 and 27, a total of 66.
  2. The digits 4, 2, 4, 2, 0, 5 are multiplied by 1, a total of 17.
  3. 66 + 17 = 83, and the next multiple of 10 is 90, so the check digit is 7.

The full code is 5901234123457. Because the multipliers start from the right, leading zeros don't change the result. That is why a UPC and its 13-digit form share a check digit.

What spreadsheets do to barcodes

Most broken barcodes in a product file were correct before someone opened it in a spreadsheet. A column formatted as numbers does two kinds of damage:

  • Leading zeros disappear. The UPC 012345678905 becomes 12345678905. This tool notices when an 11-digit code becomes valid with its zero back, and shows you the repaired code.
  • Long codes turn into scientific notation. 5901234123457 becomes 5.90123E+12. If the file was saved like that, the last digits are gone, so you need to go back to the original source.

To avoid both, format the column as text before you paste codes into it.

Using these codes in WooCommerce

Since version 9.2, WooCommerce has a "GTIN, UPC, EAN, or ISBN" field on products and variations. The behaviour below was tested by importing files through the WooCommerce 11.2.1 importer:

  • It doesn't test the check digit. A mistyped code saves without a warning, so it's worth checking your list first.
  • It rejects a code that's already in use, but it compares the text. 012345678905 and 0012345678905 are the same product code, yet both are accepted. This tool flags them as duplicates.
  • The import screen doesn't always map the column for you. Our product CSV checker tells you when you need to choose it by hand.

Store the code in the same form that your scanner reads it. A lookup that compares text won't match 12345678905 to a scan of 012345678905.

A valid check digit doesn't make a code yours

This tool tests the arithmetic. It can't tell you whether a code has been assigned, or to whom. To sell on marketplaces or through retailers, get your codes from GS1 or use the ones your supplier printed on the product. For items that only ever move inside your own shop, a SKU is usually enough.

Some prefixes are reserved. Codes starting with 200 to 299 or 020 to 029 are restricted-circulation numbers, used for things like items weighed in store, so they shouldn't identify a product on the open market. The tool flags those, along with book, periodical and coupon prefixes.

Frequently asked questions

How do you calculate a check digit?

Starting from the right of the number without its check digit, multiply the digits by 3, 1, 3, 1 and so on, then add the results. The check digit is whatever brings the total up to the next multiple of 10. All GTIN formats use this method.

What is the difference between GTIN, UPC and EAN?

GTIN is the family name. A UPC-A is a GTIN-12, an EAN-13 is a GTIN-13, an EAN-8 is a GTIN-8, and a GTIN-14 is used for cases and cartons. A UPC with a zero added to the front is the same product code as an EAN-13.

Why did my barcode lose its first digit?

A spreadsheet treated the column as numbers and removed the leading zero. Paste the code here: if it becomes valid with the zero back, the tool shows the repaired code. To prevent it, format the column as text before pasting.

How do I fix a barcode that shows as 5.90123E+12?

A spreadsheet converted it to scientific notation. If the file was saved like that, the last digits have been replaced with zeros and can't be recovered, so go back to the original source and format the column as text.

Does a valid check digit mean a barcode is real?

No. It shows that the arithmetic is right, not that the code has been assigned or whose it is. For marketplaces and retailers, get codes from GS1 or use the ones your supplier printed on the product.

Does WooCommerce check the GTIN check digit?

No. When we tested the WooCommerce 11.2.1 importer, it saved a code with a wrong check digit without a warning. It does reject a code already used by another product, but it compares the text, so the same code with an extra leading zero gets through.

Take the next step

Put your barcodes to work in a stock count.

Stocktake matches scanned barcodes against your SKUs and WooCommerce's GTIN field, using a scanner gun or a phone camera (in beta). Review the differences, then apply them with a backup and one-click undo.

Explore Free and Pro →Read the step-by-step guide

More free tools

Free browser tool

Inventory count sheet

Open a WooCommerce stock CSV, count products in a browser worksheet, or download a printable inventory count sheet PDF. Review differences and export your count record.

Open tool →
Free browser tool

EOQ calculator

Find the cheapest order size, rounded to your pack size and supplier minimum, and compare it with what you order now.

Open tool →
Free browser tool

SKU generator

Turn product names and attributes into readable, unique SKUs, with a list or a WooCommerce import file to download.

Open tool →