Barcode Generator
Generate barcodes in Code128, EAN-13, UPC, and more.
For retail scanning, keep bar width ≥ 2 and print at 100% scale — sub-300-DPI output may fail to scan reliably.
What is a Barcode Generator?
A barcode generator takes a piece of text or a string of digits and renders it as the machine-readable striped image that scanners decode. Different barcode formats encode different data — some take any ASCII character, some only digits, some only a fixed length. The right format depends on where the barcode will live: a warehouse slap-on, a retail POS, a pharmacy dispensary, a shipping label. Our generator covers the seven formats that cover ~95% of real-world requests.
Code 128 is the general-purpose workhorse. It accepts any ASCII character, auto-switches between three sub-sets (A, B, C) for best density, and is what most non-retail barcode systems use by default — shipping labels, warehouse bins, internal asset tags. Code 39 is older and less dense but still widely readable; it accepts uppercase letters, digits, and a handful of punctuation marks. It's the format of choice for badges and ID cards.
Retail sits in the EAN/UPC family. EAN-13 is the 13-digit code used worldwide on consumer goods (the 13th digit is a checksum). UPC-A is the 12-digit North American equivalent; the first six digits are the manufacturer code, the next five are the product, the last is checksum. EAN-8 is a short 8-digit variant for small products where EAN-13 does not fit physically. If you're building consumer goods that will ship through retailers, you need a GS1 prefix — you cannot just invent an EAN. For internal use or testing, any valid digit string produces a scannable image.
ITF-14 is the 14-digit Interleaved 2-of-5 code used on shipping containers (cases of retail goods). It encodes the packing hierarchy prefix plus the item EAN. Codabar is a legacy format still used in blood banks, libraries, and some photo-developer workflows. It accepts digits and four special characters (A, B, C, D) as start/stop delimiters.
Design choices affect scan reliability. Bar width (the width of the thinnest bar) must be at least 2 pixels in a printed barcode to survive laser scanners reliably; we default to 2 and go up to 6. Height should be at least 25% of the barcode width — shorter bars are hard to align. Contrast should be strong; stick to dark bars on a light background. Quiet zone (white space at either end) is mandatory; we add one by default.
The generator outputs crisp SVG (use for print) and PNG (use for web). Both are ready to paste into documents or embed in CMSes. Privacy: the barcode renders entirely in your browser via the jsbarcode library — nothing you encode is transmitted or logged.
How to generate a barcode
- Pick a format. Code 128 for general use, EAN/UPC for retail, Code 39 for badges.
- Enter the value. Digit length matters for EAN/UPC/ITF; the tool shows an error if the input is invalid.
- Tune the bar width and height. Width 2+ for print, higher for rough surfaces.
- Toggle the text label if you want the decoded value printed under the bars.
- Adjust colour if needed. High contrast on light background scans best.
- Download SVG or PNG — SVG scales perfectly for print, PNG is easier for HTML embeds.
Features
- Seven formats: Code 128, Code 39, EAN-13, EAN-8, UPC-A, ITF-14, Codabar.
- Adjustable bar width, height, colour, and optional text label.
- SVG for print, PNG for web — both download-ready.
- Checksum handling built in for EAN/UPC/ITF formats.
- Runs entirely in your browser; no uploads, no tracking.
Frequently asked questions
- Can I use this for retail products?
- For testing yes; for shipping real products into retail channels you need a registered GS1 prefix so your EAN/UPC is globally unique. You can generate a scannable barcode with any valid digit string, but retailers' systems will reject codes that don't trace to a registered owner.
- Which format should I pick?
- Code 128 for general-purpose internal use (warehouses, asset tags, shipping labels). EAN-13/UPC-A for consumer goods. ITF-14 for shipping containers of retail goods. Code 39 for ID badges and low-density requirements. Codabar only if an old system specifically requires it.
- Why won't my EAN-13 save?
- EAN-13 requires exactly 12 or 13 digits (we compute the checksum if you provide 12). Any letter, punctuation, or a length mismatch produces an error. Copy the 12-digit product identifier without spaces or the check digit.
- Does it support 2D barcodes like QR?
- Not in this tool — it's 1D (linear) barcodes only. For QR codes, use our dedicated QR Code Generator. For Data Matrix or PDF417, drop us a note via Contact.
- How small can I print it?
- Each format has an X-dimension minimum (the narrowest bar). For retail scanners, 0.26 mm is the EAN-13 absolute minimum. Practically, size the image so the narrowest bar prints at 0.33–0.66 mm. Our 'bar width' slider sets pixels; factor in your printer's DPI.
- Is my data private?
- Yes. The barcode renders entirely in your browser; nothing is sent to our servers. Safe for internal SKUs, product codes, and sensitive identifiers.