Barcode generator EAN-13, UPC-A and Code 128, with the check digit

A new box of goods arrives with no barcode, and the till cannot sell what it cannot scan. Type the codes, one per line. The generator draws each barcode, adds the missing check digit and gives you SVG files or a sheet to print.

1. The codes

2. The barcodes

The generator runs in your browser. Nothing you type is sent anywhere.

Three barcode types, and when each one fits

TypeWhat it holdsUse it for
EAN-1313 digits; the last one is the check digitRetail goods outside North America
UPC-A12 digits; the last one is the check digitRetail goods in the USA and Canada
Code 128Letters, digits and signs, any lengthYour own item codes, shelf and bin labels

A UPC-A is an EAN-13 that starts with 0, so a till that reads EAN-13 reads UPC-A too. In the automatic mode, the generator looks at each code: 13 digits with a correct check digit print as EAN-13, 12 such digits as UPC-A, and everything else as Code 128.

Worked example: the check digit of an EAN-13

A shop gets the number 400638133393 for a new product and needs the 13th digit. Each digit gets a weight: 1 in the odd places, 3 in the even places.

Place123456789101112
Digit400638133393
Weight131313131313
Product40018324193999

The products add up to 89. The next multiple of 10 is 90, so the check digit is 1, and the full code is 4006381333931.

If a digit is typed wrong, the sum changes and the check digit no longer fits. That is why the scanner refuses a damaged label instead of selling the wrong product. Choose EAN-13 above and type the 12 digits: the generator adds the 1 for you.

The check digit in Excel

Put the 12 digits as text in A2. Then the check digit is:

=MOD(10-MOD(SUMPRODUCT(--MID(A2,{1,3,5,7,9,11},1))+3*SUMPRODUCT(--MID(A2,{2,4,6,8,10,12},1)),10),10)

For a whole item list, put this in B2, fill it down, and join the two with =A2&B2. To give each item a code first, use the SKU generator.

Questions

Which barcode type should I use?

For goods that you sell in other shops, use the EAN-13 (or the UPC-A in North America) that your supplier or GS1 gave the product. For your own shelf labels, bins and items with letters in the code, use Code 128: it takes letters, digits and signs.

Can I make up my own EAN-13 numbers?

Not for goods that other shops sell: those numbers come from GS1, with your company prefix. For use inside your own shop, GS1 keeps the prefixes 20 to 29 for restricted circulation, so a code such as 2000000000015 does not clash with a product number.

How is the check digit calculated?

Take the first 12 digits. Add the digits in the odd places, add three times the digits in the even places, and take the total. The check digit is what brings the total up to the next multiple of 10. The worked example below does it step by step.

Why does my 12-digit number print as UPC-A?

In the automatic mode, a 12-digit number with a correct check digit is a UPC-A. If you want an EAN-13, choose EAN-13: the generator then adds the 13th digit.

What size should a printed barcode be?

Print it at the size of the SVG or larger, never squeezed. Keep the white space at both ends: the scanner needs it to find the start and the end of the code.

Will my scanner read these barcodes?

Yes, if it reads EAN-13, UPC-A and Code 128, as almost every scanner does. Print in black on white, test one label before you print a hundred.

Labels from your item list, not one by one

In Golden Inventory Web, a label sheet prints for the items you select: a valid 13-digit code prints as EAN-13, a 12-digit code as UPC-A, and any other item code as Code 128. The point of sale scans the same codes.

Rather keep it on your own Windows PC? Golden Inventory System 5 does stock, purchase orders and a till for $99, paid once.

Get System 5, $99 once Start with the demo