Barcodes are still the backbone of retail, logistics and inventory management worldwide. Whether you need to label products, organize warehouse boxes or track items internally, the question is always the same: which type should you use and how do you generate one without errors?

This guide answers all of that: the difference between 1D barcodes and 2D QR Codes, the main formats and when to use each, a step-by-step walkthrough in Code2Scan's generator, and the precautions that prevent rejection at the checkout counter.

1D barcode vs 2D QR Code

Before generating anything, it helps to understand the fundamental difference:

Feature 1D Barcode 2D QR Code
Scan direction Horizontal only Horizontal and vertical
Data capacity Low (up to ~20 numeric chars in EAN) High (up to 3,000 characters)
Reading device Laser scanner, camera Smartphone camera or 2D reader
Typical use Retail, logistics, packaging Links, payments, landing pages
Error correction None Yes (up to 30%)

The 1D barcode is what you see on grocery store packaging. It's simple, compatible with older laser scanners and universal in retail. A QR Code stores far more data and can be read by any smartphone — but requires 2D readers. For shelf products, retail standards still call for a 1D code (EAN-13 or UPC-A). For digital or internal use, a QR Code or CODE128 may be better.

Want to learn more about QR Codes? See the complete dynamic QR Code guide.

Main barcode types and when to use them

EAN-13 (GTIN-13)

The gold standard of global retail. It has 13 digits: a country prefix, manufacturer digits, product digits and a final check digit. This is the code that supermarket checkouts scan.

When to use: products sold in retail (supermarkets, pharmacies, physical stores).

Important: to sell in major retail chains, the GTIN must be registered with GS1. An EAN-13 generated at random is not an official GTIN — it may work in your internal system but will be rejected or conflict with another product on retailer shelves.

EAN-8

A compact version of EAN-13 with 8 digits, used when the packaging is too small for a full EAN-13.

When to use: candy, small cosmetics, sachets.

UPC-A

The North American standard with 12 digits. Very similar to EAN-13 (in fact, a UPC-A can be read as an EAN-13 with a leading zero).

When to use: products destined for the US and Canadian markets.

CODE128

A high-density alphanumeric code with no fixed length — it encodes any ASCII text. There is no country prefix or mandatory check digit (though one is calculated internally).

When to use: internal logistics, shipping labels, inventory control, hospitals, manufacturing. It is the standard on courier labels.

CODE39

Older and less dense than CODE128, it accepts uppercase letters, numbers and a few symbols. Still widely used in industrial and government environments.

When to use: auto parts, industrial inventory, government documents.

ITF-14

A 14-digit numeric code used on cardboard boxes and distribution units (not individual products). It is the GTIN-14 in a thick-bar format — it can be printed directly on the box without a separate label.

When to use: master cases, pallets, secondary packaging.

Summary table: type → use

Type Digits/Format Main use
EAN-13 13 numeric Global retail product
EAN-8 8 numeric Retail product (small packaging)
UPC-A 12 numeric Retail product USA/Canada
CODE128 Variable alphanumeric Logistics, stock, shipping
CODE39 Alphanumeric (uppercase) Industry, government
ITF-14 14 numeric Boxes and distribution units

Step by step: how to generate in Code2Scan

  1. Open the barcode generator on Code2Scan.
  2. Choose the type in the selector (EAN-13, CODE128, UPC-A, etc.).
  3. Enter the number or text in the data field.
    • For EAN-13: enter the first 12 digits — the generator calculates and appends the check digit automatically.
    • For CODE128: type letters and numbers freely.
  4. Preview the result in real time on screen.
  5. Download as PNG or SVG depending on your needs:
    • PNG: for direct printing or digital use.
    • SVG: for lossless scaling (ideal for packaging and print artwork).
  6. Test the barcode with an online barcode reader before printing in bulk.

Essential precautions

EAN check digit

The last digit of EAN-13, EAN-8 and UPC-A is calculated by algorithm (modulo 10). If you enter the correct first 12 digits, the generator calculates the 13th automatically. If you make up a number, you can create an invalid EAN that readers reject. Use the GTIN barcode checker to verify.

Registered GTIN vs internal code

  • Registered GTIN (GS1): required to sell in retail chains, marketplaces and for export. The number globally identifies your product.
  • Internal code: any CODE128 or self-assigned EAN works for internal stock control and closed systems — but it is not official for retail.

Size and quiet zone

  • EAN-13 has a nominal size of 37.29 mm × 25.93 mm. The tolerance range is 80% to 200%.
  • The quiet zone (white area around the barcode) must be respected: a minimum of 3.63 mm on each side for EAN-13.
  • On small packaging, use EAN-8 or enlarge the print — a too-small code will fail to scan.

White background, black bars

Avoid printing barcodes on colored backgrounds or over images. Black on white is the minimum contrast requirement. A red background, for example, is invisible to laser scanners.

Common mistakes

❌ Creating a random EAN to sell in retail

An EAN number generated without GS1 registration may match another manufacturer's product in the retailer's system. The result: inventory confusion, invoice rejection, product never reaching the shelf.

❌ Ignoring the check digit

Copying an EAN and accidentally changing the last digit creates an invalid code. Always validate before printing.

❌ Using CODE128 where retail requires EAN

Supermarket chains scan EAN/UPC at the checkout. CODE128 is for internal logistics. Using the wrong type causes scanner failures.

❌ Printing too small

A code compressed below the minimum size will fail to scan. Always test on your printer and actual scanner before producing in volume.

❌ Not testing before bulk printing

Generating and printing 1,000 labels without scanning a single one is risky. Test with the online barcode reader and with the physical scanner you'll be using.

❌ Confusing QR Code with barcode for shelf products

A QR Code does not replace EAN-13 in traditional retail. Shelf scanners use 1D laser readers — which often cannot read QR Codes. Use each in the right context. For QR on packaging, see QR Code on product packaging.

Summary

  1. EAN-13 for shelf products — register with GS1 if selling in retail chains.
  2. CODE128 for logistics and internal stock — alphanumeric, flexible.
  3. ITF-14 for distribution boxes.
  4. The check digit is calculated automatically by the generator — don't guess it.
  5. Respect the minimum size and quiet zone when printing.
  6. Test before bulk printing.
  7. QR Codes and 1D barcodes complement each other — learn how to create a QR Code for free for the digital side.

Generate your barcode for free now with Code2Scan's barcode generator — choose the type, enter your data, and download PNG or SVG in seconds.