Barcode generator

Create an EAN-13, EAN-8, UPC-A (products) or Code-128 (text and numbers) barcode and download it as PNG or SVG. Everything runs in your browser, no data is ever sent online.

🔒 The barcode is built on your device: no data is ever sent to a server.

EAN-13, EAN-8, UPC-A or Code-128?

EAN-13 is the 13-digit code printed on retail products: enter 12 digits and the thirteenth (check digit) is computed for you. EAN-8 is its short version, for packs with no room for more (7 digits plus the check digit), and UPC-A is the 12-digit code on products from the United States and Canada. Code-128 is more flexible and encodes letters, numbers and symbols: perfect for internal warehouse codes, labels, shipping and inventory.

In Code-128, digits take half the space

Code-128 has a mode just for numbers, set C, which writes two digits in a single symbol. The generator switches to it on its own where it helps and back to letters when they are needed, picking the shortest combination for the whole text: an 18-digit number comes out 134 modules wide instead of 233, and on a narrow label that is the difference between a code that fits and one that does not.

One thing this tool does not do: GS1-128 logistics labels, the ones with numbers in brackets like (00) or (01), need an extra special character (FNC1) at the start that this generator does not write, so a code made here does not count as a GS1 label.

PNG or SVG for printing?

To print labels choose SVG: being a vector it stays sharp at any size, which is essential for the scanner to read the bars well. PNG is fine for on-screen use or in documents.

The check digit is not just any number

The last digit of an EAN-13 is not part of the code, it is a check calculated from the other twelve: the digits are summed alternating weight 1 and weight 3, and the final digit is the one that brings the total to the nearest multiple of ten. It exists so a scanner rejects a bad read instead of accepting it.

It is why an invented code almost never scans: the chance that twelve random digits already have the right thirteenth is one in ten. If the code has to work in a real shop, the leading digits are not invented at all: they identify the country and the company, and they are assigned.

The white space counts as much as the bars

Around the code you need an empty margin of at least ten times the narrowest bar on each side. These are the «quiet zones», and a label printed flush to the edge or inside a frame will not scan, even if the bars are perfect.

The other classic mistake is shrinking the code to make it fit: below 80% of nominal size the bars merge in printing. Contrast must stay high too: black bars on white always work, red bars on a dark background almost never, because many scanners use a red light that cannot see red.

A barcode does not contain the price

On a product label the code identifies the item, not what it costs: the price lives in the till's database. It is why the very same code costs different amounts in two shops, and why changing a price requires reprinting nothing.

The exception is variable-weight codes from fresh counters, which start with 2 and carry the weight or the amount worked out by the scale: those are valid only inside the shop that printed them. If a code starts with 2, do not look it up online.

Nearby tools

If you need a code containing an address or a text, the way through is QR code generator, and to read one back Read a QR code. To print labels in rows on a sheet, look at Images to PDF.

Related tools