How to Create a Barcode: Pick the Right Type, Size It, Print It So It Scans
Which barcode type to pick (EAN, UPC, Code 128), how to make one in a minute, what size and quiet zone it needs to scan, and why shop numbers come from GS1.
Updated November 1, 20268 min read
To create a barcode, choose the type that matches where it will be used, type the number or text, check the preview and download it as PNG or SVG. The type is the part that matters. EAN-13 or UPC-A is for products sold in shops, Code 128 is for stock, shipping and anything internal, and Data Matrix or QR is for small spaces. Making the picture takes a minute. Making one that scans takes the right type, a clear margin and a sensible size, and all of that is covered below.
Which barcode type should you use?
A barcode is not one thing. It is a family of encodings, and a scanner or a system expects a specific one. A perfectly drawn barcode in the wrong type still gets rejected. The barcode generator offers 19 formats grouped by job. These are the ones most people need.
| You are making a barcode for… | Use | What it holds |
|---|---|---|
| A product sold in shops (outside North America) | EAN-13 | 13 digits, the last one a check digit |
| A product sold in the US or Canada | UPC-A | 12 digits, the last one a check digit |
| A very small package | EAN-8 or UPC-E | A shortened retail number |
| Stock, tools, assets, orders, library items | Code 128 | Letters, digits and symbols, in a compact bar |
| Shipping cartons | ITF-14 or GS1-128 | A carton number, or labelled fields such as batch and expiry |
| A very small part or a lot of data | Data Matrix | Text in a tiny square |
| A link people scan with a phone | QR code | Use the QR code generator |
If you are unsure, Code 128 is the safest default for anything that stays inside your own business. It encodes a full range of text, and a run of digits is packed two to a symbol, so numbers stay short. Code 39 is older and only holds capital letters, digits and a few symbols, but nearly every scanner reads it. Pick it when a customer or an old system asks for it by name.
How to create a barcode, step by step
Open the generator and pick the Format
Open the barcode generator. The Format list is grouped as Retail, Logistics, General purpose, Pharmacy and 2-D codes. Choose the one your shop, scanner or customer asked for.
Type the Value
Type the number or text. The hint under the box shows the length and characters that format accepts, for example 12 digits for an EAN-13. For EAN and UPC you can leave the last digit out and the tool works out the check digit and shows the full number.
Choose a size
Pick a size preset: Small, Medium, Large or Print. The tool shows the printed size and the pixel size before you download. Leave the quiet zone as it is.
Set the look
Keep dark bars on a light background. If you want the number printed under the bars, switch on Print the value under the bars. A transparent background is available if you are placing the barcode on a label design.
Download and test
Download PNG for a normal image, or SVG when the barcode goes into a layout that will be printed. Then print one at final size and scan it before you print a hundred.
Make one barcode at a time in any of the 19 formats and download PNG up to 300 dpi or SVG. Free, with no watermark. Pro adds batches of up to 500, PDF and label sheets, and exact print sizing. Everything runs on your device, not our servers.
Create a barcodeReal product numbers come from GS1
This is the part that surprises people. Any tool can draw an EAN-13 for any 13 digits, and it will scan. But the number in a shop barcode identifies one product from one company in a global database, and shops and marketplaces expect that number to be one you own. Companies get them by joining GS1, the organisation that issues the company prefix, and then numbering each product under it. A number you invented may clash with someone else's real product, and a retailer or online marketplace can reject it.
- Selling in shops or on marketplaces that ask for a GTIN: get your numbers from GS1 in your country, then enter them in the generator to draw the symbols.
- Just labelling your own stock: you do not need GS1. Use Code 128 with your own SKUs or part numbers. Nobody outside your business will look them up.
- Practice or a mock-up: any 12 digits work in the preview, but do not print them on packaging for sale.
The tool draws and checks the symbol. It cannot register a number for you or prove that you own one.
Print size and the quiet zone
Barcodes are measured by the X-dimension, the width of the narrowest bar. The nominal X for an EAN-13 is 0.33 mm, which makes the full symbol, including its margins, about 37 mm wide. Code 128 on a shipping label is commonly 0.25 to 0.5 mm. Most of the "will not scan" problems come from a symbol that was shrunk, stretched or cropped after it left the generator.
| Rule | Why it matters |
|---|---|
| Keep the quiet zone | The blank margin either side tells the scanner where the symbol starts. It is about 10 bar widths for Code 128 and 11 on the left of an EAN-13. The generator includes the minimum and will not let you go below it. |
| Do not stretch the picture | Scaling a barcode wider or taller than its proportions changes the bar ratios the scanner reads. |
| Do not go too small | Printers blur very thin bars. The tool warns when the bar width is below what most printers can hold. |
| Dark bars, light background | Scanners read contrast, not colour. A red bar on white can disappear under a red scanner light. |
| Prefer SVG for print | A vector keeps sharp edges at any size. A PNG resized in a document softens exactly the edges the scanner looks for. |
If you are placing the PNG in a document, set it to at least 300 dpi at its final size. See image DPI for printing for how that maps to pixels. To put several barcodes on one printable sheet, drop the images onto a page with Images to PDF.
Check digits and what they catch
Most retail barcodes end with a check digit, calculated from the digits before it. The scanner recomputes it and rejects the read if it does not match, which stops a smudged bar from quietly turning into a different product. In the generator, type 12 digits for an EAN-13, 11 for a UPC-A or 7 for an EAN-8 and the final digit appears for you. Type the full number and it is verified instead. Code 39 has an optional check digit; turn it on only if the system reading the barcode expects one, because otherwise the scanner reports the extra character as data.
Barcode or QR code?
A one-dimensional barcode holds a short number or a short piece of text, and checkout and warehouse scanners read it quickly. A QR code holds much more, such as a web address, and any phone camera reads it. If a person with a phone is the audience, you want a QR code, and QR codes that scan covers how to size one. If a till, handheld scanner or inventory system is the audience, you want a barcode. When space is tight, Data Matrix packs a lot into a small square; the generator lists it under the 2-D codes.
Why a barcode will not scan
- It was cropped. Someone trimmed the white margin in a layout program. Add it back or re-export with the quiet zone included.
- It is too small or too thin. Use a larger size preset, or print on a better printer.
- Wrong type for the scanner. Some older scanners have certain formats switched off. Check what the device is set to read.
- Low contrast or glare. Use black on white, and avoid glossy lamination right over the bars.
- The number is wrong. A scan that beeps but shows the wrong value usually means a typo or a wrong check digit. Compare the scanned value with what you typed.
- Resized as a PNG. Export a larger PNG or use SVG rather than stretching a small image.
To test, scan the printed proof with the actual device that will be used and read the value it returns. A beep alone does not prove the value is right. Generate your own ids first if you need unique values, for example with the UUID generator.
Frequently asked questions
How do I create a barcode for free?
Open the barcode generator, pick a format such as Code 128 or EAN-13, type the value, check the preview and download PNG or SVG. Free covers one barcode at a time in all 19 formats, PNG up to 300 dpi, and no watermark.
How do I make a barcode for a product I want to sell?
Get your product numbers from GS1 in your country, then enter the number in the generator using EAN-13 (or UPC-A in the US and Canada) and download the symbol. A number you made up can clash with someone else's product and be rejected by retailers.
Which barcode type should I use for inventory?
Code 128 is the usual choice. It holds letters and digits, is compact, and does not need any registration. Use your own SKU or part numbers as the value.
Can I print a barcode I made online?
Yes. Download SVG for the sharpest print, or a PNG at 300 dpi or more, keep the white margin around the bars, print at the size you chose, and scan a test copy before a full print run.
What is the difference between EAN-13 and UPC-A?
EAN-13 has 13 digits and is the worldwide retail standard. UPC-A has 12 digits and is used in North America. A UPC-A is an EAN-13 with a leading zero, so scanners often show it with that extra 0.
Why does my barcode not scan?
The usual causes are a cropped quiet zone, bars printed too small or blurred, low contrast, or a format the scanner does not read. Re-export with the full margin, print larger and scan a test copy.