Skip to content
Generate now

EAN vs UPC Barcodes: Differences Explained Simply

Scan a cereal box in New York and a chocolate bar in Berlin and the checkout reads both without a hitch, even though one has 12 digits and the other 13. EAN and UPC barcodes are close relatives with a shared history and a shared check digit formula. Here is how the formats differ, what the leading digits really tell you, and how to work with barcode numbers in software and product data.

Options

Tip: press Enter or Space to generate again.

Ready

UPC-A, EAN-13 and EAN-8 side by side

  • UPC-A โ€” 12 digits, introduced in the United States in the 1970s and still common in North America.
  • EAN-13 โ€” 13 digits, created soon after as an international extension. It is now the most widely used retail barcode worldwide.
  • EAN-8 โ€” 8 digits, a compact version for small items such as gum or cosmetics where a full barcode will not fit.

The key relationship: a UPC-A number is simply an EAN-13 number with a leading 0. 036000291452 as UPC-A is 0036000291452 as EAN-13, and modern scanners treat them as the same product. In product data these are all forms of the GTIN, the Global Trade Item Number.

What the first digits mean โ€” and what they do not

The first two or three digits of an EAN-13 are a GS1 prefix. It shows which national GS1 organization issued the company number, not where the product was made. A product with a prefix from one country may well be manufactured elsewhere.

Some prefixes have special uses:

  • 978 and 979 โ€” books (ISBNs), sometimes called Bookland.
  • 977 โ€” magazines and other serial publications (ISSN).
  • 20โ€“29 โ€” reserved for in-store use, such as weighed produce or deli items labeled by the shop itself.

After the prefix comes the company number, then the item reference chosen by the company, then the check digit.


How the check digit is calculated

All three formats use the same rule. Starting from the rightmost data digit, multiply digits alternately by 3 and 1, add them up, and choose the check digit that brings the total to the next multiple of 10.

For the UPC-A data digits 03600029145:

  1. Digits in positions 1, 3, 5, 7, 9 and 11 (0, 6, 0, 2, 1, 5) add to 14; ร— 3 = 42.
  2. Digits in positions 2, 4, 6, 8 and 10 (3, 0, 0, 9, 4) add to 16.
  3. 42 + 16 = 58, so the check digit is 2, giving 036000291452.

Scanners use this check to reject misreads, which is why a creased label often simply fails to scan instead of ringing up the wrong item.

Creating test barcode numbers with RandNow

When you build a point-of-sale system, an inventory app or a product import, you need many valid numbers fast. The Random EAN Barcode Number Generator handles it:

  1. Choose the barcode type: EAN-13, UPC-A or EAN-8.
  2. Set how many numbers you want, up to 100 per click.
  3. Generate; every number ends in a correctly calculated check digit.
  4. Copy one number or the whole list, or export it as CSV, JSON or TXT.
  5. Paste numbers into a barcode font or library to render images for label and scanner tests.

The numbers are random and not registered to any company, so they are for test data, demos and mockups only โ€” not for products you sell.

Getting real barcodes for your products

Retailers and marketplaces expect GTINs that are licensed to your company. In most countries you obtain them by joining the local GS1 member organization, which assigns a company prefix from which you create your own item numbers. Each product variant โ€” size, color, pack quantity โ€” normally needs its own number, and you should keep a simple register so no number is ever used twice.

Barcodes beyond the checkout

EAN and UPC are one-dimensional barcodes: the information lies in the widths of the black bars and white spaces, read from left to right. They hold only the product number, and the price and description come from the shopโ€™s database. That is why a store can change a price without relabeling every item.

Other symbologies serve different jobs. Code 128 is common on shipping labels and can carry letters as well as digits, ITF-14 appears on outer cartons, and two-dimensional codes such as QR codes store far more data, including web addresses. When you design product data, keep the retail GTIN separate from internal codes like SKUs, which you can format however you like.

Pro tips

  • Store barcode numbers as text so leading zeros are never lost.
  • Normalize UPC-A to 13 digits internally if your system handles both formats.
  • Test a scanner with a printed number that has a deliberately wrong check digit to confirm it is rejected.
  • Keep a fixed export of test numbers in your project so results are repeatable.

Frequently asked questions

Can a UPC scanner read EAN-13 barcodes?

Most modern retail scanners read both formats. Very old systems built only for UPC-A may need an update to handle 13-digit codes.

What is a GTIN?

GTIN, or Global Trade Item Number, is the umbrella term for product identifiers such as UPC-A (GTIN-12), EAN-13 (GTIN-13) and EAN-8 (GTIN-8).

Does the barcode prefix show the country of origin?

No. It shows which GS1 organization issued the company number, so a product may be made in a different country than its prefix suggests.

Try a generator

Random Address Generator

Realistic street addresses with valid-format postal codes and phone numbers for 40 countries.

Fake Identity Generator

Complete fictional person profiles: name, birthday, address, phone, email, job and more.

Need random data? Get it now.

Pick any of 144 generators, hit Generate and copy or export the results as CSV, JSON or TXT. No account, no limits, nothing stored.

Start generating โ€” free