Barcode Generator (Code 128, EAN-13, UPC-A, Code 39)
Built by Najeeb · last updated August 14, 2026 · checked against our testing process
How to use the barcode generator
- Pick a format: Code 128 for general text or internal SKUs, EAN-13 or UPC-A for retail products, Code 39 for asset tags and older systems, ITF-14 for shipping cartons.
- Type or paste your data: letters and numbers for Code 128 and Code 39; digits only for EAN-13 (12 digits), UPC-A (11 digits), and ITF-14 (13 digits). The check digit is added automatically.
- Check the preview: the barcode renders instantly below the input as you type, including the human-readable number underneath the bars.
- Adjust size if needed: set bar width and height so the code stays readable at your print size, not just on screen.
- Download PNG or SVG: PNG for quick labels, SVG for anything going to a print shop or getting resized later.
- Print a test label first: scan it with the actual scanner you'll use in production before printing a full batch.
A barcode generator that covers the formats you'll actually run into
This barcode generator makes Code 128, EAN-13, UPC-A, Code 39, and ITF-14 barcodes directly in your browser using JsBarcode. Nothing you type gets uploaded anywhere, there's no signup, and the image renders as you type. The harder part isn't the tool, it's picking the right format and knowing what a barcode can and can't do for you. That's what this page covers.
What each barcode format is actually for
Code 128 is the flexible one: it encodes letters, numbers, and symbols, packs data densely, and is the default choice for warehouse labels, internal SKUs, shipping labels, and anything that isn't sold at a retail register. If you're not sure which format to use, Code 128 is usually it.
EAN-13 (13 digits) and UPC-A (12 digits) are the formats printed on products sold in stores: EAN-13 is the standard outside North America, UPC-A inside the US and Canada. Point-of-sale scanners are built around these two formats specifically.
Code 39 is older and less dense than Code 128, but it's still what a lot of legacy inventory systems, government forms, and physical asset tags expect. If your scanner or software was set up more than a decade ago, there's a decent chance it wants Code 39.
ITF-14 encodes 14 digits and is built for case and carton-level shipping, not individual items. It's the barcode printed on the outer box, distinct from the UPC or EAN on each unit inside.
The check digit problem: why a homemade retail barcode won't scan
Every EAN-13 and UPC-A barcode ends in a check digit, a number calculated from the digits before it that lets a scanner catch misreads. This tool calculates that check digit correctly for whatever number you enter, so the math checks out and the barcode will scan. What it cannot do is give you a number that's actually assigned to your product. Retail EAN-13 and UPC-A numbers come from GS1, the organization that licenses manufacturer prefixes so no two products in the world share a barcode. A number you invent yourself, even with a correct check digit, is not registered to you or your product. Print it and bring it to a real retail register, and one of two things happens: the scanner reads a code that belongs to someone else's item, or the retailer's system rejects it outright because it was never issued through GS1. If you're selling through Amazon, Walmart, or a physical retailer, budget for a GS1 company prefix (GS1 sets and publishes current pricing on their site; it varies by country and by how many numbers you need) before you print anything. If the barcode is for your own warehouse, inventory system, or asset tracking, none of this applies, use whatever numbers make sense to you internally.
Barcode vs. QR code: which one do you actually need
A traditional barcode (Code 128, EAN-13, UPC-A, Code 39) stores a short string, usually under 20-30 characters, as a single line of bars. Its advantage is compatibility: cheap laser scanners that have been in warehouses and checkout lanes for 30 years read it instantly, and it stays legible even smudged or slightly damaged. A QR code is a 2D grid that can hold thousands of characters, including full URLs, but it needs a camera-based scanner or smartphone, not the old laser-line kind. Use a barcode when you're plugging into an existing scanner infrastructure, retail POS, or inventory system that expects one. Use a QR code when you need to encode a link, more text than a barcode can hold, or you're relying on customers scanning with their phones.
Printing barcodes so they actually scan
Three things wreck barcode readability more than anything else. First, the quiet zone: leave blank margin (roughly 10x the width of the narrowest bar) on both sides of the code with nothing printed in it, including your label border. Second, minimum bar width: at small sizes, thin lines blur together on cheap printers; don't shrink a barcode below about 1 inch wide for Code 128 or Code 39 without testing it on your actual printer first. Third, paper finish: matte stock scans far more reliably than glossy, because glossy paper reflects the scanner's light source straight back and washes out the contrast the scanner depends on.
Worked example: labeling 200 SKUs for internal warehouse use
A small warehouse needs to label 200 SKUs for its own picking and inventory system, not for retail sale. Code 128 is the right call here: it's not going through a store register, so there's no GS1 requirement, and Code 128 handles the mixed letter-number SKU codes the warehouse already uses internally (like WH-2026-0143). Each label gets a 1.5 inch wide barcode printed on matte label stock with the default quiet zone left intact, and the crew scans a handful of test prints with the actual handheld scanner before running the full batch. Total cost: a roll of label stock and printer time, since the barcode generation itself is free and none of the 200 codes need to be registered anywhere.
Which format fits your job: a 30 second decision table
| Your situation | Format | Why |
|---|---|---|
| Selling on Amazon US | UPC-A | 12 digits, GS1 registration required |
| EU or international retail | EAN-13 | 13 digits, the global superset of UPC-A |
| Internal warehouse SKUs | Code 128 | Alphanumeric, no registration, the densest common 1D format |
| Shipping cartons of retail product | ITF-14 | 14 digits, prints reliably on rough corrugate |
| Legacy DoD or automotive systems | Code 39 | Older spec with a large installed base of readers |
| Books | EAN-13 from the ISBN | 978 prefix, no GS1 fee, the ISBN is the number |
Clothing tags add care label sizing quirks, covered separately on the garment barcode generator page.
The check digit math, worked by hand
Take the code 03600029145. Odd positions from the left: 0, 6, 0, 2, 1, 5, sum 14, times 3 equals 42. Even positions: 3, 0, 0, 9, 4, sum 16. Add them: 42 plus 16 equals 58. The next multiple of 10 is 60, so the check digit is 2 and the full code is 036000291452. The tool does this for you, but running the math by hand is the fastest way to catch a typo in a supplier spreadsheet before you print from it.
What GS1 registration costs in the US
| GS1 US option | Typical upfront | Typical annual renewal |
|---|---|---|
| Single GTIN | around $30 | none |
| Company prefix, 10 numbers | a few hundred dollars | a smaller yearly fee |
| Company prefix, 100 numbers | several hundred dollars more | scales with prefix size |
| Company prefix, 1,000 numbers | into the low thousands | scales with prefix size |
Check GS1 US directly for current numbers before you buy, since pricing changes over time. Amazon validates UPCs against the GS1 database, and cheap third party reseller numbers can get a listing suppressed, so a single registered GTIN is the safer route for one product.
The scan test before a large print run
Print one label first. Scan it 10 times from 4 to 8 inches with a handheld laser scanner, then 10 more times with a phone camera app, since the two use different optics and catch different problems. If you get fewer than 9 of 10 clean reads on either device, widen the bars one step before you commit to the full run. Formal verification against ISO 15416 uses lab equipment and grades on a letter scale, so this simple first pass rate is a practical stand in when you do not have a verifier on hand.
Bulk barcodes from a spreadsheet
This tool renders one code at a time, and a plain barcode font pasted into Excel will not fill the gap: Code 128 needs a computed checksum character built into the symbol, so typed out fonts produce codes that will not scan. For a handful of SKUs, generating them here one at a time is still the most reliable path. If your labels can use QR codes instead, the QR code generator from Excel list takes a pasted column and outputs the whole batch at once.
Related tools
Need to encode a link, menu, or contact card instead of a short product code? Try the QR code generator. Generating many barcodes at once from a spreadsheet of SKUs is a different job than one-at-a-time entry, so batch that separately if your list is long.
Frequently Asked Questions
Is this barcode generator free to use?
Yes. It runs entirely in your browser using JsBarcode, so there's no upload, no signup, and no limit on how many you generate.
Can I use this to generate a valid UPC-A or EAN-13 barcode for retail?
You can generate a barcode with a correct check digit, but that's not the same as a legally sellable one. Retail UPC-A and EAN-13 numbers must be assigned to you through GS1; a self-made number, even with valid math, will either scan as someone else's product or get rejected at a store's register.
What's the difference between Code 128 and Code 39?
Code 128 is denser and supports the full alphanumeric range, making it the better default for modern warehouse and shipping labels. Code 39 is older and less compact but is still what many legacy scanners and inventory systems expect, so use it if your existing setup requires it.
Which barcode format should I use for shipping cartons?
ITF-14 is built for case and carton-level shipping, separate from the UPC or EAN-13 printed on each individual unit inside. If you're labeling a box of 24 units for a distributor, ITF-14 is the standard.
Does this barcode generator upload my data anywhere?
No. The barcode is drawn directly in your browser and nothing you type is sent to a server or stored.
What size should I print a barcode so it scans reliably?
Keep it at least about 1 inch wide for Code 128 or Code 39, leave a blank quiet-zone margin on both sides, and print on matte rather than glossy paper to avoid glare washing out the contrast a scanner needs.
Should I use a barcode generator or a QR code generator for my product?
Use a barcode if you're feeding an existing laser scanner or retail POS system that expects one. Use a QR code if you need to store a link or more text than a barcode's short digit or character limit allows, and scanning will happen with smartphones.
