All posts

Choosing and Generating Barcodes: Formats, Check Digits, and Print Quality

July 12, 2026 · DevTools

barcode
ean
upc
printing
guide

Generating a barcode is easy; generating the right barcode that scans reliably in print is where people trip up. Three things matter: picking the correct format, getting the check digit right, and sizing it for the output device.

1. Pick the right format

Barcodes aren't interchangeable — retailers and logistics systems expect specific symbologies:

FormatUse it forAccepts
EAN-13Retail products worldwide12–13 digits
UPC-AProducts in the US & Canada11–12 digits
EAN-8Small packaging7–8 digits
CODE128Shipping, inventory, general purposeAny ASCII
CODE39Industrial / asset labelsUppercase, digits, a few symbols
ITF-14Cartons & logisticsExactly 14 digits

Rule of thumb: if it's a product going to a store, you need EAN or UPC (and a real, registered number). For internal inventory or shipping labels, CODE128 is the flexible workhorse.

2. Understand the check digit

EAN-13, EAN-8, and UPC-A end in a check digit — a single digit computed from the others using a mod-10 formula. It lets scanners detect misreads. You have two options when entering a value:

  • Enter the data digits only (12 for EAN-13) and let the tool compute the check digit for you.
  • Enter the full value including the check digit — the tool verifies it and tells you the correct one if it's wrong.

For example, the EAN-13 data 590123412345 produces check digit 7, giving the final barcode 5901234123457. Getting this digit wrong is the most common reason a "valid-looking" barcode won't scan.

3. Size it for print

A barcode that looks fine on screen can fail at the scanner if it's printed too small or without enough margin:

  • Use vector (SVG) or high-DPI PNG. On-screen pixels don't map to physical size — a barcode is only as crisp as its output resolution. For thermal label printers, 203 DPI is typical; for professional print, 300 DPI or more.
  • Keep the quiet zone. The blank margin on each side (the "quiet zone") is part of the symbol — scanners need it to find the start and end. Don't crop it tight.
  • Check the physical dimensions. A 450-px-wide barcode at 300 DPI prints at about 38 mm — verify the real size matches your label before running a batch.

Generate one

The Barcode Generator covers all of the above: it explains each format inline, auto-calculates and verifies check digits, shows the physical print size at your chosen DPI, and exports crisp SVG or scaled PNG (with a transparent-background option), plus copy-to-clipboard and print. Everything runs in your browser — no data leaves your device. For 2D codes like URLs and Wi-Fi, use the QR Code Generator instead.

Tools mentioned in this post