Smart Unit ConvertersSmart Unit Converters

Barcode Generator

Generate Code 128, EAN-13, UPC-A, Code 39, ITF-14, and more. Free PNG and SVG download with format-aware validation.

Most common; supports all ASCII characters.

Customize appearance
Live preview

Scan with any barcode scanner app to verify.

?What is the Barcode Generator?

A barcode is a one-dimensional pattern of vertical bars and spaces that encodes a string of characters — a product SKU, a tracking number, a library catalog ID. This generator supports all the major retail and industrial standards: Code 128 (the universal default), EAN-13 (worldwide retail), UPC-A (US/Canada retail), Code 39 (inventory and ID cards), ITF-14 (shipping cartons), MSI (warehousing), pharmacode (pharmaceuticals), and codabar (libraries and blood banks). Each format has different rules about which characters it accepts and how long the value must be — the generator validates your input as you type and explains what's wrong when it's invalid. Download as PNG for printing or SVG for vector use, with full control over bar width, height, color, and the text caption.

The Formula

Code 128 packs every ASCII character using three character sets (A, B, C) with switching codes — variable length. EAN-13 is fixed at 13 digits with a Mod-10 check digit (computed from the first 12 digits and printed as the last). UPC-A is the 12-digit US predecessor that EAN-13 extends. ITF-14 wraps an EAN-13 (or 14-digit GTIN) for shipping cartons. The check-digit formula for EAN-13: sum the odd-position digits, multiply the sum of even-position digits by 3, add them, and the check digit is the value that brings the total to a multiple of 10.

Linear (1D) barcodes use bar thickness ratios to encode digits; the scanner reads the relative widths of the dark and light stripes. Different formats use different ratio systems: Code 128 uses 11-module bars/spaces in three width classes; EAN-13 uses 7-module bars in a left/right pattern that includes parity. The check digit catches single-digit typos and most adjacent-digit transpositions. UPC-A and EAN-13 are functionally interchangeable (a UPC-A is an EAN-13 with a leading zero); modern POS systems read both. Code 128 is preferred when you need to encode letters or special characters because EAN/UPC is digits-only.

Common Barcode Formats — Capacity & Use Case

Side-by-side reference of supported barcode standards and what each is used for.

FormatAllowed charactersLengthPrimary use
Code 128All 128 ASCII charactersVariableUniversal — shipping, inventory, ID
Code 390-9, A-Z, - . $ / + % spaceVariableOlder inventory and ID cards
EAN-13Digits only13 (12 + check)Worldwide retail product codes
EAN-8Digits only8 (7 + check)Small retail products
UPC-ADigits only12 (11 + check)US/Canada retail
ITF-14Digits only14 (13 + check)Shipping cartons (GTIN-14)
MSIDigits onlyVariableWarehouse shelving
Pharmacode3 to 131,0701–5 digitsPharmaceutical packaging
CodabarDigits + - . $ : / + (delimited A-D)VariableLibraries, blood banks, FedEx

Put It in Perspective

The first product ever scanned at retail (June 26, 1974) was a 10-pack of Wrigley's Juicy Fruit gum at a supermarket in Ohio — a UPC-A code.

Walmart stores collectively scan over 1.5 billion barcodes per day across global operations.

Every book printed since 1970 has an ISBN encoded as an EAN-13 starting with 978 or 979.

Library books worldwide still use Codabar because replacing the installed scanner base would cost billions.

Practical Examples

1

EAN-13 starting with 600–639 indicates a product registered in Pakistan; 890 is India; 690–695 is China; 0–019 is the US/Canada.

2

Code 128 is used on shipping labels, courier airbills, and warehouse pick-tickets because it's compact and accepts any character.

3

UPC-A is what every supermarket scanner in the US reads — the 12-digit code printed on cereal boxes, soft-drink cans, and shampoo bottles.

4

ITF-14 (Interleaved 2 of 5) is the bigger barcode you see on shipping cartons — designed to print on corrugated cardboard without losing legibility.

5

Pharmacode (Code 32 in Italy, Pharmacode One in the US) is the simple binary-style barcode on pharmaceutical packaging used to verify the right pill is in the right blister pack.

6

Codabar predates Code 128 and is still used on FedEx airbills, library books, and blood-bank bag labels because of huge installed-base inertia.

Frequently Asked Questions

Code 128 is the safest default — it accepts letters, digits, and most ASCII symbols, and is read by every modern scanner. Use EAN-13 or UPC-A only if you're registering retail products with GS1. Use ITF-14 for shipping cartons. Code 39 only if you specifically need to encode short uppercase IDs (legacy systems).

Popular Conversions

Jump to a ready-made conversion — useful for quick reference and sharing: