Barcode Generator is a free, browser-based tool that turns a string of characters into a scannable 1D barcode in seconds, supporting the four most-used 1D symbologies: Code 128, EAN-13, UPC-A, and Code 39. To generate barcodes for products that actually scan, you need the right symbology for the job — EAN-13 for products sold at retail worldwide, UPC-A for products sold in the US and Canada, Code 128 for shipping and case labels, and Code 39 for internal inventory tags. The tool renders the barcode as you type, computes the EAN/UPC check digit for you, and outputs a print-ready SVG file that you can drop straight into label templates or packaging artwork. Everything runs in JavaScript on your device, so product codes, SKUs, and tracking numbers never leave your browser. This guide walks through picking the right format for your product, generating the barcode in three steps, understanding check digits, and printing the result cleanly.

how to generate barcodes for products
how to generate barcodes for products

Picking the Right Barcode Format for Your Product

Product barcodes are not interchangeable. Each of the four formats supported by the Barcode Generator has a defined job, and choosing the wrong one is the most common reason a product label fails to scan at checkout. EAN-13 and UPC-A are the retail standards — every consumer product on a supermarket shelf uses one of them. EAN-13 is the 13-digit format used worldwide, while UPC-A is its 12-digit sibling used in the US and Canada. Both encode only digits, and both end in a check digit that catches typos and misreads. Code 128 is the logistics workhorse: it packs any ASCII character — letters, digits, and symbols — into a compact, high-density code, which is why carriers and warehouses use it for tracking labels and SSCC pallet codes. Code 39 is the older alphanumeric format still common in automotive, defense, and internal inventory systems because it needs no check digit setup and prints reliably even on low-resolution industrial printers.

The table below maps each format to the jobs it was built for.

FormatBest forCharacter setLength
EAN-13Retail products sold worldwideDigits only13 digits (12 + check digit)
UPC-ARetail products sold in the US and CanadaDigits only12 digits (11 + check digit)
Code 128Shipping labels, case marks, mixed text, tracking numbersFull ASCII (letters, digits, symbols)Variable
Code 39Internal inventory, industrial tags, automotive and defense labelsA–Z, 0–9, and a few symbolsVariable

If you sell a product to consumers, EAN-13 or UPC-A is almost always the right answer. If you label shipping cartons, cases, or anything that combines letters and numbers, Code 128 will fit the data cleanly. If you tag parts on a warehouse shelf or print asset labels for internal tracking, Code 39 keeps things simple and printer-friendly.

How to Generate Your Product Barcode

Once you know which format matches your product, generating the barcode takes three steps. Everything happens in your browser, so nothing is uploaded and the SVG output is ready to print immediately.

  1. Open the Barcode Generator and pick a format — Code 128 for logistics or mixed text, EAN-13 or UPC-A for retail products, or Code 39 for inventory tags.
  2. Type your value into the input field. For an EAN-13, enter the first 12 digits and the tool adds the 13th check digit automatically; type all 13 and it verifies the check digit is right. For a UPC-A, enter the first 11 digits and the tool adds the 12th; type all 12 and it verifies. Code 128 and Code 39 encode your text directly with no check digit setup required.
  3. The barcode renders instantly as you type. Click Download SVG to save a print-ready vector file you can drop into a label template, packaging artwork, spreadsheet, or design file.

The whole flow is short on purpose: pick the format, type the data, save the SVG. There is no sign-up, no usage limit, and no watermark on the output.

EAN-13 and UPC-A Check Digits, Explained

The last digit of every EAN-13 and UPC-A barcode is a check digit — a single number calculated from the other digits that lets a scanner verify it has read the code correctly. Without it, a single misread at checkout would silently change a product's price, or break scanning entirely. The check digit is computed with a modulo-10 formula: from the rightmost data digit (excluding the check digit itself), digits in odd positions are multiplied by 3, digits in even positions by 1, all the products are added together, and the check digit is the number that makes the sum a multiple of 10.

Worked example: the twelve EAN-13 data digits 123456789012.

From the right, positions 1 to 12 read 2, 1, 0, 9, 8, 7, 6, 5, 4, 3, 2, 1.

Odd positions × 3: (2×3) + (0×3) + (8×3) + (6×3) + (4×3) + (2×3) = 6 + 0 + 24 + 18 + 12 + 6 = 66.

Even positions × 1: (1×1) + (9×1) + (7×1) + (5×1) + (3×1) + (1×1) = 1 + 9 + 7 + 5 + 3 + 1 = 26.

Total: 66 + 26 = 92.

Check digit: 10 − (92 mod 10) = 10 − 2 = 8. The full EAN-13 is therefore 1234567890128, and 92 + 8 = 100, which is divisible by 10 as required.

You do not need to run this math yourself. The Barcode Generator computes the check digit the moment you type the first twelve (or eleven) digits, and verifies the check digit when you paste in a full code, flagging typos before you commit to a print run. Catching a flipped digit in a spreadsheet while the label template is still open is faster than printing a hundred labels and finding out at the checkout scanner that none of them work.

Downloading and Printing Your Barcode Cleanly

Every barcode the tool produces is an SVG — a vector file made of mathematical shapes rather than pixels. That choice matters for product labels because scanners read the exact edges of the bars. A vector barcode stays razor-sharp whether you print it at 8 mm wide on a jar lid or 200 mm wide on a shipping carton, because the printer renders the bars at native resolution instead of stretching a bitmap. If you have ever scaled a PNG barcode up to fit a label and watched it turn into a soft, fuzzy mess, that is the failure vector output eliminates.

To put the barcode on a product, drop the downloaded SVG into whatever you use for label design — Illustrator, Inkscape, Affinity Designer, or a Word mail-merge template. For teams that work entirely in Microsoft Word, a focused walkthrough in our guide to creating barcodes in Word with a free online generator covers mail-merge and label sheets specifically. Two practical points keep the print clean: leave a clear quiet zone — at least ten bar widths of white space on each side — and keep the bars dark on a light background. Black on white is the safest default; reflective foil, transparent labels, and very small print sizes are the usual suspects when a label refuses to scan.

Reasons Product Barcodes Fail to Scan

Most scanning failures trace back to a handful of recurring mistakes, and they are easy to avoid once you know what to look for.

  • Using the wrong format for retail. A Code 128 barcode on a product sold at a grocery store will not scan at checkout. EAN-13 and UPC-A are the formats grocery scanners are configured to read; pick the right symbology before you print.
  • Typing the wrong check digit. Pasting a full 13-digit EAN with one digit flipped will produce a perfectly drawn barcode that quietly fails to scan. Let the tool verify the check digit before you commit to a print run.
  • Scaling a raster image instead of using vector output. If your barcode was saved as a PNG, scaling it up blurs the bar edges. Re-export from the SVG whenever you change size.
  • No quiet zone. Scanners need a clear margin around the bars. If your label design butts text or a coloured block up against the barcode, the scanner will struggle or refuse to read it.
  • Printing on a poor background. Transparent, reflective, or coloured backgrounds break the contrast scanners rely on. Use a solid white or light background under the bars.

For products going to retailers, the underlying GTIN still has to be registered with your local GS1 organisation — the barcode is only the machine-readable rendering of that number. The tool generates the image; it does not register the code with GS1. Sort the registration out first, then come here to render the barcode for your labels and packaging.