Create Code 128, EAN-13, UPC-A, EAN-8, Code 39, ITF and ITF-14 barcodes, with check digits calculated for you, and download them as SVG for print or PNG for screens.
Runs entirely in your browser. Nothing you type or upload is sent to a server.
How a barcode is read
A one-dimensional barcode is a sequence of bars and spaces whose widths encode characters. A scanner sweeps across it, measures each width relative to the narrowest one, and looks the pattern up in the format's table. Because only the ratios of widths matter, a barcode can be printed large or small, as long as the narrowest bar is still wide enough for the scanner to resolve.
Every barcode starts and ends with a special start and stop pattern, so the scanner knows where the data is and which way round it is reading. On either side there must be a blank margin called the quiet zone, at least ten times the width of the narrowest bar for most formats. GS1 sets the retail minimums: 11 bar widths on the left of an EAN-13 and 7 on the right, 9 on each side of a UPC-A, and 7 on each side of an EAN-8. This generator always leaves at least that much. Trimming that margin to save space is the single most common reason a perfectly good barcode will not scan.
Choosing a format
| Format | Encodes | Used for |
|---|---|---|
| Code 128 | All 128 ASCII characters | Shipping labels, inventory, asset tags, tickets. The best default. |
| EAN-13 | 13 digits | Retail products worldwide, plus books (ISBN) and magazines |
| UPC-A | 12 digits | Retail products in the United States and Canada |
| EAN-8 | 8 digits | Retail packages too small for an EAN-13 |
| Code 39 | A to Z, 0 to 9 and - . space $ / + % | Older industrial, automotive and government systems |
| ITF | Digits, in pairs | Warehouse and industrial labels with an even number of digits |
| ITF-14 | 14 digits, the last a check digit | Corrugated shipping cartons holding retail products |
Code 128 is compact because it switches between character sets as it goes, packing long runs of digits two to a symbol. Code 39 is wider for the same data but needs no check digit, because every character is self-checking, which is why older equipment still relies on it.
Product barcodes need a GS1 number
Drawing a UPC or EAN is easy. The number inside it is the part that matters. Retail barcodes carry a GTIN (Global Trade Item Number), and each one must identify exactly one product in the world. GS1, the nonprofit that runs the system, licenses company prefixes and individual numbers. Major retailers and online marketplaces check GTINs against the GS1 database and reject numbers that do not belong to the seller. For internal labels that never leave your business, use Code 128 with any numbering you like.
How check digits work
EAN and UPC numbers end in a check digit calculated from the others. For UPC-A, multiply the digits in odd positions by 3, add the digits in even positions, and pick the digit that brings the total up to a multiple of ten. For 03600029145:
0×3 + 3 + 6×3 + 0 + 0×3 + 0 + 2×3 + 9 + 1×3 + 4 + 5×3 = 58
58 + 2 = 60, a multiple of 10, so the check digit is 2 → 036000291452EAN-13 does the same with the weights reversed, 1 and 3 starting from the left. A single misread digit, or two neighboring digits swapped, almost always changes the result, so the scanner rejects the read instead of ringing up the wrong product. Type the number without its last digit and this generator calculates it for you.
Printing barcodes that scan
- Use the SVG for print. It is a vector, so bar edges stay perfectly sharp at any size. A small PNG scaled up gets blurry edges that change the bar widths.
- Black on white works best. Avoid red, orange and yellow bars: most scanners read with red light, under which those colors look as light as the paper.
- Do not stretch a PNG to fit. Scaling a bitmap by an uneven amount resamples the bars to different pixel widths, which blurs the ratios the scanner measures. Resize the SVG instead, or use the bar width setting, and never shrink a barcode so far that the narrowest bar is too thin for the scanner to see.
- Keep the quiet zone on both sides, and keep the human-readable digits underneath so a cashier can type the number if a label is damaged.
Need to store a link, WiFi details or more than a short code? Use the QR Code Generator instead.

