How to Make a Barcode for Your Product (the Right Way)
A practical guide to barcodes for small business and product teams: the differences between UPC, EAN, Code 128, and QR, when you need a real GS1-issued code, and how to generate a working barcode in your browser in seconds.
A barcode for a product sold through retail needs a real GS1-issued UPC or EAN (they cost $30-250 depending on volume, plus an annual fee), assigned to your company and the specific product. For internal use — inventory labels, warehouse tracking, internal SKUs, equipment tags — a Code 128 or Code 39 barcode with a self-chosen number is enough and free. A browser barcode generator handles the internal-use case in seconds; for the retail case, the generator produces a test barcode you can scan, but the real one needs to be purchased from GS1. There is no shortcut past GS1 for retail, and any tool that claims otherwise is generating a code that retailers will reject at the register.
Barcodes look interchangeable until you try to scan one at a real retailer. There are several symbologies, several registration systems, and one very common mistake: using a self-generated UPC for a product you plan to sell through retail. This post covers the different barcode types, when you need a real GS1-issued code, and how to generate the right one in your browser without paying for software or sending your data anywhere.
The four barcode types you will actually encounter
There are dozens of barcode symbologies, but for product work you only need to know four:
- UPC-A (12 digits): The standard US retail barcode. Found on virtually every product in a US grocery or big-box store. Requires a real GS1-issued company prefix.
- EAN-13 (13 digits): The international equivalent of UPC-A. Used everywhere outside the US, and accepted by US retailers. Requires a real GS1-issued company prefix.
- Code 128: A high-density alphanumeric barcode. Used for shipping labels (FedEx, UPS), warehouse inventory, internal SKUs, and any place you need to encode text and numbers compactly. No registration required.
- Code 39: An older alphanumeric barcode. Less dense than Code 128 but more readable from poor print quality. Used for asset tags, equipment labels, military and automotive parts. No registration required.
QR codes are a different family entirely (2D matrix codes, not 1D barcodes), and the QR Code Generator is the right tool for those. The Barcode Generator on this site covers UPC, EAN, Code 128, and Code 39.
When you need a real GS1-issued code
The hard truth: if you want a product to scan at a real retailer (Target, Walmart, Amazon FBA, a grocery chain), the barcode must be issued by GS1, the international standards body. The process is:
- Apply to GS1 for a company prefix. The prefix length and the cost depend on how many products you need to barcode. A 6-7 digit prefix (enough for hundreds of products) is typically $250 the first year and $50-130 to renew. Smaller prefixes for very small businesses are sometimes cheaper.
- Assign a product number within your prefix. Your first product might be 012345678905, where 0123456 is your prefix, 7890 is the product, and 5 is the check digit.
- Generate the barcode for that exact number. Any tool can do this once you have the number — the GS1 prefix is the registration, not the rendering.
- Print the barcode at a size that meets the retailer's spec (usually 80-100% of the UPC-A nominal size, which is 1.469 inches wide and 1.02 inches tall).
This is what makes a barcode work at the register. The scanner reads the number, the retailer's database looks up the product, and the item rings up. If the number is not in GS1's database, the scanner reads the digits but the system rejects the item as "not found".
There is no shortcut. A self-generated UPC will scan, but the retailer will reject it on the first sale because the number is not registered to a real company.
When you do NOT need GS1
For most barcode use cases, GS1 is not required:
- Internal inventory labels. Your warehouse needs to track 500 SKUs. Use Code 128 with whatever number scheme you want (SKU + variant + date is common). No GS1 needed.
- Equipment and asset tags. Laptops, tools, lab equipment. Code 39 with an internal ID. No GS1 needed.
- Shipping labels. UPS, FedEx, DHL all generate their own barcodes based on the tracking number. You do not need to make a barcode; the carrier does it for you.
- Event tickets. Code 128 with a unique ticket ID. No GS1 needed.
- Library books. Code 39 with an ISBN-adjacent ID. No GS1 needed.
- Healthcare specimen labels. Code 128 with the specimen ID. No GS1 needed (though some hospital systems do use GS1).
- Boarding passes. These use PDF417 (a 2D stacked barcode) or Aztec, generated by the airline. No GS1 needed.
The pattern: GS1 is for products sold to the public through retail. Everything else can use Code 128 or Code 39 with self-chosen numbers.
How the barcode generator works
The Barcode Generator on this site generates a barcode from a number and a symbology, in your browser. The flow:
- Choose the symbology (UPC-A, EAN-13, Code 128, Code 39).
- Type the number. The tool validates the format (e.g. UPC-A must be exactly 12 digits, with the last digit being a checksum the tool computes).
- The barcode renders as an SVG or canvas, in the size you choose.
- Download as PNG or SVG, or copy to clipboard.
The whole thing runs locally. The number is in your input field, the encoding happens in JavaScript, and the result is an image you can save. Nothing is sent to a remote service, nothing is logged, and the number does not need to be registered anywhere to generate a valid barcode image.
The checksums, briefly
UPC and EAN barcodes have a check digit at the end, computed from the other digits. The algorithm is the same modulo-11 algorithm with weights of 1 and 3, applied differently for UPC vs. EAN. The tool computes it for you. If you type 11 digits and the tool pads a check digit, that is the standard behavior. If you type 12 digits and the tool rejects one, the existing check digit is wrong.
Code 128 and Code 39 have built-in checksums too (different algorithm), and most generators include them by default. For internal use, the checksum is what lets a scanner detect a misread.
Printing barcodes that actually scan
The most common reason a self-printed barcode fails at the register is not the number — it is the print quality. The printer requirements are tighter than they look:
- Resolution. At least 300 DPI. Most consumer inkjet printers do 600 DPI, which is fine. Office laser printers are fine. Thermal label printers (Dymo, Zebra, Brother) are ideal.
- Contrast. Black bars on a white background. No anti-aliasing. No gradients. No light gray.
- Quiet zone. The empty space on either side of the barcode. UPC requires at least 9 times the width of the narrowest bar. Most generators add this automatically.
- Size. UPC-A nominal is 1.469 × 1.02 inches. Anything 80% or larger usually scans. Anything below 50% will not.
- Surface. Flat. Wrinkled, curved, or reflective surfaces cause scan failures.
If you are printing on a label, use a matte paper. Glossy labels create reflection that confuses the laser scanner. If you are printing on packaging, test on the actual material before committing to a print run.
Common barcode mistakes
- Using a self-generated UPC for retail. Will scan, will not ring up. The retailer will chargeback or refuse the shipment.
- Using the same UPC for two products. GS1 will reject the second one. Some retailers auto-detect duplicates and quarantine the product.
- Printing too small. 80% is the floor for reliable scanning. Below that, you are gambling on the scanner's quality.
- Adding a logo or text inside the barcode. Some "designers" do this to make the barcode look branded. The scanner cannot read it. The text below the barcode is fine; the bars themselves must be clean.
- Using the wrong symbology. Code 39 cannot encode a 12-digit UPC number reliably. EAN-13 is not the same as UPC-A even though they look similar. The tool will reject numbers that do not fit the chosen symbology, which is the easiest way to avoid this mistake.
- Forgetting the human-readable digits. Most barcodes have the number printed below the bars. The cashier needs to type the number manually if the scanner fails, which happens often enough that the readable line is required, not optional.
When to use QR codes instead
QR codes are the right tool for cases where the barcode needs to encode more than a number — a URL, a Wi-Fi password, a contact card, a multi-line product description. The QR Code Generator covers the common patterns. For scanning a QR code from a photo or screenshot, the QR Decoder reads the content back.
The general rule: if the data is a short identifier (a number, a SKU), use a 1D barcode. If the data is a URL, contact, or anything longer than ~20 characters, use a QR code. The two technologies coexist; they are not interchangeable.
How to use the generator for internal use today
- Open the Barcode Generator in your browser.
- Choose Code 128 for general use (it handles letters and numbers, supports any length, and is the most widely supported symbology for non-retail use).
- Type the identifier you want to encode. It can be a SKU, an asset tag, a location code, a part number, or any string up to about 40 characters.
- Set the size and download the barcode as PNG or SVG.
- Print it on a label, attach it to the item, and scan it with any barcode scanner app to verify.
The whole pipeline is in your browser. The identifier is in your input, the encoding is in JavaScript, the result is a downloadable image. For internal asset tracking, this is the entire job. For retail, the same tool can generate a test barcode image, but the registration step is separate and unavoidable.