Barcode Generator

Generate scannable barcodes in Code 128, EAN-13, UPC-A and more.

  • Runs in your browser
  • Free, no sign-up

2 px
90 px
24 px

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

  1. Pick the barcode typeChoosing a type fills in a working sample value, and the hint under the field says what the type accepts.
  2. 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.
  3. Adjust the sizeSet the bar width (the narrowest bar, 1 to 5 pixels), the height and the margin around the bars.
  4. Choose colors and textKeep dark bars on a light background, and decide whether the value is printed under the bars.
  5. 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

TypeYou enterPrinted value
EAN-135901234123455901234123457
UPC-A03600029145036000291452
ITF-14154001412887615400141288763
UPC-E12345601234565

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

UseTypeAccepts
Retail products, US and CanadaUPC-A11 or 12 digits
Retail products, rest of the worldEAN-1312 or 13 digits
Very small packagesUPC-E or EAN-86 or 8, and 7 or 8 digits
Shipping cartonsITF-1413 or 14 digits
Labels, SKUs, asset tagsCode 128Any plain ASCII text
Older systems, ID badgesCode 39A-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.

Frequently asked questions

Can I use these barcodes on products I sell?
The images are fine, but the numbers must be yours. Retail UPC and EAN numbers come from GS1. Once you have them, this tool draws the barcodes for free.
What is the difference between UPC-A and EAN-13?
UPC-A has 12 digits and is used mainly in the US and Canada. EAN-13 has 13 digits and is used worldwide. A UPC-A number is the same as an EAN-13 with a leading 0, and scanners read both.
What is a check digit?
The last digit of a UPC, EAN or ITF-14 number, calculated from the others. It lets the scanner detect a misread. The tool adds it when you leave it off and flags it when it is wrong.
Which barcode type should I use for inventory?
Code 128 in most cases. It accepts letters, numbers and symbols, is compact, and every modern scanner reads it.
Why is my value rejected?
Each type has its own rules: fixed lengths for UPC and EAN, capital letters only for Code 39, an even number of digits for ITF. The hint under the field shows what the selected type accepts.
Should I download SVG or PNG?
SVG for print, label software and design tools, because it stays sharp at any size. PNG for documents, spreadsheets and web pages.
Can it make QR codes or other 2D codes?
No, only linear barcodes. Use the QR Code Generator for QR codes.
Is anything uploaded?
No. The barcode is drawn in your browser and nothing you type is sent or stored.