How to Generate a Barcode for a Product You're Selling Online
If you're setting up a product to sell online, the barcode question usually shows up at the worst time — right when you're trying to finish a listing. Here's the short version: which barcode you need depends entirely on where you're selling, not on your product itself.
Figure out what your platform actually requires
- Amazon requires a scannable barcode on every unit, and it typically wants its own FNSKU code on top of, or instead of, a UPC, depending on whether you enroll in Amazon's manufacturer barcode exemption.
- Etsy doesn't require a barcode at all for most sellers, since it isn't built around a traditional retail checkout environment.
- Shopify and other self-hosted stores don't require one either, but if you ever want to sell the same product through a real-world retailer, wholesale account, or a marketplace like Walmart, you'll need a proper UPC or EAN already assigned to it.
- Physical retail — consignment, boutiques, wholesale accounts — almost always requires a standard UPC-A or EAN-13.
If you're only ever going to sell direct-to-consumer online, you don't strictly need a "real," GS1-registered barcode at all. You can generate one purely for your own internal inventory tracking, in whatever format your own systems support.
Get a legitimate barcode number, not just an image
This is the part that catches people out. A barcode generator creates the visual bars, but the number underneath needs to be genuinely unique to your product if you're selling through a retailer or a major marketplace. Two routes exist:
- License a GS1 prefix directly, which gives you a legitimate range of UPCs tied to your business. This is the option retailers and Amazon recognize as fully compliant.
- Buy a single UPC from a reseller. It's cheaper and faster, but the code was originally issued to someone else's GS1 account, which occasionally causes issues with stricter retailers or brand registries — worth knowing before you build a whole catalog around it.
If your barcode is purely for internal warehouse or inventory use, none of this matters. You can assign your own numbering scheme and generate the barcode freely.
Generating the barcode itself
Once you know which format you need, the actual generation step is the easy part:
- Choose the correct symbology — UPC-A for U.S. retail, EAN-13 for international, Code 128 for internal or shipping use where you need to encode letters as well as numbers.
- Enter your product's assigned number, not a random one, if it needs to be retailer-compliant.
- Preview the barcode at actual print size before exporting. Barcodes that look fine zoomed in on a screen sometimes fail once they're printed small.
- Export as SVG or PDF if you're sending the file to a professional label printer, since vector formats won't lose quality at different sizes. PNG is fine for quick printing at home.
- If you're labeling more than a handful of products, look for a bulk-generation option that lets you upload a list of numbers and get every barcode back at once, rather than generating them one at a time.
Our free barcode generator covers every format above, and the bulk barcode generator handles the multi-product case.
Printing and applying labels correctly
A barcode that scans perfectly on your screen can still fail once it's printed and stuck on a box. The most common culprits:
- Printing too small. Most barcode formats have a minimum size below which scanners start failing intermittently. Don't shrink a label just to fit more on a sheet.
- Low print resolution. Inkjet printers on cheap label stock can blur bar edges enough to cause misreads. A basic thermal label printer solves this for high-volume printing.
- Wrapping around a curved surface. A barcode bent around a bottle or tube can distort enough to fail. Flat surfaces are far more reliable.
- Not leaving the quiet zone. The blank margin around the bars matters. Cropping a label too tight cuts into space the scanner needs.
The mistake almost every new seller makes
Generating the barcode once and reusing the same image for every variant of a product — different colors, sizes, or bundles — without changing the underlying number. Each distinct sellable unit needs its own unique code. If a small shirt and a large shirt share a barcode, your inventory count and your sales reporting will both be wrong, and neither error tends to be obvious until you're deep into a reconciliation headache weeks later.
Quick answers
Can I make up my own barcode number? For internal inventory, yes. For anything sold through a retailer or major marketplace, no — it needs to be a properly assigned, unique number.
Do I need a different barcode for each product variant? Yes. Color, size, and bundle variations each need their own unique barcode.
What file format should I export a barcode in? SVG or PDF for professional printing, since they scale without losing quality. PNG is fine for quick, small-batch home printing.
Enjoyed this post?
Share it with your network