# Barcode Generator — Code 128, EAN-13, UPC-A, Code 39 & ITF

> Generate scannable retail and logistics barcodes, with the check digit and print size checked as you type.

A barcode generator turns a number or short string into the bar and space pattern a scanner reads. Retail codes — EAN-13, EAN-8, UPC-A — end in a check digit computed from the others, and this calculates it for you, or refuses the input if you supplied one that does not match. The output is SVG, so it stays sharp at any print size.

**URL:** https://convertto.tech/t/barcode-generator
**Category:** QR & Barcodes (https://convertto.tech/c/qr-tools)
**Privacy:** Runs entirely in the browser; no upload
**Cost:** Free, no sign-up
**Last updated:** 2026-08-01

## Key facts

- **Output:** SVG — sharp at any size, unlike a fixed-resolution PNG
- **Check digits:** Calculated automatically, and verified if you supply one
- **Print check:** Bar width in real millimetres, quiet zone and contrast
- **Symbologies:** Code 128, EAN-13, EAN-8, UPC-A, Code 39 and ITF-14
- **Privacy:** Runs entirely in your browser — nothing is uploaded
- **Cost:** Free, unlimited, no sign-up

## Which symbology to use

A barcode symbology is a grammar, not a format. Each one accepts a different character set, a different length, and is read by a different set of hardware, so the choice is usually made for you by whatever system has to scan the label.

| Symbology | Encodes | Used for |
| --- | --- | --- |
| EAN-13 | 13 digits, the last a check digit | Consumer products sold at retail worldwide. The number is allocated by GS1 to a registered company, not invented. |
| EAN-8 | 8 digits | Small retail packaging with no room for a full EAN-13. |
| UPC-A | 12 digits | Retail in the United States and Canada. A scanner reads it as an EAN-13 with a leading zero. |
| Code 128 | The full ASCII set, variable length | General-purpose logistics and internal labelling. Its numeric code set packs two digits into one symbol character, so digit strings stay compact. |
| Code 39 | Digits, A to Z uppercase, space and `- . $ / + %` | Older industrial, defence and identity-card systems. Self-checking, but noticeably wider than Code 128 for the same data. |
| ITF-14 | 14 digits | Shipping cartons carrying a GTIN-14. Tolerant enough to be printed directly on corrugated board. |

*Code 128 is the right default for anything internal. The retail symbologies exist to carry a GS1 number, not to carry text.*

## The check digit

EAN-13, EAN-8, UPC-A and ITF-14 all end in a check digit derived from the digits before it. Positions are weighted alternately by one and three, the weighted values are summed, and the check digit is whatever brings that total up to the next multiple of ten. A scanner recomputes it on every read and discards the scan when it disagrees.

That is the only error detection a linear barcode has, which is why a wrong check digit produces **no scan at all** rather than a wrong one. The generator computes it for you, and if you supply the full number it verifies the digit you gave rather than quietly replacing it.

> **An invented retail number is not yours** — Any thirteen digits with a correct check digit will produce a symbol that scans. EAN and UPC numbers are allocated by GS1, and the leading digits identify a prefix and a registered company, so an invented number may already belong to somebody else. Fine for a test fixture, not for anything going on a shelf.

## Printing one that scans

- Keep the quiet zone. Every symbology needs a blank margin either side, specified in modules rather than millimetres, and it is not symmetric for EAN and UPC. Cropping it is the most common reason a printed code fails.
- Respect the module width. Below roughly a quarter of a millimetre per module, ink spread on thermal and flexographic printing starts merging adjacent bars. Check the printed width, not the on-screen one.
- Never scale non-uniformly. Stretching the symbol horizontally changes the ratio between wide and narrow elements, which is exactly what the decoder measures.
- Print dark bars on a light ground. Red and orange bars are invisible to a red-light laser scanner, and a glossy laminate adds glare that defeats imagers.
- Export vector. The output here is SVG so the bar edges stay on exact boundaries at any size, which a resampled PNG cannot guarantee.

To check a finished label, decode it back with the [barcode reader](https://convertto.tech/t/barcode-to-text) and confirm the string matches what you typed. For anything that needs to carry more than a number, a [QR code](https://convertto.tech/t/qr-code-generator) holds arbitrary text rather than a fixed-length key.

## How to use

1. Choose the barcode type your system expects.
2. Enter the number or text to encode.
3. Set the bar width and height for your label size.
4. Copy the SVG, or save it and place it in your artwork.

## FAQ

### Why will my barcode not scan?

Three causes account for almost all of it. The quiet zone — the blank margin either side — has been cropped, and scanners genuinely need it. The bars are too narrow for the printer, so ink spread merges them; below about 0.25mm per module, thermal printing becomes unreliable. Or the barcode has been scaled non-uniformly, which changes the ratio between wide and narrow bars.

### Can I make up my own EAN-13 number?

You can generate a valid symbol from any digits, and it will scan. But EAN and UPC numbers are allocated by GS1 — the leading digits identify a country prefix and a registered company. An invented number may already belong to somebody else, so it is fine for internal testing and not for anything sold in a shop.

### Which barcode type should I use?

Code 128 for anything internal — it takes letters and numbers and is compact. EAN-13 or UPC-A only if you have a GS1-allocated number for retail sale. ITF-14 for shipping cartons, where the barcode is printed on corrugated board and needs the extra tolerance. Code 39 only when an existing system demands it; it is bulky and largely superseded.

### Why does the check digit matter so much?

It is the only error detection a linear barcode has. A scanner recomputes it from the digits it read and rejects the scan if it disagrees, which is what stops a misread turning into the wrong product at a till. A barcode with a wrong check digit does not scan incorrectly — it simply does not scan.

## Sources

- [GS1 barcodes: EAN/UPC](https://www.gs1.org/standards/barcodes/ean-upc) — GS1
- [GS1 General Specifications](https://www.gs1.org/standards/barcodes-epcrfid-id-keys/gs1-general-specifications) — GS1

## Related tools

- [Barcode Reader](https://convertto.tech/t/barcode-to-text): Read a code from a photo, a screenshot or your camera, entirely in your browser.
- [QR Code Generator](https://convertto.tech/t/qr-code-generator): Design QR codes with custom shapes, gradients and a logo, and check they will still scan.
- [Business Card QR to vCard](https://convertto.tech/t/business-card-to-vcard): Decode the QR code on a business card and save the contact as a .vcf file for any address book.
- [QR Code to Text](https://convertto.tech/t/qr-to-text): Pull the raw text, link or data out of a QR code image, and check it before you act on it.
- [Markup & Margin Calculator](https://convertto.tech/t/markup-margin-calculator): Convert between markup and margin — they are not the same number, and confusing them costs money.
- [QR Code Reader](https://convertto.tech/t/qr-code-reader): Decode a QR code from an image or your camera, and check the link before you open it.
- [vCard Generator](https://convertto.tech/t/vcard-generator): Build a contact card with several numbers and addresses, and get the .vcf plus a scannable QR.
