Barcode Generator - Create Code 128 Barcodes Online

Generate Code 128 barcodes online for free with this barcode generator . Create scannable barcodes for products, inventory, retail SKUs, shipping labels, and asset tags — all compatible with virtually every laser and image scanner, ready to print in seconds. No registration, no watermarks, and the barcode downloads as a high-resolution PNG.

Code 128 is a one-dimensional (linear) barcode: it encodes data as a sequence of vertical bars and spaces of varying widths that a scanner reads in a single pass. Unlike a QR code , which stores data in a 2D grid, a linear barcode holds a single short string. That makes it ideal for product IDs, SKUs, and serial numbers where you want a compact, universally-scannable identifier.

Why Use an Online Barcode Generator?

An online barcode generator lets you produce a Code 128 barcode the moment you need one, without buying label software or installing a plugin. Type a product code, SKU, or serial number and the tool renders the bars instantly, ready to copy into an invoice, paste onto a packaging design, or print onto an adhesive label. The output is a clean PNG that scales without quality loss.

Code 128 is the most flexible linear barcode maker format because it supports all 128 ASCII characters — letters, digits, and symbols — in a compact width. That is why it is the default for shipping (GS1-128), warehouse inventory, and point-of-sale systems worldwide. Because this create barcode online tool runs entirely in your browser, your product codes never leave your device, which matters for confidential SKUs and unreleased catalogues.

Live Example

Type any alphanumeric value and the generator renders it as a Code 128 barcode on the right. The bars represent your value encoded as a sequence of widths; the scanner decodes those widths back into the original text:

Input (value to encode)

PROD-000123456

Output (bars, simplified)

|||| ||| | |||| || ||||| ||| | ||  ||

How to Use Barcode Generator

  1. Enter Data: Type or paste the text, numbers, or data you want to encode into the barcode.
  2. Generate Barcode: The tool automatically creates a barcode image from your input data.
  3. Preview and Download: Preview your barcode and download it in high-quality format for printing or digital use.

Key Features

  • ✅ Support for Code 128 barcode format
  • ✅ Real-time barcode preview as you type
  • ✅ Instant download in high-quality image format
  • ✅ Compatible with most barcode scanners
  • ✅ Easy-to-use interface for quick barcode creation
  • ✅ No registration or sign-up required

Common Use Cases

  • Product Labeling: Create barcodes for retail products, packaging, and inventory items.
  • Inventory Management: Track and manage stock with unique barcode identifiers.
  • Asset Tracking: Label equipment, tools, and company assets for easy identification.
  • Library Systems: Generate barcodes for books, media, and library resources.
  • Event Management: Create barcodes for tickets, passes, and attendee badges.

Benefits of Using Our Barcode Generator

  • ✅ Completely free to use with no limitations
  • ✅ Fast barcode generation in real-time
  • ✅ High-quality output suitable for printing
  • ✅ Works on all devices - desktop and mobile
  • ✅ No data storage - your information stays private

About Barcodes — How They Work

A barcode is a machine-readable representation of data. The most common retail style is the one-dimensional (linear) barcode, which prints data as parallel vertical bars and spaces of different widths. A scanner shines a light or laser across the bars, measures the widths of the dark and light regions, and converts that pattern back into the original characters using a defined symbology .

This tool generates Code 128 , one of the most powerful linear symbologies. Code 128 can encode all 128 ASCII characters (digits, letters, and symbols) and comes in three subsets: Code 128 A (uppercase letters and control characters), Code 128 B (upper- and lowercase letters), and Code 128 C (pairs of digits, which are the most compact). The generator auto-selects the best subset for your input and appends a check digit — a calculated character that lets a scanner detect a misread, so a damaged or smudged code is rejected rather than silently returning the wrong value.

Code 128 is the backbone of shipping labels (GS1-128), warehouse bins, and asset tags because it is compact and universally supported. It is different from retail point-of-sale codes like EAN-13 or UPC-A (which have a fixed 12–13 digit length) and from QR codes (which are two-dimensional and hold far more data). For anything longer than a short ID — a URL, contact, or Wi-Fi login — reach for a QR code instead. To turn a generated label graphic into a raster file, use SVG to PNG .

Common Errors and How to Fix Them

  • Barcode will not scan: The value may be too long, making individual bars too thin for low-resolution laser scanners. Keep encoded strings concise (ideally under 40–50 characters); switch to a 2D QR code for long URLs or rich text.
  • Scanner returns unexpected characters: Code 128 supports full ASCII, but older legacy handheld scanners might be hardwired to standard alphanumeric Code 39. Confirm whether your target inventory hardware expects Subset B or Subset C.
  • Missing Quiet Zone margin: Linear barcodes require a blank white margin (at least 10 times the width of the thinnest bar) on both sides. Never crop or place borders right up against the edge of the bars.
  • Low print contrast or smudged thermal print: Ensure high-contrast pure black bars on a pure white or matte surface. Thermal transfer ribbons with poor heat settings can bleed ink and alter bar widths.

Code 128 Subsets: How Numbers and Text Are Encoded

Code 128 automatically shifts between three internal character subsets to achieve maximum compression and shortest printed width:

SubsetSupported CharactersIdeal Use CaseData Density
Code 128 AUppercase letters, numbers, ASCII control codes (00–95)Industrial automation, legacy mainframe terminals1 char per symbol
Code 128 BUppercase & lowercase letters, numbers, punctuation (32–127)Standard retail packaging, asset tags, mixed text serials1 char per symbol
Code 128 CNumeric pairs only (00 through 99)SKUs, product numbers, tracking codes, pallet IDs2 digits per symbol (50% width)

Barcode Symbology Comparison: Which Format Do You Need?

Selecting the correct barcode standard depends on your industry requirements and the data you need to encode:

SymbologyTypeSupported DataIndustry Standard
Code 1281D LinearFull 128 ASCII (letters, numbers, symbols)Logistics, warehousing, shipping labels, healthcare
Code 391D LinearUppercase letters, numbers, select symbols (wider bars)Automotive, defense, aerospace inventory
UPC-A / EAN-131D LinearFixed 12 or 13 numeric digits onlyConsumer retail checkouts, supermarket POS
QR Code2D MatrixUp to 7,089 numbers or 4,296 alphanumeric charactersMobile scanning, website URLs, ticketing, menus

How to Generate Code 128 Barcodes in Code

Generate Code 128 barcodes programmatically inside your web or backend applications:

JavaScript / Node.js (JsBarcode)

// Using JsBarcode in browser or SVG renderer
import JsBarcode from 'jsbarcode';

// Render into an SVG or Canvas element
JsBarcode('#barcodeCanvas', 'SKU-987452', {
  format: 'CODE128',
  lineColor: '#000000',
  width: 2,
  height: 80,
  displayValue: true
});

Python (python-barcode)

import barcode
from barcode.writer import ImageWriter

# Generate Code 128 barcode as PNG
code128 = barcode.get_barcode_class('code128')
bar = code128('SKU-987452', writer=ImageWriter())
bar.save('barcode_output')

Frequently Asked Questions

1What barcode formats are supported?

Our barcode generator supports Code 128 format, which is widely compatible with most barcode scanners and printing systems.

2Can I customize the barcode appearance?

Yes, you can customize barcode settings including size and color to match your specific requirements.

3How do I download the generated barcode?

After generating your barcode, simply click the download button to save it as an image file for printing or digital use.

4Is the barcode generator free to use?

Yes, the tool is completely free with no registration, no watermarks, and no usage limits. Create and download as many barcodes as you need.

5Are the barcodes compatible with all scanners?

Code 128 barcodes produced by this tool are scannable by virtually all modern laser and image-based barcode scanners used in retail and inventory systems.

6Is there a limit to the data I can encode?

Code 128 supports alphanumeric data, but for best scannability we recommend keeping the encoded value short. For longer data such as URLs, use a QR code generator instead.

7Why is Code 128 the best choice for number-only barcodes?

Code 128 includes Subset C, an optimized numeric compression mode that encodes pairs of digits into a single bar pattern. This cuts the barcode width in half compared to Code 39, making it ideal for compact SKU and product serial labels.

8What is a barcode quiet zone and why is it necessary?

A quiet zone is the blank white space on the left and right edges of the barcode (at least 10 times the width of the thinnest bar). Scanners require this clear margin to detect the start and stop patterns reliably.