The main barcode types at a glance

TypeDataCheck digitTypical use
EAN-1313 digitsYes (mod 10)Retail products worldwide; books (ISBN starting 978/979)
EAN-88 digitsYes (mod 10)Very small retail packages
UPC-A12 digitsYes (mod 10)Retail products in the US and Canada
Code 128Any ASCII textYes (mod 103, hidden)Logistics, shipping labels, inventory, internal IDs
Code 39Digits, A–Z, a few symbolsOptionalIndustry, badges, older systems
ITF-1414 digitsYes (mod 10)Outer shipping cartons

EAN-13 and UPC-A: retail product codes

These are the codes on almost everything you buy. Both carry a GTIN (Global Trade Item Number) issued through GS1, the organisation that manages retail numbering. An EAN-13 is made of:

UPC-A is the 12-digit North American version. Put a 0 in front of a UPC-A number and you get the equivalent EAN-13, which is why modern checkout scanners handle both.

How to calculate the check digit (worked example)

Take the EAN-13 4006381333931. Check the first 12 digits:

Digit400638133393
Weight131313131313
Product40018324193999
  1. Sum of products: 4 + 0 + 0 + 18 + 3 + 24 + 1 + 9 + 3 + 9 + 9 + 9 = 89.
  2. Remainder after dividing by 10: 89 mod 10 = 9.
  3. Check digit = (10 − 9) mod 10 = 1. It matches the last digit, so the code is valid.

UPC-A uses the same idea with weights 3, 1, 3, 1… from the left. For 03600029145: digits in odd positions 0+6+0+2+1+5 = 14, × 3 = 42; even positions 3+0+0+9+4 = 16; total 58, so the check digit is 2 → 036000291452. The general rule for all GTINs (EAN-8, UPC-A, EAN-13, ITF-14): starting from the rightmost data digit, weight alternately 3 and 1.

Our barcode generator does this automatically: enter the number without the last digit and it is added, or enter the full number and it is validated.

Code 128: for everything that is not a retail product

Code 128 can encode any ASCII text — letters, digits and punctuation — and is very compact, especially for long runs of digits. It has a built-in check character (modulo 103) that scanners verify; it is not shown in the human-readable text. Use it for warehouse locations, internal SKUs, asset tags, document numbers and shipping labels. The GS1-128 variant adds standard “application identifiers” for batch numbers, expiry dates and weights in supply chains.

Code 39 and ITF-14

Printing tips

Need a 2D code instead — for a URL or Wi-Fi details? Use the QR code generator.

▥ Create EAN-13, UPC-A, Code 128, Code 39 or ITF-14 with automatic check digits — PNG or SVG:
Open the barcode generator→

Frequently asked questions

What is the difference between EAN-13 and UPC-A?

UPC-A has 12 digits and comes from North America; EAN-13 has 13 digits and is used worldwide. A UPC-A number is the same as an EAN-13 with a leading zero, and retail scanners read both.

Which barcode should I use for products sold in stores?

EAN-13 (or UPC-A in the US and Canada) with a number issued under your own GS1 company prefix. Retailers and marketplaces check that the number really belongs to your company.

Can I make up my own EAN numbers?

For internal use such as stock labels, you can — but Code 128 with your own codes is a better fit. For products sold through retailers or marketplaces you need numbers from GS1; invented ones can clash with real products and get listings rejected.

How is the EAN-13 check digit calculated?

Multiply the first 12 digits alternately by 1 and 3 (starting with 1), add the results, and take the number that brings the sum up to the next multiple of 10. For 400638133393 the sum is 89, so the check digit is 1.

What barcode can store letters?

Code 128 encodes all 128 ASCII characters (letters, digits, punctuation) and is compact. Code 39 supports uppercase letters, digits and a few symbols but produces wider codes.