PublicSoftTools

Barcode Generator Free

Generate barcodes online in Code 128, EAN-13, UPC-A, Code 39, and more formats. Customize colors and download as PNG or SVG. No signup, runs entirely in your browser.

Any text or numbers
#000000
#ffffff

How the Barcode Generator Works

  1. 1Enter the value you want to encode — text, a number, or a product code — in the input field.
  2. 2Select a barcode format (Code 128, EAN-13, UPC-A, Code 39, etc.) from the dropdown. Each format has different character rules shown below the input.
  3. 3Optionally adjust the bar color, background color, and whether to show the human-readable text below the bars.
  4. 4Click Download PNG for a raster image or Download SVG for a scalable vector file ready for print.

About Barcode Symbologies

A barcode is a machine-readable representation of data using parallel bars and spaces of varying widths. Different industries have adopted different barcode standards — retail uses EAN-13 and UPC-A, logistics uses Code 128, healthcare uses Code 39, and pharmaceuticals use Pharmacode. Choosing the right format depends on your industry, the characters you need to encode, and the scanner hardware in use.

Barcode Format Comparison

FormatCharactersLengthCommon use
Code 128All ASCIIVariableLogistics, shipping, internal tracking
EAN-13Digits only12 digits (+ check)Retail product packaging worldwide
UPC-ADigits only11 digits (+ check)Retail product packaging in USA/Canada
EAN-8Digits only7 digits (+ check)Small product labels
Code 39A–Z, 0–9, symbolsVariableHealthcare, automotive, government
ITF-14Digits only13 digits (+ check)Carton/case-level packaging (GS1)
MSIDigits onlyVariableWarehouse shelving, inventory
PharmacodeNumber (3–131070)VariablePharmaceutical packaging

Tips for Better Barcodes

Use SVG for Print

SVG scales to any resolution without pixelation. For labels and packaging, always download SVG and place it in your design software at the target print size.

Maintain Quiet Zones

Leave blank white space (quiet zone) of at least 10 bar widths on each side of the barcode. Scanners need this margin to detect where the barcode starts and ends.

High Contrast Only

Dark bars on a white or light background scan most reliably. Avoid colored backgrounds — most laser scanners use a red beam that cannot distinguish certain color combinations.

Test Before Printing

Always scan the barcode with the actual scanner hardware that will be used in production before committing to a large print run. Phone camera apps are not always representative of industrial scanners.

EAN-13 for Retail

If you need barcodes for retail products sold in stores, obtain a registered GS1 company prefix at gs1.org. Arbitrary numbers are not valid for retail checkout systems.

Choose Code 128 for Text

When encoding internal reference codes, serial numbers, or mixed alphanumeric data, Code 128 is the best choice — compact, high-density, and universally supported by modern scanners.

Frequently Asked Questions

Which barcode format should I use?

Code 128 is the most versatile — it encodes any ASCII text or numbers and is used in logistics, shipping labels, and internal tracking. EAN-13 and UPC-A are the retail standards for product packaging (the barcodes you scan at a supermarket checkout). Code 39 is older and limited to uppercase letters plus digits, but remains common in healthcare and government. Use EAN-8 for small product labels where space is tight.

How do I generate an EAN-13 barcode?

Select the EAN-13 format and enter exactly 12 digits — the 13th digit is the check digit, which JsBarcode calculates and appends automatically. If you enter fewer or more than 12 digits, the barcode will show a validation error. The first 2–3 digits encode the country prefix (GS1 prefix), the next digits identify the company, and the final digits identify the product.

Is the barcode generated locally or on a server?

All barcodes are generated entirely in your browser using the JsBarcode library compiled to JavaScript. Your input data is never sent to any server. This makes the tool safe for generating barcodes containing internal part numbers, serial codes, or sensitive product identifiers.

What is the difference between PNG and SVG download?

PNG is a raster format — it has a fixed pixel resolution. SVG is a vector format that can be scaled to any size without losing sharpness. For print applications (labels, packaging, signage) SVG is the better choice because it stays crisp at any size. For web use or quick sharing, PNG is more universally supported.

Can I use these barcodes commercially?

The barcodes generated here are standard format barcodes — the symbologies themselves (Code 128, EAN, UPC, etc.) are open standards. However, if you need a registered EAN-13 or UPC barcode for a retail product sold in stores, you must obtain a GS1 company prefix and product codes from GS1 (gs1.org). Randomly generated 12-digit EAN numbers are not licensed for retail use.

What is the minimum print size for a barcode to scan reliably?

For standard 1D barcodes like Code 128, the recommended minimum print size is about 25 mm (1 inch) wide and 15 mm tall. The bars must have sufficient contrast and quiet zones (white space on each side). For small labels, use simpler formats like Code 39 with fewer characters, or increase the bar width setting. Always test-scan before committing to a print run.

Why is my EAN-13 barcode showing an error?

EAN-13 requires exactly 12 digits as input (the 13th check digit is calculated automatically). Common issues: spaces or dashes in the input, letters included, or the wrong number of digits. Make sure you are entering only the 12-digit product code without any separators. UPC-A requires exactly 11 digits, EAN-8 requires exactly 7 digits, and ITF-14 requires exactly 13 digits.