Barcode Generator

CODE128, EAN-13, EAN-8, UPC, CODE39 & more, download as PNG or SVG

Bar width2
Height100

Preview

Nothing you enter here is ever uploaded, every barcode is generated locally in your browser.

About this tool

Each barcode format here is a different "symbology", a rule set for turning characters into a specific pattern of bars and spaces that a scanner's laser or camera can decode. CODE128 and CODE39 can encode almost any letters and numbers and are common on shipping labels and internal inventory tags, while EAN-13, EAN-8, and UPC are the fixed-digit, checksum-protected formats printed on retail packaging around the world. Pick a format based on what will actually be scanning the code, since a supermarket scanner tuned for UPC won't necessarily expect CODE128 data.

To use it: type or paste the value you want encoded, pick a format from the dropdown, and the preview updates instantly, adjust bar color, bar width, height, and whether the human-readable text shows underneath, all with live feedback. If the value doesn't fit the rules of the format you've chosen (wrong digit count, invalid characters, a failed checksum), an error message replaces the preview so you can fix it before downloading. When it looks right, download it as a PNG for quick use in a document or SVG for anything that will be resized or printed. Everything runs locally in your browser via the JsBarcode library, nothing you type is ever sent to a server.

A couple of practical tips: for retail products that need to scan at any point-of-sale terminal worldwide, use EAN-13 or UPC-A with a real, registered product number, a made-up code will fail on real registries even if it scans locally. For internal tracking, asset tags, or shipping labels where you control both the printer and the scanner, CODE128 or CODE39 are more flexible since they aren't restricted to a fixed digit count.

What's the real difference between CODE128 and EAN-13?

CODE128 is a flexible, variable-length symbology that can hold letters, numbers, and some symbols, useful for logistics and internal codes. EAN-13 is a fixed 13-digit retail standard with a specific structure (country/manufacturer prefix, product code, and a check digit) that global point-of-sale systems are built to recognize.

Why does EAN-13/UPC need an exact number of digits and a checksum?

The last digit isn't part of the product identity, it's a check digit calculated from the digits before it using a fixed weighted formula. Scanners recompute that checksum on every read and reject the scan if it doesn't match, which is what catches print smudges or a misread digit before bad data reaches the till.

Will a barcode I generate and print here actually scan correctly?

Yes, as long as it's printed at a reasonable size and contrast, export as SVG if you plan to print it, since vector output stays sharp at any size, whereas a small PNG can blur the bars enough to cause misreads.

Which symbologies are supported, and when should I use each?

CODE128 (flexible alphanumeric, logistics, internal codes), EAN-13/EAN-8/UPC-A (fixed-digit retail standards with a checksum), CODE39 (alphanumeric, widely supported by older scanners, industrial and asset tags), ITF-14 (numeric, used on shipping cartons and outer packaging), MSI (numeric, common in warehouse shelf labeling), and Pharmacode (numeric, pharmaceutical packaging line control). Choose based on what the scanner at the other end is built to read.

Does this tool check that my input is valid for the format I picked?

Yes. The underlying JsBarcode library validates the value against the chosen format's rules, digit count, checksum, allowed characters, as you type. If it doesn't fit, an error message appears in place of the preview instead of silently generating an invalid code.

How small can I print a barcode before it stops scanning reliably?

It depends mainly on the "Bar width" setting relative to your print size, the narrowest bar needs to stay wide enough for the scanner's optics to resolve, so shrinking a code with a thin bar width can make adjacent bars blur together. Keep bar width around 2 or higher for small labels, and always test-scan a printed sample at the final size before printing a full batch.