Barcode Generator
Code 128, Code 39, EAN-13, UPC-A and ITF-14 — check digits computed, patterns verified, exported as SVG or PNG.
Full ASCII, compact, checksum built in. The default choice for asset tags, shipping and anything alphanumeric.
Which symbology should I use?
| Format | Character set | Choose it when |
|---|---|---|
| Code 128 | Full ASCII (128 chars) | You need letters, digits and symbols in one code and want the narrowest barcode that does it. It carries an internal mod-103 check character, so it is the safest general-purpose choice for asset tags and labels. |
| Code 39 | 0-9, A-Z, - . space $ / + % | You need something a human can also read and a legacy system expects it. It is self-checking and does not need a check character, but it is roughly 30% wider than Code 128 for the same data. |
| EAN-13 | 13 digits | Retail products. The first digits identify the GS1 member country or company, and the 13th is a check digit. It must be exactly 13 digits — nothing else is legal. |
| UPC-A | 12 digits | Retail in the United States and Canada. Structurally identical to EAN-13 with a leading zero, which is why the two scan interchangeably in most systems. |
| ITF-14 | 14 digits | Shipping cartons and cases. Digits are encoded in pairs, which makes it compact for purely numeric data, but it is printed inside a thick “bearer bar” frame because a partial print can otherwise be misread. |
Check digits are not optional
For EAN-13, UPC-A and ITF-14 the last digit is a mod-10 checksum over the digits before it. If you supply all the digits, this tool verifies the check digit and tells you when it does not match rather than silently encoding a barcode that scanners will reject. Supply one digit fewer and the correct check digit is computed and appended for you — that is usually what you want when you are allocating your own numbers.
Code 39 has an optional mod-43 check character. It is off by default because the symbology is already self-checking, but many warehouse and automotive standards require it, so there is a switch for it.
Printing it so it actually scans
- Respect the quiet zone. A barcode needs blank space on both sides, at least 10 modules wide for the linear formats here. Print it too close to a label edge and scanners fail for no obvious reason.
- Keep the module size sane. Below about 0.25 mm per module most laser scanners start struggling. If the barcode comes out too wide, encode less data rather than shrinking it.
- Do not scale non-uniformly. Stretching a barcode horizontally changes the bar widths and breaks decoding. Export at the size you need.
- Use SVG for print. PNG at 4× is fine for screens; vector output has no resolution limit and is what a print workflow wants.
- Prefer two-colour contrast. Dark bars on a light background. Inverted barcodes are rejected by many scanners.
FAQ
Can I encode text with accents or non-Latin characters?
Not in these symbologies — they predate Unicode. Code 128 covers ASCII 32–126, Code 39 covers a smaller subset, and the retail formats are digits only. For non-Latin text use a 2D symbology such as QR, which encodes UTF-8.
Will the barcode I generate scan?
The bar patterns here follow the published standards and the check digits are verified against them, so the encoding is correct. Whether a specific scanner reads your print depends on size, contrast and print quality — always test with the scanner you intend to use.
Is anything uploaded?
No. Every pattern is generated by local JavaScript and drawn as SVG in the page. Downloading is a plain in-browser blob, so your data never leaves the device.
Why does ITF-14 need an even number of digits?
Because interleaved 2 of 5 encodes two digits at once — the bars carry one digit and the spaces carry the next. An odd count has nothing to pair with, so the standard fixes the length at 14.