Code 128 Barcode Generator

This free Code 128 barcode generator creates high-density alphanumeric barcodes for shipping labels, inventory tracking, and logistics. Download as SVG or PNG.

What Is Code 128?

Code 128 was invented in 1981 by Computer Identics Corporation and standardised as ISO/IEC 15417. It encodes the complete 128-character ASCII set using three mutually exclusive code sets: Code Set A (uppercase letters, digits, and control characters), Code Set B (uppercase and lowercase letters, digits, and special characters), and Code Set C (pairs of digits encoded in a single symbol character, giving it the highest numeric density of the three subsets). A Code 128 barcode can switch between code sets mid-symbol using START A/B/C and CODE A/B/C shift characters, allowing an encoder to optimise width for mixed alphanumeric strings. The standard mandates a weighted modulo-103 check character appended before the STOP pattern. GS1-128 (formerly EAN-128) is a restricted subset of Code 128 that uses Application Identifiers to add semantic meaning to encoded data fields — for example, AI 01 for a GTIN and AI 17 for an expiry date — making it the dominant barcode in pharmaceutical, food, and shipping label standards worldwide.
Code 128 is a high-density linear barcode symbology defined in ISO/IEC 15417 that encodes the full ASCII 128-character set including uppercase and lowercase letters, digits, punctuation, and control characters. It is the most widely used alphanumeric barcode in shipping, logistics, and warehouse management because it achieves significantly higher data density than older formats like Code 39 -- encoding the same information in roughly 30% less horizontal space. Code 128 uses three character subsets (A, B, and C) and automatically switches between them to optimize barcode width. Subset C is particularly efficient for encoding long numeric strings such as tracking numbers, compressing two digits into a single barcode symbol. This Code 128 barcode generator creates barcodes that comply with GS1 application identifier standards and scan reliably with all commercial handheld and fixed-mount barcode readers used in fulfillment centers, distribution warehouses, and retail supply chains.

Code 128 was introduced in 1981 and quickly became the industry standard for non-retail barcodes. It uses three character sets (A, B, and C) to efficiently encode different types of data. Set C is particularly efficient for numeric-only data, encoding two digits per symbol character.

The format is required by FedEx, UPS, USPS, and most logistics providers for package tracking labels. It supports variable-length data with no fixed digit count, making it versatile for warehouse, healthcare, and manufacturing applications.

Code 128 vs Other Linear Barcodes

Code 128 is the preferred linear barcode for alphanumeric data encoding in logistics and supply chain operations, but choosing between Code 128 and alternatives like Code 39 or UPC depends on your specific use case, scanning environment, and data requirements. Code 128 encodes the full 128-character ASCII set at significantly higher density than Code 39, which supports only uppercase letters, digits, and seven special characters. For retail product identification, UPC-A and EAN-13 are the required formats because point-of-sale systems are built around the fixed 12-digit or 13-digit GTIN structure managed by GS1. Code 128 excels in variable-length scenarios where you need to encode tracking numbers, serial codes, location identifiers, or any alphanumeric string without a fixed digit count. FedEx, UPS, USPS, DHL, and every major shipping carrier use Code 128 for package tracking labels because of its density, reliability, and broad scanner compatibility.
FeatureCode 128Code 39UPC-A
Character setFull ASCII (128 chars)A-Z, 0-9, 7 specialsDigits only (0-9)
Data densityHigh (compact)Low (wide bars)Fixed 12 digits
Variable lengthYesYesNo (12 digits)
Primary useShipping, logistics, inventoryAutomotive, defenseRetail products

For retail products, use UPC-A or EAN-13 instead. Code 128 is designed for logistics and internal operations, not point-of-sale scanning.

Common Uses for Code 128 Barcodes

Code 128 barcodes are used across every industry that requires machine-readable alphanumeric identification labels. The format dominates shipping and logistics because carriers like FedEx, UPS, USPS, and DHL standardized on Code 128 for package tracking numbers printed on shipping labels. In warehouse management, Code 128 identifies storage locations, bin positions, pallet tags, and pick-list items -- enabling barcode scanners to guide workers through fulfillment workflows. Healthcare facilities use Code 128 on patient wristbands, specimen collection tubes, medication labels, and surgical instrument trays to reduce identification errors and maintain chain-of-custody records. Manufacturing operations encode work-in-progress serial numbers, batch codes, and quality control markers as Code 128 barcodes attached to assemblies moving through production lines. Libraries and media rental services print Code 128 barcodes on books, DVDs, and equipment for streamlined checkout, return processing, and comprehensive inventory management across multiple branch locations.
  • Shipping labels -- FedEx, UPS, and USPS tracking numbers are encoded as Code 128
  • Warehouse inventory -- Location labels, bin tags, and pick-list identifiers
  • Healthcare -- Patient wristbands, specimen labels, and medication tracking
  • Manufacturing -- Work-in-progress tracking and serial number labels
  • Library systems -- Book and media identification barcodes

Need a different barcode type? See the main barcode generator for 50+ formats, or try bulk generation to create hundreds of Code 128 labels at once.

Related Barcode Formats

Code 128 is optimized for shipping and internal logistics. For other scenarios, pair it with the right retail or 2D format:

  • UPC-A -- North American retail product barcode for the saleable unit that ships inside the Code 128-labeled carton.
  • EAN-13 -- International retail barcode for products sold outside North America (paired with Code 128 shipping labels).
  • Data Matrix -- When the label area is too small for a linear Code 128, use Data Matrix for direct part marking on electronics, surgical instruments, and small pharmaceutical packages.
  • QR Code -- For scan-to-track shipment status pages where customers scan the outer label with a phone camera.
  • Bulk Generator -- Generate hundreds of Code 128 labels from a CSV list for warehouse bin tags, batch tickets, or shipping manifests.

Code 128 FAQ

Code 128 is the most widely deployed alphanumeric barcode format in shipping, logistics, and warehouse management, used by FedEx, UPS, USPS, DHL, and every major carrier worldwide. This Code 128 barcode generator FAQ answers the most common questions about the symbology's character encoding capabilities, the distinction between Code 128's three character subsets (A, B, and C), the relationship between standard Code 128 and the GS1-128 supply chain data standard that adds Application Identifiers for batch numbers and expiration dates, maximum barcode length limitations for handheld and fixed-mount scanners, and which barcode reading hardware supports the format. Whether you are printing package tracking labels for e-commerce shipments, creating inventory location markers and bin tags for warehouse shelves, encoding serial numbers for manufacturing traceability and quality control, or labeling patient specimens in a healthcare facility, these answers explain how to use Code 128 barcodes effectively for your specific application and industry requirements.

Code 128 encodes the full 128-character ASCII set, including uppercase and lowercase letters, digits, punctuation, and control characters. That broad support makes it the standard linear barcode for shipping labels, warehouse identifiers, tracking numbers, serial numbers, and other variable-length business data.
GS1-128 (formerly EAN/UCC-128) is a subset of Code 128 that uses Application Identifiers (AIs) to structure supply chain data. It follows the Code 128 encoding standard but adds specific data formatting rules for fields like batch numbers, expiration dates, and serial numbers.
There is no fixed maximum length -- the barcode grows wider as more data is encoded. Practically, most scanners can read barcodes up to about 80 characters. For very long data strings, consider using a 2D format like Data Matrix or QR Code.
Sources: GS1 Barcode Standards · ISO/IEC 15420 (EAN/UPC) · ISO/IEC 15417 (Code 128) · Amazon FBA Product ID Requirements