The Ultimate Barcode Guide: Everything You Need to Know in 2026
Written by Tomasz Lichosik
Ready to generate barcodes?
Create high-quality labels in seconds.
Barcodes are the quiet infrastructure of commerce. Every second, lasers and image sensors read these little patterns of lines and squares to move products, track equipment, and double-check medications at a bedside. They are easy to take for granted right up until you have to make one yourself.
Whether you are a small business labelling your first product, a warehouse manager tightening a logistics chain, or a developer building a scanning feature, this is the map of the whole territory — the reference tables you need to make a decision, plus links to the deeper guides for each topic.
What a barcode actually is
Strip it back and a barcode is just a machine-readable way of writing data. Rather than a person typing "12345678," a scanner reads the widths of the bars and spaces (or the arrangement of squares) and turns them into that same value instantly.
The mechanics are simple: the scanner shines light, the dark bars absorb it and the light spaces reflect it, and the sensor reads that pattern of reflection back into digital data.
One distinction is worth getting straight early, because almost every confusing barcode conversation comes from mixing them up:
- The symbology is the encoding scheme — the alphabet. Code 128, EAN-13, QR Code are symbologies.
- The data is what you put in it — a product number, a URL, an asset tag.
- The standard is the rulebook saying which data belongs in which symbology for a given industry. GS1 is the big one in retail and logistics.
You can encode the number 5901234123457 as Code 128 quite happily. It will scan. It just will not be a valid retail product code, because the rulebook says retail uses EAN-13.
The anatomy of a linear barcode
Left to right, an EAN-13 contains five distinct things, and only one of them is data:
- The quiet zone — blank margin, no data, absolutely mandatory. Full requirements here.
- The guard pattern — a fixed start marker that tells the scanner the code begins and how wide one bar is.
- The data characters — the actual digits.
- The check digit — a self-test, computed from the other digits.
- The human-readable interpretation (HRI) — the printed digits underneath, for when the scan fails and someone has to type it.
The check digit is the part most people never look at, and it is the reason a mistyped barcode almost never becomes a different valid barcode.
How the check digit works
Take the EAN-13 590123412345 and work out its thirteenth digit. Going left to right, multiply alternate digits by 1 and 3:
| Digit | 5 | 9 | 0 | 1 | 2 | 3 | 4 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Weight | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 |
| Product | 5 | 27 | 0 | 3 | 2 | 9 | 4 | 3 | 2 | 9 | 4 | 15 |
The products sum to 83. Round up to the next multiple of ten (90) and subtract: 90 − 83 = 7. The complete code is 5901234123457.
Two consequences follow, and both matter in practice. A single mistyped digit always changes the sum, so the code fails its own test — which is why a scanner beeps rather than silently reading the wrong product. And you cannot invent a valid barcode by picking a nice-looking number; the last digit is determined by the other twelve. Any decent generator computes it for you and rejects codes where you have supplied a wrong one.
1D vs 2D: the two families
1D (linear) codes are the classic picket-fence lines, storing data left to right. 2D (matrix) codes use a grid of cells, storing data in both directions.
| 1D (linear) | 2D (matrix) | |
|---|---|---|
| Typical capacity | 8–20 characters | Hundreds to thousands |
| Footprint per character | Large — grows sideways | Small — grows in two directions |
| Damage tolerance | None; a scratch across the bars kills it | Built-in error correction |
| Scanner needed | Laser or imager | Imager only |
| Reads at an angle | Poorly | Yes, from any rotation |
| Typical use | Retail, cartons, asset tags | URLs, manufacturing data, tiny parts |
The damage tolerance line is the one that decides most real-world arguments. A 2D code survives being scuffed, partially covered, or printed on a curve. A linear code does not — one deep scratch across the bars and the symbol is gone.
Capacity and character sets, symbology by symbology
| Symbology | Data it accepts | Maximum | Fixed length? |
|---|---|---|---|
| EAN-13 | Digits | 13 digits | Yes |
| EAN-8 | Digits | 8 digits | Yes |
| UPC-A | Digits | 12 digits | Yes |
| ITF-14 | Digits | 14 digits | Yes |
| Code 39 | Digits, A–Z, and 7 symbols | Practical limit ~25 chars | No |
| Code 128 | Full ASCII (128 characters) | Practical limit ~48 chars | No |
| QR Code | Numeric, alphanumeric, byte, kanji | 7,089 digits / 4,296 alphanumeric / 2,953 bytes | No |
| DataMatrix | Full ASCII | 3,116 digits / 2,335 alphanumeric | No |
| PDF417 | Full ASCII | 2,710 digits / 1,850 text characters | No |
The "practical limit" on the linear codes is not a rule in the specification — it is physics. Code 128 has no defined maximum, but every character you add makes the symbol wider, and a symbol wider than the scanner's field of view cannot be read in one pass. Past roughly 20 characters, a linear code is usually the wrong tool.
The 2D maxima are theoretical ceilings at the largest symbol version and the weakest error correction. In practice you will never approach them, and you should not want to: a QR code holding 2,000 characters has so many tiny modules that ordinary printing and ordinary cameras both start to fail.
QR error correction: the trade-off nobody explains
QR codes come in four error-correction levels. Higher correction means a code that survives more damage, but the redundancy takes space, so the same data needs a larger symbol.
| Level | Data recoverable | Use it when |
|---|---|---|
| L (Low) | ~7% | Clean digital display, screen or PDF |
| M (Medium) | ~15% | General print — the sensible default |
| Q (Quartile) | ~25% | Industrial settings, some dirt or wear expected |
| H (High) | ~30% | Harsh environments, or a logo overlaid on the code |
That last row is the practical one. Putting a logo in the middle of a QR code works precisely because level H can lose 30% of the symbol and still decode — but only if you chose H when you generated it. Overlay a logo on an L-level code and you have made an unreadable image.
Which symbology should you use?
| Your situation | Use | Why |
|---|---|---|
| Selling in retail shops | EAN-13 or UPC-A | The only codes retail POS systems accept |
| Shipping cartons and pallets | ITF-14 | Survives printing on corrugated cardboard |
| Internal stock and warehouse | Code 128 | Compact, full ASCII, no registration needed |
| Tracking equipment and assets | Code 128 or DataMatrix | Durable, small, no retail rules to satisfy |
| Marking tiny parts | DataMatrix | Smallest footprint of any 2D code |
| Healthcare and pharmacy | DataMatrix, PDF417 | Mandated by regulation in most markets |
| Anything a customer scans with a phone | QR Code | Universal phone support |
| E-commerce stock (Shopify, WooCommerce) | Code 128 | Fastest to set up; no GS1 fee |
The single question that decides most of it: does the code leave your building? If it does, and someone else's system has to read it, you need the standard their industry uses. If it stays internal, Code 128 is almost always the pragmatic answer.
Do you need a GS1 prefix?
If your product will be scanned at a retail checkout, yes. The digits at the front of an EAN-13 are a company prefix issued by GS1, and it is what makes your number globally unique. You license it — annually, at a cost that varies by country and by how many products you need — and GS1 keeps the registry that says the number is yours. More on how prefixes work.
Two things worth knowing before you go looking for a cheaper route. Resold barcode numbers from the secondary market do scan, but the registry still lists the original owner, and the major retailers and marketplaces increasingly check. And internal codes — the ones you invent yourself — are perfectly legitimate and cost nothing, as long as they never leave your own systems.
Sizing: the part that decides whether it scans
Every dimension in a barcode is expressed as a multiple of X, the width of its narrowest bar. Retail talks about magnification instead, where 1.00 is nominal:
| Magnification | X-dimension | EAN-13 overall size |
|---|---|---|
| 0.80 (minimum allowed) | 0.264 mm | 29.83 × 20.74 mm |
| 1.00 (nominal) | 0.330 mm | 37.29 × 25.93 mm |
| 2.00 (maximum allowed) | 0.660 mm | 74.58 × 51.86 mm |
Those overall figures include the quiet zones, and that is the trap: shrinking a barcode to fit a small package is legitimate down to 0.80, and cropping its white margins to fit is never legitimate at any size. The quiet zone requirements per symbology are here.
Printing without the headaches
Printing is where most barcode systems quietly fall apart. Three rules cover most of it:
- Stay vector. Generate as SVG or PDF; raster PNG and JPG go soft when resized, and scanners hate soft edges.
- Respect the quiet zone. Every code needs its blank margin, sized in X — the numbers are here.
- Match the printer to the job. Avery sheets for small office batches, thermal printers for volume and durability, and a careful desktop setup for everything in between.
Never scale a barcode by dragging a corner in a layout tool. Regenerate it at the size you need instead — stretching changes X horizontally but not vertically, and a distorted symbol can fail on hardware that read the original perfectly.
When it won't scan
If the scanner stays silent, five things catch most cases:
- Low contrast — are the bars dark enough on a light background? Red bars are effectively invisible to a red laser.
- Distortion — is the label on a curve or a fold?
- Print damage — any bleeding, voids, or white lines?
- Hardware mismatch — are you trying to read a 2D code with an old laser? A laser scanner physically cannot read QR.
- Missing quiet zone — is text or a border touching the bars?
There is a full troubleshooting guide here when you need it.
What's coming: Sunrise 2027
Retail is mid-shift. By 2027 the global standard moves toward 2D codes at the checkout, which lets a single scan carry the expiry date, batch number, and serial alongside the product number — things a 13-digit EAN simply has no room for.
The practical consequence for anyone labelling products now is that the transition is additive, not a switch: POS systems are being upgraded to read both, and packaging will carry both for years. There is no need to rush, and good reason to understand the direction. More on the Sunrise 2027 transition.
Where to start
Whether you need one code or ten thousand, BarcodeReady generates all nine symbologies covered above, in the browser, with the check digit computed and validated for you:
- One at a time: create a code for free.
- In bulk: generate hundreds of labels at once from a CSV, on Avery or DYMO templates — switch the generator to Bulk Export.
- In your own code: the REST API returns PNG or SVG from a single URL.