Free Online Barcode Generator
Need an EAN for product packaging, a CODE128 label for the warehouse, or an ITF-14 for shipping cartons? Pick the standard, type the value and the barcode renders instantly — validated as you type, downloadable as a print-ready PNG. The generator runs entirely in your browser, so product numbers and internal SKUs never leave your computer, and there is no registration or watermark.
Which barcode type do you need?
Each standard exists for a specific job. If you’re unsure, CODE128 is the right default for anything that isn’t retail checkout.
| Code Type | Area of Use | What can it encode? | When to choose it? |
|---|---|---|---|
| CODE128 | Logistics, Warehouses, E-shops | Numbers, letters (A–Z, a–z), and ASCII symbols. | Best choice for internal labels, package tracking and inventory. Highest data density — the code stays short. |
| EAN-13 | Retail (Europe & most of the world) | Numbers only (13 digits). | Required for goods sold at store checkouts in Europe and most other markets. |
| UPC (UPC-A) | Retail (USA & Canada) | Numbers only (12 digits). | The North American counterpart of EAN-13. Needed when exporting products to the US. |
| EAN-8 | Small products | Numbers only (8 digits). | For tiny packaging (lipstick, chewing gum) where an EAN-13 physically doesn’t fit. |
| CODE39 | Industry, Automotive, Defense | Numbers, uppercase A–Z and - . $ / + %. | An older, very robust standard. Wider than CODE128 but tolerant of poor print quality. |
| ITF-14 | Shipping cartons | Numbers only (14 digits). | For outer packaging. The generator draws the surrounding bearer bar frame the standard requires, which protects readability when printing straight onto corrugated cardboard. |
Why the generator rejects some inputs
If an error appears instead of a preview, the value doesn’t satisfy the rules of the chosen standard — that’s validation working, not a bug:
- EAN-13, EAN-8 and UPC end with a check digit. The last digit is computed from all the others, so a random 13-digit number is almost always invalid. Try the valid example
4006381333931(EAN-13) or96385074(EAN-8) to see the difference. If you have an officially assigned number, it already includes a correct check digit. - Digit counts are strict. EAN-13 needs exactly 13 digits, UPC 12, ITF-14 exactly 14.
- Character sets are limited. CODE39 accepts only uppercase letters, digits and a few symbols — lowercase letters or accented characters (
é,ř,ü) will be refused. CODE128 is the one to pick for mixed text likeSHELF-A-12.
How the check digit is calculated
The last digit of an EAN-13, EAN-8, UPC or ITF-14 isn’t part of the product number — it’s arithmetic derived from the digits before it, so a scanner can tell a misread from a real code. Here is the whole calculation on the working example 4006381333931.
Take the first twelve digits and multiply them alternately by 1 and 3, starting with 1:
| Digit | 4 | 0 | 0 | 6 | 3 | 8 | 1 | 3 | 3 | 3 | 9 | 3 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Weight | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 |
| Product | 4 | 0 | 0 | 18 | 3 | 24 | 1 | 9 | 3 | 9 | 9 | 9 |
Those products add up to 89. Round that up to the next multiple of ten — 90 — and the difference is your check digit: 1. And indeed the full number ends in 1.
Two details trip people up. The weights are really anchored at the right-hand end, not the left — they run 3, 1, 3, 1 leftwards from the last data digit. EAN-13 has twelve data digits, an even count, so its leftmost digit happens to get a 1. UPC-A, EAN-8 and ITF-14 have an odd count, so their first digit gets a 3 instead. And when the sum already lands on a multiple of ten, the check digit is 0, not 10.
This is also why inventing a number almost never works: only one digit in ten satisfies the rule, so a made-up thirteen-digit number is wrong about 90% of the time.
Getting a code that actually scans
The preview can look perfect and still fail at the register if the physical print is wrong. The rules that matter:
- Bar width sets the width of the thinnest bar — the critical dimension for scanners. For label printers, keep it at 2 or higher; hairline bars smudge into their neighbors.
- Height matters for handheld scanning. A taller code is easier to hit with a laser at an angle. Stay above 50 px; go higher for codes scanned at arm’s length.
- Don’t cover the quiet zone. The generator already adds it for you, sized to each standard — an EAN-13 gets 11 modules of clear space on the left and 7 on the right, a CODE128 gets 10 on each side. What breaks it is what happens afterwards: cropping the downloaded image tight to the bars, or placing text, borders or graphics against its edge. The scanner uses that blank margin to find where the code starts and stops.
- Never stretch the image. Resizing the downloaded PNG disproportionately changes the ratio between bars and gaps, which is exactly what encodes the data. If you need a different size, come back and generate it at the right dimensions.
- Beware glossy surfaces. Reflections from laminated packaging or cans can blind the scanner. A matte label, or simply a larger code, solves it.
- Avoid red bars. Most laser scanners read with red light, which makes red bars effectively invisible to them. Black, dark blue or dark green on a light background are the safe choices.
Colors and gradients — for design, not for checkout
Beyond classic black-on-white you can set custom foreground and background colors, a two-color linear gradient, or a rainbow fill. These options are meant for posters, event badges, coupons and other designed materials. For retail checkout and warehouse operations, stay with high-contrast solid colors — and whatever you choose, test the printed result with a real scanner before a production run.
The display text toggle prints the human-readable value under the bars. Keep it on for anything operational: when a code gets damaged, the cashier or warehouse worker can type the number in manually.
What the first digits actually tell you
There’s a widespread belief that the opening digits of a barcode reveal where a product was made. They don’t. The prefix identifies the GS1 member organisation the company registered with — nothing more. A brand that registered in Germany carries a 40–44 prefix on every item it sells, whether that item was manufactured in Bavaria, Vietnam or Mexico.
A few of the ranges you’ll meet most often:
| Prefix | GS1 organisation |
|---|---|
| 00–13 | United States and Canada |
| 30–37 | France |
| 40–44 | Germany |
| 45, 49 | Japan |
| 50 | United Kingdom |
| 57 | Denmark |
| 64 | Finland |
| 69 | China |
| 76 | Switzerland |
| 80–83 | Italy |
| 84 | Spain |
| 859 | Czechia |
| 858 | Slovakia |
| 87 | Netherlands |
| 890 | India |
Some ranges aren’t countries at all, and those are the useful ones to recognise:
- 20–29 is reserved for in-store use — the codes a supermarket prints for loose fruit or a weighed deli item. They’re valid inside that one retailer and meaningless anywhere else.
- 977 marks a periodical (ISSN), 978 and 979 a book (ISBN), and 979-0 printed sheet music (ISMN).
- 980 is used for refund receipts, and 99 for coupons.
So if you scan something and get a 20-something prefix, you haven’t found a mystery product — you’ve found a label the shop made for itself.
One thing this tool can’t do: assign official numbers
The generator draws any number you give it, but retail chains only accept GTIN numbers assigned by GS1, the global numbering organization. You register with the GS1 office in your country, receive your company prefix and number range, and then come back here to turn those numbers into printable graphics — that part is free forever.
Frequently Asked Questions (FAQ)
Can a barcode be colored or use a gradient?
Technically yes, and this generator supports it — but scanners care about contrast, not beauty. Dark bars on a light background are essential, and red-toned bars fail with most laser scanners regardless of contrast. Use color freely on marketing materials, conservatively on anything a point-of-sale system must read.Why does my 13-digit number show an error as EAN-13?
The last digit of an EAN-13 is a checksum computed from the first twelve. If it doesn't match, the number is invalid and the generator refuses it — the same way a store scanner would. Verify the number you were assigned, or test the tool with the valid example4006381333931.