Skip to the tool
UPC Generator

Barcode generator

Barcode formats hold very different things: EAN-8 takes 8 digits and Data Matrix takes up to 3,116 digits. As you type, the list shows which of 10 formats can hold your text, and the one you pick is drawn live.

Or pick a format

1.858 in (47.19 mm) wide by 0.734 in (18.64 mm) tall, clear space included

Code 128 barcode ABC-12345

For a product you will sell, use a number licensed through GS1 if your retailer or marketplace asks for one, and many do. Never present a number you made up as a real product's code. For your own stock, assets, tests and mock-ups, any format here is yours to use. Where a licensed number comes from, and what it costs, is in how to get a UPC code.

  • Narrow bar: 0.33 mm (13 mil)
  • Clear space: 0.13 in (3.3 mm) left, 0.13 in (3.3 mm) right at minimum
  • PNG at 300 dpi: 572 by 221 dots, narrow bar 4 dots, so it prints at 0.339 mm
More options
Show sizes in

By the UPC Generator team. Sample files in all 10 formats are read back by decoding programs. The SVG, PNG and PDF files are also read by Apple's Vision framework. Last updated 4 November 2026. How UPC Generator pages are made.

Which barcode format fits which job

The formats, what each holds and the clear space it needs
Format Holds Usual job Clear space
UPC-A 12 digits Products in US and Canadian stores 9 modules each side
UPC-E 8 digits Small packs in those stores 9 left, 7 right
EAN-13 13 digits Products elsewhere, and books 11 left, 7 right
EAN-8 8 digits Very small packs 7 each side
Code 128 Any ASCII text Stock, bins, shipping labels 10 each side
Code 39 43 characters Older label systems that name it 10 each side
ITF-14 14 digits Shipping cartons 10 each side
Data Matrix Up to 1,556 bytes Tiny parts, medical items 1 all round
PDF417 About 1,100 bytes Long records on a label 2 all round
QR Code Up to 2,331 bytes at the error correction level set here Links for phones 4 all round

The format list runs this test on your own text as you type. A format with a dashed outline cannot hold what you typed, and it says what it needs. Click it anyway to see the full reason.

Barcode sizes in real units

A printer cares about the width of the narrowest bar, so that is the size control here, and everything else follows from it. The size readout gives the full width and height in millimeters or inches, with clear space included.

For the retail formats, GS1 sets the range: a 0.264 mm to 0.66 mm narrow bar. Cartons have their own range, from 0.495 mm to 1.016 mm. Code 128 and Code 39 have no GS1 size outside the supply chain, and 0.33 mm is a good place to start.

What the three file types are for

The PDF draws black bars in device gray and any color you pick in RGB, never CMYK. A print shop that works in CMYK converts the file, and black stays black.

SVG, PNG and PDF: which file suits which job
File Best for Why
SVG Designers, web, cutting machines Pure vector, with digits drawn as shapes so no font can go missing
PDF Print shops, page layouts Vector, with the page cut to the exact barcode size
PNG Label printers, Word, spreadsheets Whole printer dots, with the resolution stored so it places at true size

Colors that scan and colors that do not

A typical scanner reads under red light, around 660 nm, which is the light GS1 specifies for grading. Under red light, red bars look the same as white paper and vanish, and a pale blue background turns dark. Black on white is safest, and dark blue or dark green bars work on a white or pale yellow background. Light bars on a dark background fail on most retail scanners. The tool warns you about colors that look risky under red light, though that is only a rough check. A real test on your printer settles it.

Tools for one code and for a whole list

Each format also has a tool built around its own job. The UPC generator reads the opening digits of your number, and the ITF-14 tool builds a carton number from your item number. The SKU generator turns product options into a full list. To test a number you were given, try the check digit calculator.

Before the first print

How barcodes work follows a read from the red light to the number that reaches the till. Making a barcode from the number up compares every route, this one included, and says which number each job needs. Designers can place a barcode from here into a Canva layout without losing sharpness. A phone is enough to check a printed sample before a run. The story of the first checkout scan is in who invented the barcode.

Barcode generator questions

Is this barcode generator really free?

Yes, and bar code with a space means the same thing. There is no sign-up, no watermark, no limit on how many you make, and no rule against commercial use of the files. The barcodes are drawn in your browser, so your text never reaches a server.

Which barcode should I use?

It depends on the job. Use UPC-A or EAN-13 on products for sale and ITF-14 on cartons. Use Code 128 on your own labels, Data Matrix on tiny parts and QR Code for phones. The What is it for? box picks the usual format for you.

Can I use these barcodes on products I sell?

The files will work, but the number inside matters. Walmart Marketplace checks every number against GS1's records and removes listings that fail, and GS1 says many retailers want numbers that come from it. A made-up number can also clash with a real product.

Why won't my barcode scan?

Check these first: artwork too close to the bars, or a file stretched to fit a space. Another cause is colored bars that vanish under a scanner's red light. Then check for a wrong check digit or a scanner with that format turned off. Read the warnings beside the barcode, then print the test sheet.

What file format should I download?

SVG or PDF for designers and print shops, because they stay sharp at any size. PNG for label printers, Word and spreadsheets. Set the PNG to your printer's resolution so the bars land on whole printer dots.

What is the difference between a 1D and a 2D barcode?

A 1D barcode, such as UPC or Code 128, is read across a single line and holds little. A 2D code, such as Data Matrix or QR, is read as a picture and holds far more. It needs a camera-type scanner rather than a laser.

Can I make many barcodes at once?

One at a time here. For a list of stock codes, the SKU generator builds the whole list as a CSV and draws any one of them as a barcode.

6 source documents

  1. GS1: General Specifications, Release 26.0, sections 5.2, 5.3, 5.6 and 5.12, fetched 2 November 2026
  2. GS1 US: How to get a UPC barcode, with prefix pricing, fetched 2 November 2026
  3. GS1 US: What is a GS1 Company Prefix, fetched 2 November 2026
  4. Walmart Marketplace: Choose a product identifier, fetched 2 November 2026
  5. bwip-js: Barcode writer library for the 2D formats, MIT license, version 4.11.4, fetched 2 November 2026
  6. Apple: Vision framework barcode detection, fetched 2 November 2026