Utilities

Barcode Generator

Create scannable barcodes in Code 128, EAN-13, UPC-A, Code 39, ITF-14 and more, with check digits added for you. Download SVG or PNG, or copy the image.

Code 128: Shipping labels, asset tags, inventory and most general uses. The safe default.

Any standard ASCII text: letters, digits, spaces and punctuation.

2px
100px
10px
20px

Scanners need dark bars on a light background with clear space either side.

About this tool

The Barcode Generator turns a number or text into a barcode you can print or place in a design. Choose from retail formats (EAN-13, UPC-A, EAN-8 and UPC-E), general-purpose Code 128, Code 39 and Code 93, shipping formats ITF-14 and Interleaved 2 of 5, and specialist Codabar, MSI Plessey and Pharmacode. Each format explains what it is used for and what it accepts, the value is checked as you type, and check digits are calculated for you where the format has one. Adjust the bar width, height, quiet zone, text size, and bar and background colours, or make the background transparent. Download a crisp SVG for print and design work, a PNG at up to four times the size, or copy the PNG straight to your clipboard. Barcodes are generated in your browser.

How to use the Barcode Generator

  1. Pick a format. Use EAN-13 or UPC-A for retail products, and Code 128 for almost anything else.
  2. Type the value. For EAN and UPC you can leave off the check digit and it will be added.
  3. Adjust the bar width, height, margin, text and colours.
  4. Click Download SVG for print, or Download PNG at the size you need.
  5. Or click Copy PNG to paste it straight into another app.

Use it from your code

The Barcode Generator is also a REST API endpoint. Create a free API key and call it from your own scripts and apps.

# Save a PNG
curl -X POST https://opentools.ca/api/v1/tools/barcode-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"symbology": "EAN13", "value": "590123412345", "scale": 2}' \
  -o barcode.png

# SVG
curl -X POST https://opentools.ca/api/v1/tools/barcode-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value": "OpenTools-2026", "format": "svg"}' \
  -o barcode.svg

Give us your feedback

Help us improve Barcode Generator!

Frequently asked questions

Which barcode format should I use?

For products sold in shops, use the EAN-13 or UPC-A number you were assigned. For your own labels, asset tags, tickets or inventory, Code 128 is the best choice: it is compact, reads reliably and accepts letters, digits and punctuation.

Can I make my own EAN or UPC numbers?

You can generate a barcode for any valid number, but products sold through retailers need a number registered with GS1, the organisation that issues them. Made-up numbers can clash with real products.

What is the check digit?

The last digit of an EAN, UPC or ITF-14 code is calculated from the others so scanners can catch misreads. Type the number without it and the generator works it out, or type the full number and it is checked.

SVG or PNG?

SVG is a vector file that stays sharp at any size, so it is best for print and design tools. PNG is an image that works everywhere; choose 2x or 4x for a larger, sharper file.

Why won't my barcode scan?

Scanners need strong contrast, so keep dark bars on a light background, leave the quiet zone (margin) either side, and do not print it too small. Coloured or transparent backgrounds can fail on some scanners.

Barcode Generator screenshot