Barcode Generator

Generate 1D barcodes in 9 industry-standard formats. Customize colors, size, and text — download as PNG or print directly.

Enter Barcode Data

Type your data and select a barcode format.

Preview

Enter data to generate a barcode

Customize Appearance

Adjust these settings — the preview updates instantly.

On

About Code 128

How to Generate a Barcode

Four simple steps to create your barcode.

1
Enter Your Data
Type or paste your barcode content. Code 128 accepts letters, numbers, and symbols. EAN-13 and UPC-A need numeric digits only.
2
Choose a Format
Select from 9 barcode formats. Code 128 is the most versatile. Use EAN-13/UPC-A for retail products. Check the format info below for constraints.
3
Customize the Look
Adjust bar width, height, colors, text display, font size, and margin. The barcode preview updates live as you change each setting.
4
Download or Print
Click Download PNG to save as a high-quality image file, or Print to send it directly to your printer for labels and packaging.

Frequently Asked Questions

Common questions about barcodes and this generator.

What is the difference between Code 128 and Code 39?
Code 128 is a high-density barcode that encodes all 128 ASCII characters (letters, numbers, symbols) in a compact form. It is the most common barcode for logistics, shipping, and inventory. Code 39 is older, encodes only 43 characters (A-Z, 0-9, and 7 special symbols), and takes more physical space for the same data. Code 128 includes a mandatory check digit for error detection, while Code 39's check digit is optional. For new applications, Code 128 is almost always the better choice.
How many digits does an EAN-13 barcode need?
An EAN-13 barcode requires exactly 12 digits of input (the tool automatically calculates the 13th digit as a check digit). The structure is: the first 2–3 digits are the GS1 country prefix (e.g., 00–13 for USA/Canada, 690–695 for China), the next 4–5 digits are the manufacturer code, the next 5 digits are the product code, and the final digit is the checksum calculated via the modulo-10 weighted-sum algorithm. The full 13-digit number appears below the barcode bars.
Can I generate barcodes for free?
Yes. This barcode generator creates standard-compliant 1D barcodes completely free, with no signup required. All generation happens in your browser — your data never leaves your device. You can download as PNG, print, and use the barcodes for commercial purposes. Note that while the barcode image is free, obtaining a registered GS1 company prefix (required for EAN-13/UPC-A retail barcodes sold in stores) involves a separate paid registration with GS1 or a GS1-licensed reseller.
What barcode format should I use for my product?
For products sold in retail stores globally, use EAN-13. For products sold only in the United States or Canada, use UPC-A. For internal inventory tracking, shipping labels, or asset management, use Code 128. For cartons and shipping containers, use ITF-14. If you're unsure, Code 128 is the most versatile and widely accepted format for non-retail applications.
What is the difference between UPC-A and EAN-13?
UPC-A (Universal Product Code) is a 12-digit barcode used primarily in the United States and Canada. EAN-13 (International Article Number) is a 13-digit superset used globally. Every UPC-A can be converted to EAN-13 by prepending a 0. The key difference is that EAN-13 has a 2–3 digit country prefix at the start, while UPC-A uses a single leading digit for the numbering system. Since 2005, both systems are part of the unified GS1 global standard, and most modern scanners read both interchangeably.

What is a Barcode?

A barcode is a machine-readable visual representation of data, consisting of parallel lines (bars) of varying widths and spacings. Invented by Norman Woodland and Bernard Silver in 1949 — inspired by Morse code extended into thin and thick bars — barcodes were first commercially used in 1974 when a pack of Wrigley's chewing gum was scanned at a supermarket in Troy, Ohio. Today, barcodes are scanned over 6 billion times per day worldwide across retail, logistics, healthcare, manufacturing, and library systems.

1D barcodes (linear barcodes) encode data in one dimension — horizontally along the width of the bars. A barcode scanner reads the pattern by sweeping a laser or LED across the bars and measuring the reflected light: dark bars absorb light, white spaces reflect it. The pattern is decoded into the original data. This is different from 2D barcodes (QR codes, Data Matrix) which encode data in both horizontal and vertical dimensions using squares or dots, capable of storing up to 7,089 numeric characters in a single symbol.

Supported Barcode Formats

FormatCharacter SetLengthCheck DigitCommon Use
Code 128Full ASCII (0–127)VariableAuto-calculated (mod 103)Logistics, shipping, inventory, healthcare
Code 128BASCII 32–127VariableAuto-calculated (mod 103)Text-heavy labels with symbols
Code 128CNumeric pairs (00–99)Even digitsAuto-calculated (mod 103)Compact numeric data, shipping containers
Code 39A–Z, 0–9, -.$/+% and spaceVariableOptional (mod 43)Defense (MIL-STD-1189), automotive, badges
EAN-13Numeric (0–9)12 digitsAuto-calculated (mod 10)Retail products (global, GS1 standard)
EAN-8Numeric (0–9)7 digitsAuto-calculated (mod 10)Small retail items with limited label space
UPC-ANumeric (0–9)11 digitsAuto-calculated (mod 10)Retail products (US/Canada, GS1 US)
ITF-14Numeric (0–9)13 digitsAuto-calculated (mod 10)Carton/outer case labeling (GTIN-14)
Codabar0–9, -$:/.+VariableNoLibraries, blood banks, photo labs

1D Barcode vs 2D Barcode (QR Code)

1D barcodes (like those generated here) store data linearly — typically 20–25 characters in a horizontal row of bars. They require a laser scanner to read. 2D barcodes (QR codes, Data Matrix, PDF417) store data in a matrix of squares, encoding up to 4,296 alphanumeric characters or 7,089 digits in a small square, readable by any smartphone camera. While 2D codes are more data-dense, 1D barcodes remain the global standard for retail and logistics because they are faster to scan, work with decades of existing infrastructure, and are more tolerant of poor lighting and printing conditions. The choice depends on your use case: 1D for compatibility and speed, 2D for data capacity and smartphone readability.

How the EAN-13 Check Digit Works

The EAN-13 check digit (the 13th digit) is calculated using a modulo-10 weighted-sum algorithm. Starting from the rightmost digit (position 1), multiply every other digit by 3, and the remaining digits by 1. Sum all the products, find the remainder when divided by 10, and subtract from 10 (if the remainder is 0, the check digit is 0). For example, for the digits 5-9-0-1-2-3-4-1-2-3-4-5: (5×1) + (9×3) + (0×1) + (1×3) + (2×1) + (3×3) + (4×1) + (1×3) + (2×1) + (3×3) + (4×1) + (5×3) = 5+27+0+3+2+9+4+3+2+9+4+15 = 83. 83 mod 10 = 3. 10 − 3 = 7. So the check digit is 7, making the full EAN-13: 5-901234-123457. This algorithm catches all single-digit errors and most transposition errors (swapping two adjacent digits) — the two most common types of manual entry mistakes.

How to Use Barcodes Effectively

The History of Barcode Technology

The concept of machine-readable product coding dates back to 1932, when Harvard business student Wallace Flint envisioned an automated grocery system using punched cards. The modern barcode was born in 1949 when Norman Woodland, a Drexel graduate student, drew Morse code dots and dashes in the sand and extended them vertically into lines. Working with Bernard Silver, Woodland filed US patent 2,612,994 in 1952 for "Classifying Apparatus and Method" — a bullseye-shaped barcode read by a 500-watt light bulb and photomultiplier tube. The linear barcode we know today emerged from the 1970s when IBM engineer George Laurer developed the Universal Product Code (UPC), scanning its first product — a 67-cent pack of Wrigley's Juicy Fruit gum — on June 26, 1974, at Marsh Supermarket in Troy, Ohio. That original pack of gum is now displayed at the Smithsonian National Museum of American History. By 2025, GS1 barcodes were scanned over 10 billion times daily across 150+ countries, making the barcode one of the most ubiquitous technologies ever invented.