Barcode Generator

Type a value, pick a symbology and download a crisp SVG or PNG barcode, with live validation and automatic EAN check digits.

Barcodes are rendered locally in your browser by the bundled JsBarcode library. Your codes never leave your device.

How It Works

The tool embeds the open-source JsBarcode library directly in the page bundle, so rendering is local. You type a value, pick a symbology, and an SVG is drawn live; numeric retail formats get light preprocessing (left-padding, check-digit math) so partially typed codes still render, with the computed digit shown above the barcode.

What the EAN-13 check digit prevents
The 13th digit is a modulo-10 weighted sum (positions alternate ×1 and ×3). Any single-digit error changes the sum, and swapping two adjacent digits changes it too — the two mistakes that dominate keyboard and scanner errors. A wrong code then fails the check instead of silently ordering the wrong product, which is why the generator computes and prints it for you when you type 12 digits.
Retail codes vs internal codes
EAN-13, EAN-8 and UPC-A are the retail languages: fixed digit counts, guard bars for omnidirectional scanners, and number space administered by GS1. CODE128, CODE39, ITF and Codabar are the logistics workhorses — arbitrary content, no registry, used for pallets, shelves, assets, patient wristbands and library cards. Pick by audience: cashiers need EAN/UPC, your warehouse just needs something unique and scannable.
The knobs that decide readability
Bar width sets the narrowest bar in pixels (bigger = easier scan, wider label), height gives the scanner headroom, and margin adds the quiet zone — the blank border without which many scanners misread the first and last bars. displayValue prints the human-readable digits below, standard on retail codes and worth keeping as a fallback when a label smudges.

Frequently Asked Questions

Will the barcodes generated here actually scan?

Yes, if printed reasonably. EAN and CODE128 render at any size, but scanners need a minimum module width: keep the bar-width option at 2 or above, print at 100% scale, and aim for at least 25–30 mm wide for a small label. Test with a phone camera before a print run; if a 1-inch code is unreadable, increase width and height rather than density.

What is the final digit on EAN and UPC codes?

It is a modulo-10 check digit, not data: each digit is weighted alternately 1 and 3, summed, and the check digit is what brings the total to the next multiple of 10. It catches the two most common scanner/keying mistakes — single typos and adjacent transpositions — so a mis-scanned product almost never silently becomes a valid other product.

Can I use random numbers on products I sell?

For retail sale through normal channels, no. EAN-13 prefixes identify the issuing GS1 member organization, so a made-up 590... code claims a Hungarian company prefix. Get your own prefix from GS1 (or a reputable reseller where allowed) for packaging. Random digits are perfectly fine for internal labels, inventory bins and prototypes — which is what CODE128 and ITF exist for.

Which format should I pick?

Retail product: EAN-13 (UPC-A in North America). Internal asset or shipping labels: CODE128 — it covers all 128 ASCII characters and packs densely. Simple alphanumeric tags printable from a plain dot-matrix: CODE39. Pairs of digits for printed industrial labels: ITF. Libraries, blood banks and some payment slips: Codabar.

Is anything uploaded to a server?

No. The barcodes are drawn by the JsBarcode library running as a bundled script inside your browser tab; your product codes never leave the device, and there is no API call involved at any point.