Free Code 128 Barcode Generator

Generate Code 128 barcodes from any text or alphanumeric data. The most versatile barcode format for shipping, logistics, and inventory.

🔒 Your data stays in your browser

Customize

PNG Resolution:

Check Digit Calculator

Enter 11 digits (UPC-A) or 12 digits (EAN-13) to calculate the check digit.

Last updated: March 2026

What Is Code 128?

Code 128 is a high-density linear barcode that can encode the entire 128-character ASCII set — all uppercase and lowercase letters, numbers, and symbols. Developed in 1981, it's now the most widely used barcode format for non-retail applications including shipping labels, inventory systems, and logistics tracking.

Its key advantage is information density. Code 128 produces shorter barcodes than Code 39 for the same data, and it includes a built-in checksum character for reliable scanning. It automatically switches between three character subsets (A, B, C) to minimize barcode width.

Code 128 vs Code 39

Code 128 is the better choice in almost all cases. It encodes the same data in about 30% less space, supports lowercase letters and all ASCII characters, and includes a mandatory checksum for error detection. The only reason to use Code 39 is compatibility with legacy systems that don't support Code 128.

Code 39 has one advantage: it's self-checking, meaning it can be read without a check digit (though one is recommended). This made it popular in government and military applications where simplicity was valued. However, for any new implementation, Code 128 is the standard recommendation.

Frequently Asked Questions

What is Code 128?

Code 128 is a high-density barcode format that can encode all 128 ASCII characters — letters, numbers, and symbols. It's the most versatile barcode type and is widely used for shipping labels (GS1-128), inventory management, logistics, and any application where you need to encode text, not just numbers.

What's the difference between Code 128 and Code 39?

Code 128 is more compact and efficient — it encodes the same data in a shorter barcode. Code 128 supports all 128 ASCII characters while Code 39 only supports A-Z, 0-9, and a few special characters. Code 128 also has a built-in checksum for better error detection. Use Code 128 unless you specifically need Code 39 for legacy system compatibility.

What are Code 128 subsets A, B, and C?

Code 128A encodes uppercase letters, numbers, and control characters. Code 128B encodes uppercase and lowercase letters plus numbers. Code 128C encodes pairs of digits (00-99) very efficiently — twice as dense as A or B for numeric data. Most generators (including this one) automatically switch between subsets to produce the shortest barcode.

What is GS1-128 (formerly UCC/EAN-128)?

GS1-128 is a subset of Code 128 that uses Application Identifiers (AIs) to encode standardized data like batch numbers, expiration dates, serial numbers, and shipping container codes. It's the standard for shipping labels worldwide. The barcode itself uses Code 128 encoding.

How long can a Code 128 barcode be?

There's no strict maximum length, but practical limits exist. Most scanners can read barcodes up to about 4 inches wide. Since each character adds width, you can typically encode 20-25 characters comfortably. For longer data, consider using a 2D barcode like a QR code instead.

Can Code 128 encode special characters?

Yes. Code 128 can encode all 128 ASCII characters, including spaces, punctuation (!@#$%^&*), and even control characters (tab, carriage return). This makes it ideal for encoding URLs, serial numbers with dashes, or any alphanumeric string with special characters.

More Tools You'll Like