Code 128 Barcode Generator – Free Online Tool

Generate Code 128 barcodes instantly — no signup or paywall. Enter your data, preview the barcode in real time, and download unlimited barcodes as PNG. All processing happens in your browser.

Format

100px600px
50px300px

What is Code 128?

Code 128 is a high-density linear barcode symbology invented in 1981 by Computer Identics. It encodes the full ASCII 128-character set across three subsets that can be mixed within a single barcode: Subset A covers uppercase letters and ASCII control characters; Subset B covers the full printable ASCII range including lowercase letters; Subset C encodes digit pairs — 2 digits per symbol — making it the densest 1D encoding available for numeric data. A Subset C barcode for a 20-digit number occupies roughly half the space of a Code 39 equivalent.

Code 128 produces barcodes approximately 30% shorter than equivalent Code 39 barcodes for the same alphanumeric data, and significantly shorter when the data is purely numeric using Subset C. Every Code 128 barcode includes a mandatory check digit calculated using the Modulo 103 algorithm, which allows scanners to detect and reject misreads. This combination of high density, full ASCII support, and built-in error detection makes Code 128 the preferred 1D format for new implementations across logistics, healthcare, and industrial applications.

Code 128 is standardized as ISO/IEC 15417. The GS1-128 application standard — which uses Application Identifiers (AIs) to structure supply chain data — is part of the GS1 General Specifications.

For example, a GS1-128 carton label for a pharmaceutical shipment might encode: (00)003601234500000019 — where Application Identifier (00) signals a Serial Shipping Container Code (SSCC) and the remaining 18 digits uniquely identify the pallet in the supply chain. This kind of structured data encoding distinguishes GS1-128 from plain Code 128: the AI prefix tells the receiving system exactly how to interpret each data field, enabling automated warehouse receiving, expiration date enforcement, and end-to-end traceability.

Today Code 128 barcodes appear on FedEx and UPS parcel labels, hospital patient wristbands, pharmaceutical blister packs, and government identification documents. Its support for the full ASCII character set — including lowercase letters and special characters — makes it the right default choice for any internal labeling application where data density and character flexibility both matter.

Code 128 vs Other Barcodes

Choosing the right barcode format depends on the characters you need to encode, how compact the barcode needs to be, and what scanning infrastructure you are working with:

FormatCharacters SupportedData DensityCommon Use Cases
Code 128All 128 ASCII charactersHighShipping labels, inventory, healthcare
EAN-13Digits only (13 digits)Fixed-lengthRetail product packaging (Europe)
UPC-ADigits only (12 digits)Fixed-lengthRetail product packaging (North America)
Code 3943 characters (uppercase only)LowDefense, automotive, legacy systems

Where is Code 128 Used?

Code 128 barcodes appear across virtually every industry that relies on automated data capture. In logistics and shipping, carriers like FedEx, UPS, and national postal services use Code 128 on parcel labels to track packages through sorting facilities. Warehouse management systems use Code 128 on bin labels, pallet tags, and picking lists to guide workers and automate inventory counts.

In healthcare, Code 128 is printed on patient wristbands, medication packaging, and laboratory specimen tubes to reduce transcription errors and improve patient safety. Government and defense organizations use Code 128 on identification cards, asset tags, and supply chain documents where the full ASCII character set and high density are required. Retailers use Code 128 for internal shelf labels and receiving documents, even when EAN or UPC codes appear on consumer-facing packaging.

Frequently Asked Questions

What characters does Code 128 support?

Code 128 supports the full ASCII character set — all 128 characters, including uppercase and lowercase letters, digits, punctuation, and control characters. Subset A covers uppercase letters and control characters. Subset B covers the full printable ASCII range. Subset C is optimized for encoding pairs of digits, doubling numeric data density. This broad character support makes Code 128 one of the most versatile 1D barcode formats available.

What is the difference between Code 128 and Code 39?

Code 39 supports only 43 characters — uppercase letters, digits, and a handful of special characters — and encodes each character using 5 bars and 4 spaces. Code 128 supports all 128 ASCII characters and uses a more compact encoding scheme, producing barcodes that are roughly 30% shorter for the same data. Code 128 also includes a mandatory check digit, making it more reliable for scanning. Code 39 is still common in older legacy systems, but Code 128 is preferred for new implementations that require higher density or lowercase characters.

What is GS1-128?

GS1-128 (formerly known as UCC/EAN-128) is a special application of Code 128 that uses Application Identifiers (AIs) to structure data in a standardized way. It is widely used in supply chain and logistics to encode information such as batch numbers, expiration dates, serial numbers, and shipping container codes. GS1-128 barcodes always begin with the FNC1 character to signal GS1 formatting. If you are generating barcodes for retail supply chains, you likely need GS1-128 rather than plain Code 128.

What is the maximum data length for Code 128?

There is no hard limit defined by the Code 128 specification, but practical scanners typically handle up to 48 characters reliably. Very long Code 128 barcodes become physically wide, which can cause scanning errors if the label is too narrow or the scanner beam does not cover the full width. For best results, keep encoded data under 80 characters and ensure the printed barcode has quiet zones (blank margins) of at least 10 bar widths on each side.

Can I use Code 128 barcodes on product labels?

Yes. Code 128 is widely used on product labels, shipping boxes, warehouse bins, and internal asset tags. However, for retail point-of-sale scanning — where the barcode is scanned at checkout — you should use EAN-13 or UPC-A, as those are the formats that global retail systems are configured to read. Code 128 is the preferred choice for logistics labels, internal inventory systems, and any application where you control both the printing and scanning equipment.

What is the minimum size for a scannable Code 128 barcode?

The minimum recommended X-dimension (width of the narrowest bar) is 0.25 mm for high-quality printing environments. For standard office printing, 0.5 mm or larger is safer. The overall barcode width depends on the number of characters encoded, and the height should be at least 15% of the total barcode width, with a minimum of 6.35 mm. Always include quiet zones of at least 10X on each side of the barcode, where X is the X-dimension.