Barcode Generator — Create CODE128 and EAN Barcodes in Your Browser
Generate CODE128, EAN-13, and UPC-A barcodes from text or numbers. Download as PNG or SVG, runs entirely in your browser. No uploads, no limits.
Barcode Generator
Generate barcodes from text. Supports CODE128, EAN13 and more. Works entirely in your browser.
Barcodes look simple and they are — a stack of black bars and white spaces encoding a number or a string — but the simplicity hides decades of standardization work. The bars themselves are a font; each character is encoded as a pattern of bars and spaces with widths from 1 to 4 units, and a checksum digit at the end catches read errors. The three formats this tool generates are the ones you actually meet in the wild: CODE128 for logistics, EAN-13 for retail products sold outside North America, and UPC-A for retail products sold in the US and Canada. Picking the wrong format is the most common mistake — a CODE128 label on a retail shelf will not scan at checkout, and an EAN-13 label on a shipping manifest will confuse the warehouse scanner.
The non-obvious thing about generating scannable barcodes is the quiet zone. Every barcode needs a blank margin on both the left and the right — typically at least 10 times the width of the narrowest bar — and that margin is part of the format, not optional padding. A barcode with no quiet zone looks fine on screen and will fail to scan. The generator renders the quiet zone correctly, but if you crop the output to remove the white space around it, the scanner will reject it. The same rule applies to contrast: print with deep black on bright white, not with grey on cream.
For a final hand-off: if the destination is a printed label on a product or a shipping box, export SVG and print at the size you intend to ship — barcodes that look fine at 200% zoom on screen can fail at production size if the bar widths are below 0.25 mm. If the destination is a slide deck or a web page, PNG at 2x resolution is the right pick. And if you need a 2D code (a URL, a Wi-Fi credential, a contact card), switch to the QR Code Generator — the two formats solve different problems.
How to use
Pick a barcode format
Choose CODE128 for any text (most flexible), EAN-13 for retail products (13 digits), or UPC-A for North American products (12 digits). The format decides what input is valid.
Enter the value to encode
Type or paste the data. CODE128 accepts letters, numbers, and symbols. EAN-13 and UPC-A require a numeric string of fixed length; the tool validates and shows an error if the length is wrong.
Download as PNG or SVG
PNG is the right pick for embedding in documents and slide decks. SVG is the right pick for print, since it scales to any size without losing sharpness.
Frequently asked
Which format should I pick for a retail product?
EAN-13 for products sold outside North America (13 digits). UPC-A for products sold in the US and Canada (12 digits). CODE128 is a logistics format, not a retail format, and most point-of-sale scanners will not read it.
Can I encode letters in a CODE128 barcode?
Yes — CODE128 supports the full ASCII printable set (uppercase, lowercase, digits, punctuation). It is the most flexible 1D barcode format and the right pick for shipping labels, inventory tags, and asset tracking.
Why is the output blurry when I print it?
Print a vector SVG, not a PNG. Barcodes need sharp edges to scan reliably; any rasterization blurs the bars and the scanner fails. SVG scales to any DPI without quality loss.
What is the minimum width a printed barcode needs to be?
Aim for at least 1.5 inches (38 mm) wide for a standard EAN/UPC. Smaller than that and most phone scanners will struggle. The quiet zones (blank margins on each side) need to be at least 10 times the narrowest bar width.
Does the generator add the human-readable number under the barcode?
Yes — the value is rendered below the bars in a small monospace font. Toggle it off in the options if your label already prints the value separately or if you want a denser bar pattern.
Limitations
- 1D barcodes onlyThis tool generates 1D barcodes (CODE128, EAN-13, UPC-A). QR codes and Data Matrix are 2D formats and need a separate generator — try the QR Code Generator for those.
- No batch generationOne barcode at a time. For sequences (a thousand inventory tags), use the API or run the underlying jsbarcode library in a local script — the JS package accepts an array and writes PNGs in a loop.
- No scanner verificationThe generator cannot verify that the printed barcode is scannable. Always test with a real phone scanner before printing 10,000 labels — quiet zone violations and low contrast ink can defeat the encoding.
Platform notes
- macOS
- Generated SVGs open in Preview and print at any size. For embedding in a Keynote deck, drag the PNG directly into a slide. macOS's built-in camera cannot scan barcodes; use a phone scanner app.
- Windows
- Edge, Chrome, and Firefox all render the SVG output. The Snipping Tool cannot scan barcodes; use a phone scanner app or a dedicated USB scanner for verification.
- Linux
- LibreOffice Draw and Inkscape both open the SVG output. For command-line batch generation, the underlying jsbarcode library is the same code path; install it via npm and pipe a CSV into a loop.
- iOS
- iOS Shortcuts can read barcode values via the 'Get barcode from image' action. The generated PNG imports cleanly into Numbers, Pages, and Keynote slides for label printing workflows.
- Android
- Android's camera and Google Lens scan both 1D and 2D barcodes reliably. The generated SVG prints via any modern Android print service that supports vector formats.