CodeCraft — free QR code and barcode tools

Enter your digits

Full number
–
Make the barcode

How the check digit is worked out

The last digit of a barcode number is not chosen. It is calculated from all the others.

Every EAN, UPC, GTIN and SSCC number ends in a check digit. Its only job is to let a scanner notice when a number has been misread or mistyped, so a wrong product never gets rung up. All of these formats use the same GS1 method.

The method, in four steps

1. Write the digits

Take the number without its check digit. For EAN-13 that is the first 12 digits.

2. Weight from the right

Starting at the right-hand end, multiply the digits alternately by 3, 1, 3, 1 and so on.

3. Add them up

Add every product together to get a single total.

4. Round up to ten

The check digit is how much you need to add to reach the next multiple of 10. If the total already is one, it is 0.

A worked example

Take 590123412345. Working from the right, the weights are 3, 1, 3, 1 and so on, which gives the products 15, 4, 9, 2, 3, 4, 9, 2, 3, 0, 27 and 5. They add up to 83. The next multiple of 10 is 90, so the check digit is 7 and the full number is 5901234123457. The table under the result shows the same working for whatever you type.

Which formats does it cover?

FormatTotal digitsTypical use
EAN-1313Retail products outside North America, books (ISBN-13)
UPC-A12Retail products in the USA and Canada
EAN-88Very small packs where 13 digits will not fit
GTIN-1414Outer cartons and cases holding several packs
SSCC-1818Pallets and logistics units

ISBN-13 book numbers are EAN-13 numbers starting 978 or 979, so they work here too. The older 10-digit ISBN uses a different method and is not covered.

What a check digit can and cannot catch

  • It catches every single wrong digit. Change any one digit and the check digit no longer fits.
  • It catches most swapped neighbours. The exception is two adjacent digits that differ by exactly 5, such as 2 and 7, which can be swapped without changing the result.
  • It does not prove ownership. A number with a correct check digit is only internally consistent. Retail numbers must still be licensed from GS1 before a shop will accept them.

Calculating versus verifying. Type one digit fewer than the full length to calculate the check digit. Type the full number to verify it. If it is wrong, the tool tells you what the last digit should have been.

Once the number is right, turn it into bars with the barcode generator, or make a whole list at once with the bulk generator.

Frequently asked questions

How do I calculate the EAN-13 check digit?

Choose EAN-13, then type the first 12 digits. The check digit appears straight away, highlighted at the end of the full number, along with the working so you can follow each step.

How do I check whether a barcode number is valid?

Choose the matching format and type the whole number, including its last digit. The tool recalculates the check digit from the others. If it matches you see a tick, and if not it shows what the last digit should have been.

Is UPC-A calculated differently from EAN-13?

No. The method is identical. A UPC-A number is simply an EAN-13 number with a zero in front, so the same digits give the same check digit either way.

My number has spaces or hyphens in it. Is that a problem?

No. Spaces and hyphens are ignored, so you can paste a number as it appears on a package. Any other character, such as a letter, is flagged.

Does a valid check digit mean the product is registered?

No. It only shows the digits agree with each other. To sell through shops you need a number licensed by GS1. This site draws the bars and checks the arithmetic, but it does not issue numbers.

Is anything I type sent to a server?

No. The sum is done in your browser and nothing leaves your device.