About the Barcode Generator
The Barcode Generator draws a one-dimensional barcode from a number or a piece of text, ready to print on labels, packaging, tickets or inventory tags. Choose the barcode type, type the value, adjust the bar width, height, margin and colors, and download a PNG or a sharp SVG.
It supports the formats most people need: UPC-A and UPC-E for retail products in the US and Canada, EAN-13 and EAN-8 for retail worldwide, ITF-14 for shipping cartons, Code 128 and Code 39 for warehouse labels and asset tags, plus ITF, Codabar, MSI Plessey and Pharmacode. For the retail formats, the check digit is calculated for you, and a wrong one is caught with the correct digit shown.
A barcode image is only the drawing of a number. To sell products in stores, the UPC or EAN number itself must come from GS1, the organization that assigns them. The drawing happens entirely in your browser.
How to use it
- Pick the barcode typeChoosing a type fills in a working sample value, and the hint under the field says what the type accepts.
- Enter your valueType the number or text. For UPC, EAN and ITF-14 you can leave off the last digit and the tool adds the check digit.
- Adjust the sizeSet the bar width (the narrowest bar, 1 to 5 pixels), the height and the margin around the bars.
- Choose colors and textKeep dark bars on a light background, and decide whether the value is printed under the bars.
- DownloadSVG for print and label software, or PNG at twice the on-screen size for documents and web pages.
Key features
11 formats
Code 128, EAN-13, EAN-8, UPC-A, UPC-E, Code 39, ITF-14, ITF, Codabar, MSI Plessey and Pharmacode.
Automatic check digits
UPC-A, UPC-E, EAN-13, EAN-8 and ITF-14 accept the value without its check digit and add it, using the standard GS1 calculation.
Clear error messages
A wrong check digit names the right one, a wrong length says how many digits to use, and invalid characters are flagged.
Vector and image output
SVG scales to any size without blur; PNG is drawn at double resolution.
Full control of the look
Bar width, height, margin, bar and background colors, and the human-readable text on or off.
Private by design
No upload and no account. Barcodes are drawn with the open-source JsBarcode library on your device.
Examples
Check digits added for you
| Type | You enter | Printed value |
|---|---|---|
| EAN-13 | 590123412345 | 5901234123457 |
| UPC-A | 03600029145 | 036000291452 |
| ITF-14 | 1540014128876 | 15400141288763 |
| UPC-E | 123456 | 01234565 |
The check digit lets a scanner catch a misread. Type the full EAN-13 5901234123458 instead, and the tool says "The check digit is wrong. The last digit should be 7." Type only 11 digits, and it asks you to "Use 12 digits, or 13 including the check digit."
Which type to use
| Use | Type | Accepts |
|---|---|---|
| Retail products, US and Canada | UPC-A | 11 or 12 digits |
| Retail products, rest of the world | EAN-13 | 12 or 13 digits |
| Very small packages | UPC-E or EAN-8 | 6 or 8, and 7 or 8 digits |
| Shipping cartons | ITF-14 | 13 or 14 digits |
| Labels, SKUs, asset tags | Code 128 | Any plain ASCII text |
| Older systems, ID badges | Code 39 | A-Z, 0-9, space and - . $ / + % |
Text formats
Code 128 takes letters, digits, spaces and symbols, so Order 1234, Box 2/3 works as is. Code 39 only has capital letters, so part 39-a is printed as PART 39-A, and a character it does not have, such as # in PART#39, gives "This value cannot be encoded in this barcode type." Accented letters like the é in Café are not available in Code 128 here; the tool asks you to use plain ASCII.
The small formats
UPC-E squeezes a UPC-A with several zeros into 8 digits. 04252614 is valid: number system 0, the six digits 425261, and check digit 4. Pharmacode, used on medicine packaging, stores a single number from 3 to 131070, so 131071 is rejected.
Tips
- Leave a clear margin on both sides. Scanners need a quiet zone of about 10 bar widths for Code 128, 11 on the left and 7 on the right of an EAN-13, and 9 on each side of a UPC-A. The default margin of 24 pixels with 2-pixel bars gives 12.
- Print at a bar width your printer can reproduce exactly. On thermal label printers, choose whole printer dots and use the SVG in the label software.
- Keep bars black or very dark on a white or light background. Red bars are invisible to many laser scanners, which use red light.
- Test-scan a printed sample with a real scanner or a phone app before printing a full run.
- For links, Wi-Fi details or anything longer than a short code, a QR code holds far more data. Use the QR Code Generator.
Common mistakes and limits
- Making up a UPC or EAN numberRetailers and marketplaces check that product numbers belong to your company. Get a GS1 company prefix or numbers from GS1 US, then draw them here.
- Shrinking the barcode too muchRetail barcodes have a minimum size. EAN-13 and UPC-A can be scaled down to about 80% of their standard size, and cutting the bar height makes them harder to scan.
- Using Code 39 for long valuesCode 39 is wide: each character takes much more space than in Code 128. For the same label width, Code 128 fits more.
- Expecting this to be GS1-128Shipping labels with application identifiers like (01) or (10) use GS1-128, which needs a special start character. This tool makes plain Code 128.
- Stretching a PNGResizing a PNG in another program blurs the bar edges. Download the SVG, or set the bar width and height here instead.