Barcode Generator
A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call
Free barcode generator. Create Code 128, EAN-13, UPC-A and Code 39 barcodes with check digits added for you, and download them as PNG or SVG.
Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.
How to use the barcode generator
Choose a barcode type, type the data, and the barcode generator draws the barcode straight away:
- Code 128: letters, numbers, spaces and punctuation. The best all-round choice for shipping labels, inventory and internal use.
- EAN-13: the 13-digit retail barcode used worldwide. Enter 12 digits and the check digit is added for you.
- UPC-A: the 12-digit retail barcode used in North America. Enter 11 digits and the check digit is added.
- Code 39: capital letters, numbers and a few symbols, common on older inventory systems, ID badges and industry labels. Optionally add a check character.
Choose the bar height and bar width, and whether to show the text under the bars. Then Download PNG for documents and labels, or Download SVG for print and design software, where it stays sharp at any size.
Check digits are calculated for you, and if you enter a full number with a wrong check digit, the barcode generator tells you what it should be. Everything runs in your browser.
Which barcode type should I use?
| Type | Holds | Length | Use it for |
|---|---|---|---|
| Code 128 | Any standard keyboard character | Variable | Shipping, inventory, asset tags, internal codes |
| EAN-13 | Digits only | 13 | Retail products sold worldwide |
| UPC-A | Digits only | 12 | Retail products in the US and Canada |
| Code 39 | A–Z, 0–9, space, - . $ / + % | Variable | Older systems, ID badges, some industries |
For products you'll sell in shops, use EAN-13 or UPC-A with a number issued by GS1 (see below). For everything else, Code 128 is usually best: it holds more characters in less space than Code 39 and has a built-in check digit.
Retail barcodes need GS1 numbers
The barcode generator can draw any valid EAN-13 or UPC-A number, but the number itself matters. Retailers and marketplaces expect product numbers (GTINs) issued by GS1, the organisation that manages retail barcodes. When you join GS1 in your country, you get a company prefix and can number your own products. Made-up numbers can clash with real products, and many retailers will reject them.
The first digits of an EAN-13 are the GS1 prefix of the organisation that issued the number (for example, 50 for the UK, 590 for Poland and 890 for India), not necessarily the country where the product was made.
For internal use, such as your own stock or a market stall, you can use Code 128 with your own codes instead. To add a GTIN to your website's product data, use the product schema generator.
How check digits work
A check digit is the last digit of a barcode, calculated from the others, so a scanner can catch misreads.
EAN-13 and UPC-A: multiply the digits alternately by 1 and 3 (starting with 1 from the left in EAN-13), add them up, and the check digit is whatever brings the total to the next multiple of 10. For the classic example 590123412345, the check digit is 7, giving 5901234123457. For the UPC-A 01234567890, it's 5, giving 012345678905.
Code 128: a check value is calculated automatically from every character and its position, and encoded before the stop pattern. You don't see it in the text.
Code 39: an optional "modulo 43" check character can be added. Only use it if your scanner or system expects it, because otherwise it's read as part of the data.
Printing barcodes that scan
- Keep the quiet zones. The white space either side of the bars is part of the barcode. Don't put text or borders right next to the bars. The barcode generator includes quiet zones in the image.
- Use dark bars on a light background. Black on white is best. Red bars don't scan with most red-light scanners, and light bars on a dark background often fail.
- Don't squash or stretch it. Resize proportionally. For print, download the SVG, which stays sharp at any size.
- Mind the size. An EAN-13 is nominally about 37 × 26 mm. Retailers usually allow 80% to 200% of that; smaller barcodes can be hard to scan.
- Print at good quality. Smudged or faded bars cause misreads. Laser printers and thermal label printers give the cleanest results.
- Test before printing many. Scan a test print with the scanner (or phone app) that will actually be used.
Barcodes vs QR codes
Barcodes (1D) store a short string, like a product number, and are read by standard retail scanners. QR codes (2D) store much more, such as a web address, contact details or Wi-Fi settings, and are read by phone cameras. Use a barcode for products, stock and shipping; use the QR code generator when people should scan with their phones.
Uses for small businesses
- Stock control: label shelves and products with Code 128 and scan them with a cheap USB scanner. The reorder point calculator and inventory turnover calculator help manage stock.
- Retail products: EAN-13 or UPC-A with GS1 numbers on packaging.
- Asset tags: label equipment, laptops and tools.
- Event tickets and loyalty cards: a unique code per ticket or customer.
- Invoices and order slips: a Code 128 order number speeds up packing. The invoice generator creates the invoice itself.
PNG or SVG?
- PNG is an image at a fixed size: good for documents, spreadsheets, label software and websites. Bars are drawn with whole pixels, so they stay crisp. Download at the size you need using the bar width setting.
- SVG is a vector file: ideal for packaging and print design in apps like Illustrator, Affinity or Inkscape, because it scales without losing sharpness.
To shrink a PNG for a web page, use the image compressor; avoid compressing barcodes heavily, though, as blurred edges can stop them scanning.
Barcode sizes and resolution
For printing, the width of the narrowest bar (the "X dimension") matters most. Too thin, and printers smudge it and scanners miss it. As a rough guide:
- Thermal label printers at 203 dpi: 2 or 3 dots per module, so choose Thin or Normal bar width and print at 100%.
- Office laser printers: Normal or Wide, printed without scaling.
- Packaging: use the SVG and let your designer set the size within the GS1 guidelines for EAN and UPC.
Never let software stretch a barcode to fit a box: scale it evenly, or regenerate it at a different bar width.
Testing your barcodes
Before printing labels in bulk:
- Print one test sheet on the actual printer and label stock.
- Scan it with the scanner that will be used (or a free barcode scanning app on your phone).
- Check the scanned text matches exactly, including the check digit.
- Test at an angle and in normal lighting, as it will be used in practice.
Barcodes on invoices and packing slips
A Code 128 barcode of the order number on a packing slip lets staff scan it instead of typing it, which saves time and avoids mistakes. Keep the human-readable number underneath as a backup.
How scanners read barcodes
A scanner shines light across the bars and measures the pattern of dark and light widths. The start and stop patterns tell it which barcode type it's reading and in which direction, so a barcode can be scanned upside down. The check digit then confirms the read was correct, and if it isn't, the scanner simply tries again.
A worked example
A bakery is starting to sell jars of its jam in a local shop, and the shop asks for a barcode. The owner joins GS1 and gets a company prefix, numbers the strawberry jam 590123412345 (an example number), and enters the 12 digits into the barcode generator with EAN-13 selected. The check digit 7 is added, and the full number 5901234123457 appears under the bars. They download the SVG for the label designer and test-print a sheet: the shop's scanner reads it first time. For the bakery's own shelf labels, they use Code 128 codes like "CRUMB-RYE-0042".
Need more customers from Google?
This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. DeepRit manages Google Ads for small and mid-size businesses, and only Google Ads. We check your account before we ever get on a call, then fix the structure, the keywords, the tracking and the ads, with month-to-month terms and no long contract. Book a free audit call.
Frequently asked questions
How do I make a barcode?
Choose the type in the barcode generator, type the data and download the barcode as a PNG or SVG.
Which barcode type should I use?
EAN-13 or UPC-A with GS1 numbers for retail products. Code 128 for almost everything else.
Do I need to buy barcode numbers?
For products sold through retailers and marketplaces, yes: get them from GS1. For internal use, you can make your own codes.
How is the check digit calculated?
For EAN-13 and UPC-A, digits are weighted 1 and 3 alternately and the check digit brings the total to a multiple of 10. The tool adds it for you.
Why won't my barcode scan?
Common causes are missing white space around the bars, low contrast, too small a size or blurry printing. Download the SVG for print and test a sample.
Is the barcode generator free?
Yes. It's free with no sign-up and no watermark.
Free PPC audit
See where your ad budget leaks.
We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.