Z

Barcode Generator

Generate Code128, EAN and UPC barcodes locally and download as an image.

Runs in your browser — files never leave your device

How it works

Type a value, choose a symbology, and the barcode is drawn instantly as an inline SVG by the JsBarcode encoding library — 2-pixel-wide modules, 80-pixel-tall bars, with the human-readable value printed underneath. Every keystroke re-encodes the preview, and if the value can’t be represented in the selected format you get an error instead of a broken symbol. Download SVG serializes exactly what you see into a barcode.svg vector file.

The four formats cover most real-world jobs. CODE128 encodes all 128 ASCII characters and switches automatically between its internal subsets (A, B and C), packing runs of digits two per symbol, so it produces the shortest bars for mixed text — the right default for internal labels. CODE39 is older and simpler: digits, capital letters, space and - . $ / + % only (lowercase input is uppercased for you). EAN-13 and UPC are fixed-length retail symbologies: EAN-13 takes exactly 12 digits and computes the 13th — the check digit — while UPC-A takes 11 digits and appends its 12th check digit automatically.

That check digit is real arithmetic, not decoration. In EAN-13, digits in odd positions count once, digits in even positions count three times, and the check digit tops the sum up to the next multiple of 10. Enter 590123412345 and the rendered code reads 5901234123457 — the trailing 7 is calculated for you. Paste a full 13-digit number whose last digit doesn’t match and the tool rejects it, exactly as a supermarket scanner would.

Typical uses:

  • CODE128 — inventory and asset tags, shipping cartons, tickets, membership cards
  • EAN-13 — retail packaging worldwide (numbers assigned through GS1)
  • UPC — retail packaging in North America
  • CODE39 — legacy warehouse, automotive and government systems

Printing is where barcodes usually fail. Keep a quiet zone — clear, empty margin — on both sides of the symbol; a common rule of thumb is at least ten times the narrow-bar width, so don’t crop the SVG tight or butt it against a border. Because the download is vector, it stays sharp at any print DPI, but avoid shrinking it until bars merge on a low-resolution thermal printer, and keep dark bars on a light background — inverted or low-contrast labels often won’t scan. Test one printed label with your actual scanner before a full run.

Frequently asked questions

Which barcode format should I pick?
Use CODE128 unless something dictates otherwise — it encodes any ASCII character, switches character sets automatically and produces the most compact symbol for mixed text. EAN-13 and UPC are only for retail product numbers issued through GS1. CODE39 mainly persists in older warehouse, automotive and government workflows that were built around it.
How does the EAN-13 check digit work?
The first 12 digits are weighted alternately 1 and 3 and summed, and the check digit is whatever lifts that total to the next multiple of 10. Type 590123412345 and the tool renders 5901234123457 — the final 7 is computed for you. If you enter all 13 digits yourself, the last one must match this calculation or the value is rejected.
What’s the difference between EAN-13 and UPC?
UPC-A is a 12-digit code used mainly in North America; EAN-13 is the 13-digit international superset, and a UPC is effectively an EAN-13 with a leading zero. Most modern scanners read both. For products sold at retail the underlying numbers must be assigned through GS1 — the barcode is just the graphic form of that number.
Why does my value show an error for CODE39?
CODE39 only encodes digits, capital letters, space and the symbols - . $ / + %. Lowercase letters are converted to capitals automatically, but anything else — punctuation, accents, emoji — makes the value invalid. Switch to CODE128 for arbitrary text.
Why is the download an SVG instead of a PNG?
SVG is vector, so the barcode stays perfectly crisp at any label size and printer resolution — scaling a PNG up blurs bar edges and can break scanning. Any design tool or label software can rasterize the SVG to PNG at print time if you need one.
Why won’t my printed barcode scan?
The usual suspects: no quiet zone (leave clear margin around the bars, roughly ten times the narrow-bar width), a symbol printed so small that bars bleed together, or weak contrast — dark bars on a light background scan best. Glossy laminate and inverted colors also confuse laser scanners. Print one test label and scan it before committing to a batch.
Is my data uploaded anywhere?
No. The value is encoded and rendered entirely in your browser, and the SVG download is generated locally — nothing you type leaves your device.