Choosing a barcode format
Barcode formats are not interchangeable. Each was designed for a particular purpose and encodes a particular kind of data, so the right choice depends entirely on what you are labelling and who will scan it.
Code 128
Code 128 encodes the full ASCII character set, meaning letters, numbers and symbols in any combination. It is compact and is the standard choice for internal use — asset tags, shelf locations, work-in-progress tracking, shipping labels. If you are creating barcodes for your own systems and have no external requirement, this is almost always the right format.
EAN and UPC
These are the retail formats found on consumer products worldwide. EAN-13 carries thirteen digits and is used internationally; UPC-A carries twelve and is the North American variant. Both encode a number that identifies a specific product from a specific company.
An important point that catches people out: you cannot simply invent an EAN or UPC number for a product you intend to sell. These numbers are allocated through GS1, the organisation that administers the system globally, and a company prefix must be purchased. A made-up number risks colliding with a real product, and retailers will reject it. Generating one here is appropriate for testing, mock-ups and internal use, not for commercial products.
Both formats include a check digit calculated from the preceding digits, which is why entering twelve digits produces a thirteen-digit EAN — the final digit is computed for you and lets scanners detect misreads.
Code 39 and the others
Code 39 is older and less dense, encoding uppercase letters, digits and a few symbols. It survives in automotive and defence supply chains where standards were set decades ago. ITF-14 is used on outer shipping cartons rather than individual items, and its thick bars survive printing directly onto corrugated cardboard. Pharmacode is a pharmaceutical packaging control code with its own conventions.
Printing so it scans
Most scanning failures come from printing rather than from the barcode itself. Print at the largest practical size and at high resolution — a laser printer or thermal label printer rather than an inkjet, which can bleed and blur bar edges. Keep a clear quiet zone either side of the barcode, typically at least ten times the width of the narrowest bar.
Contrast matters more than colour: dark bars on a light background is what scanners expect. Avoid printing onto reflective or heavily textured surfaces, and never scale a barcode non-proportionally, since stretching one axis changes the ratio between bar widths and can make it unreadable.
SVG or PNG
Download as SVG when the barcode will be placed into a print layout, since vector output stays sharp at any size. PNG is convenient for screens and for systems that will not accept vector files. Generation happens in your browser and nothing is transmitted.
Frequently Asked Questions
Which format should I choose?
Code 128 for internal use, since it handles any text. EAN-13 or UPC-A only for retail products, and those require officially allocated numbers.
Can I make my own UPC for a product I sell?
No. Retail barcode numbers must be allocated through GS1. Self-invented numbers risk colliding with real products and are generally rejected by retailers.
Why does my number get rejected?
Each format has strict length and character rules. EAN-13 needs twelve digits with the check digit added automatically, and UPC-A needs eleven.
What is the check digit?
A final digit calculated from the preceding ones, allowing scanners to detect a misread. It is generated automatically.
Should I download PNG or SVG?
SVG for print, since it stays sharp at any size. PNG for screens or systems that do not accept vector files.