PublicSoftTools
Tools7 min read

Barcode Generator: Create Free Barcodes Online

Barcodes are used everywhere — retail shelves, shipping labels, hospital wristbands, library books. The free barcode generator creates Code 128, EAN-13, UPC-A, Code 39, and five other formats instantly in your browser, with PNG and SVG download. No signup, no server upload.

What Is a Barcode?

A barcode is a machine-readable representation of data — most commonly a sequence of parallel bars and spaces of varying widths (1D barcodes), or a 2D matrix of dots (QR codes and Data Matrix). Scanners read them with a laser or camera, decode the pattern, and return the embedded value to whatever system is connected — a point-of-sale terminal, warehouse management system, or inventory database.

Different industries settled on different standards. Retail globally uses EAN-13. North American retail uses UPC-A. Logistics and internal tracking favor Code 128. Healthcare and manufacturing often use Code 39. Understanding which format your use case requires is the first step before generating anything.

Barcode Format Guide

FormatEncodesLengthPrimary use
Code 128All ASCII charactersVariableLogistics, shipping, internal tracking
EAN-13Digits only12 + check digitRetail product packaging (global)
UPC-ADigits only11 + check digitRetail product packaging (USA/Canada)
EAN-8Digits only7 + check digitSmall packaging labels
Code 39A–Z, 0–9, - . $ / + % spaceVariableHealthcare, government, automotive
ITF-14Digits only13 + check digitCarton/case packaging (GS1)
MSIDigits onlyVariableWarehouse shelf labels, inventory
PharmacodeNumber 3–131070VariablePharmaceutical packaging

How to Use the Barcode Generator

  1. Open the Barcode Generator.
  2. Type your value in the input field. Each format shows a hint below the field — for example, EAN-13 requires exactly 12 digits, Code 128 accepts any text.
  3. Select your format from the dropdown. If an invalid value is entered for the selected format (wrong length, wrong characters), a red error message appears and the download buttons disable.
  4. Optionally adjust bar color and background colorusing the color pickers. Toggle the human-readable text below the bars on or off.
  5. Click Download PNG for a raster image or Download SVGfor a scalable vector file. SVG is better for print; PNG is better for web and quick sharing.

Retail vs. Logistics Barcodes

EAN-13 and UPC-A for retail products

Every product sold in a physical retail store has an EAN-13 (or UPC-A for North American markets). These codes are assigned through the GS1 system — a global organisation that issues company prefixes. To generate a valid retail barcode for a product you sell in stores, you must purchase a GS1 company prefix at gs1.org. Using arbitrary 12-digit numbers as EAN-13 codes is not permitted for retail scanning — checkout systems validate against GS1 databases.

The barcode generator here is appropriate for retail use when: you have a legitimate GS1 prefix, or you are generating codes for internal reference only (not retail checkout systems).

Code 128 for logistics and tracking

Code 128 is the dominant format in supply chain, shipping labels (FedEx, UPS, DHL all use Code 128 variants), and internal warehouse tracking. It encodes any ASCII characters at high density, making it efficient for variable-length serial numbers, order IDs, and part codes. There is no registration requirement — you define your own numbering scheme.

Print Requirements

Minimum size

For reliable scanning, a standard Code 128 or EAN-13 barcode needs a minimum print width of about 25 mm (roughly 1 inch). The height is less critical but should be at least 15 mm. Smaller barcodes can work but require high-quality printing and testing with the actual scanner hardware.

Quiet zones

Every barcode requires blank white space — called a quiet zone — on both sides. For Code 128, the quiet zone should be at least 10 times the narrowest bar width (the X dimension). EAN-13 has specific quiet zone requirements: 11 X-dimensions on the left, 7 on the right. Violating quiet zone rules is the most common reason barcodes fail to scan.

PNG vs. SVG for print

SVG is the better choice for print. It scales to any resolution without pixelation, so your label printer or offset press renders it at full native DPI. PNG is fine for web use, screen display, and quick proofing, but avoid stretching a PNG for print — the bars will soften and may fail to scan at certain angles.

Common Questions

What characters can Code 128 encode?

Code 128 can encode all 128 ASCII characters — uppercase and lowercase letters, digits, punctuation, and control characters. It uses three character sets internally (A, B, C) and switches between them automatically for maximum compactness. This makes it suitable for encoding mixed data like “ITEM-0042-A” or a URL slug.

Why does my EAN-13 barcode show an error?

EAN-13 requires exactly 12 digits as input — the 13th is a check digit calculated automatically. Common causes of the error: entering 13 digits (including the check digit yourself), including spaces or dashes, or using letters. Strip the input to 12 pure digits and the error will clear.

Can I use these barcodes on product packaging sold in stores?

Only if you have a registered GS1 company prefix and have assigned the product number within your prefix range. Retail checkout systems validate EAN-13 and UPC-A against the GS1 database. Arbitrary numbers will either fail or, worse, collide with another company's products. Visit gs1.org to obtain a company prefix before generating retail barcodes.

Does the tool store my barcode data?

No. Barcode generation happens entirely in your browser using the JsBarcode JavaScript library. Your input values are never sent to any server. This makes the tool safe for generating barcodes containing internal product codes, serial numbers, or confidential identifiers.

Generate Barcodes Free

Code 128, EAN-13, UPC-A, Code 39 and more. Download PNG or SVG. No account needed.

Open Barcode Generator