Skip to content
Logo Any Help Me

Barcode Generator: Code 128, EAN, UPC & More

Options
2px
100px
#000000
#FFFFFF

Choosing the Right Symbology

"Barcode" is not one format. It is a family of encoding schemes called symbologies, and picking the wrong one is the most common reason a printed code will not scan where it needs to. Each was designed for a specific job, and most of them cannot encode what the others can.

FormatAcceptsDesigned for
Code 128Any text, any lengthLogistics, internal asset tags, anything not sold at retail.
EAN-1313 digitsRetail products worldwide outside North America.
EAN-88 digitsSmall retail packaging where EAN-13 will not fit.
UPC-A12 digitsRetail products in North America.
Code 39Uppercase, digits, a few symbolsOlder industrial, defence and automotive systems.
ITF-1414 digitsOuter shipping cartons rather than the item inside.

The practical shortcut: if you are labelling something for your own use, Code 128 is almost always the answer, because it takes arbitrary text and packs it densely. If the item will pass through a retail till, you need the format that matches its registered product number, and that is not a free choice.

Retail Codes Are Not Yours to Invent

EAN and UPC numbers are not arbitrary. They are issued through GS1, the organisation that administers the global numbering system, and a company buys a prefix that identifies it. The digits that follow identify the product within that company's range.

This matters because generating a valid-looking EAN-13 does not give you a usable retail barcode. It produces a number that either belongs to somebody else or belongs to nobody, and a retailer's system will reject it or, worse, ring up someone else's product. For a real product going into real shops, the number has to be allocated to you.

Where the generator is genuinely useful for retail formats is reproducing a barcode you already have, regenerating a damaged label, or producing a clean print-ready version of a number already assigned to your product.

The Check Digit Is Doing Real Work

EAN-13, EAN-8, UPC-A and ITF-14 all end in a check digit calculated from the digits before it. Alternating digits are weighted 1 and 3, the weighted total is summed, and the check digit is whatever brings that sum to the next multiple of ten.

Take 5901234123457. The weighted sum of the first twelve digits comes to 83, and 90 − 83 = 7, which is the final digit. Every scan recomputes this, which is why a scanner rejects a smudged or misread code instead of returning a plausible wrong number. If the generator refuses your input, a mistyped digit is the likeliest cause.

Code 128 and Code 39 have no user-visible check digit, which is part of why they accept free text, and also why a misread is caught by the symbology's internal structure rather than by arithmetic you can verify by eye.

Printing So It Actually Scans

Most scanning failures are printing failures rather than encoding failures.

  • Quiet zone. Barcodes need blank margin on both sides, around ten times the width of the narrowest bar. Cropping tight to the bars is the single most common cause of a code that will not read.
  • Contrast. Black on white. Scanners read reflected light, so red bars on a dark background can be invisible to them even though they look fine to you.
  • Size. Scaling a barcode down past a certain point merges the narrow bars at print resolution. Print at the size you will use rather than shrinking afterwards.
  • Distortion. Never stretch a barcode in one direction only. Height can be trimmed; width cannot be altered independently without changing the ratios the scanner measures.

Everything here runs in your browser using JsBarcode, so nothing you enter is uploaded. Download the result as an image and test-scan it with a phone before committing to a print run of several thousand labels.

Frequently Asked Questions

Which barcode format should I use?
Code 128 for anything internal, since it accepts arbitrary text. For retail, use the format matching your GS1-issued number, EAN-13 outside North America, UPC-A within it.
Can I make up my own EAN or UPC number?
Not for real retail use. Those numbers are issued through GS1 and identify a specific company and product. A self-invented one will be rejected or collide with someone else’s.
What is the check digit?
The final digit, computed from the ones before it using alternating weights of 1 and 3. Scanners recompute it to catch misreads, which is why an invalid number is refused.
Why will my printed barcode not scan?
Usually the quiet zone. Barcodes need blank margin on both sides, roughly ten times the narrowest bar width, and cropping tight to the bars breaks them.
Can I resize a barcode?
Height can be trimmed safely. Width cannot be changed independently, because the scanner measures the ratios between bars, never stretch in one direction only.
What is the difference between EAN-13 and UPC-A?
EAN-13 has thirteen digits and is used worldwide; UPC-A has twelve and is the North American standard. Modern scanners read both.
Is my data sent anywhere?
No. The barcode is generated in your browser and nothing you type is transmitted or stored.

Explore more in Tools

View all →