Free Code 128 Barcode Generator
Generate high-density Code 128 barcodes. Supports all ASCII characters. Ideal for shipping labels, inventory, and logistics.
Enter data to preview barcode
Download
Enter valid barcode data to enable download
What is Code 128?
Code 128 is a high-density linear barcode symbology defined in ISO/IEC 15417:2007. Developed in 1981 by Computer Identics Corporation, it can encode all 128 ASCII characters and is widely used in shipping, packaging, healthcare, and inventory management. Code 128 is self-checking and includes a mandatory check character calculated using a weighted modulo-103 algorithm.
Unlike fixed-length barcode types like EAN-13 or UPC-A, Code 128 is variable-length — you can encode any amount of text or numeric data from a single character to dozens of characters. This flexibility, combined with its high density and reliability, makes it one of the most widely deployed barcode formats in industrial and logistics applications.
Code 128 Subtypes (A, B, C)
Code 128 has three subsets that are automatically selected for optimal encoding:
- Code 128A: Encodes uppercase letters (A–Z), digits (0–9), and ASCII control characters (NUL, SOH, STX, etc.). Used when control characters are needed in the data.
- Code 128B: Encodes the full printable ASCII character set including both uppercase and lowercase letters, digits, and all standard punctuation. This is the most commonly used subset for general alphanumeric data.
- Code 128C: Encodes numeric data only, storing digit pairs (00–99) in a single barcode symbol. This achieves the highest data density for numeric-only strings — ideal for serial numbers, lot numbers, or any long numeric sequence.
This generator automatically selects the optimal subset(s) for your data. When mixed data types are present, it may switch subsets mid-barcode for maximum efficiency.
Common Uses of Code 128
Code 128 is the dominant format in many industries:
- Shipping & Logistics: FedEx, UPS, USPS, and DHL all use Code 128 variants for package tracking labels
- GS1-128 Supply Chain: Required by major retailers (Walmart, Target, Costco) for carton-level logistics labels encoding lot numbers, dates, and serial numbers
- Healthcare: Patient wristbands, medication labels, and specimen tubes in hospitals
- Library Systems: Patron cards and book labels in many library management systems
- Inventory Management: Asset tracking, warehouse bin labels, and internal part numbers
- Retail Backroom: Store receiving labels, price change tags, and markdown stickers
Code 128 vs Other Barcode Types
When choosing between Code 128 and other linear barcodes:
- Code 128 vs Code 39: Code 128 is significantly more compact (about 30% smaller for the same data) and supports more characters including lowercase letters and control characters. Code 39 is older but more widely supported on legacy systems.
- Code 128 vs EAN-13/UPC-A: EAN-13 and UPC-A are fixed-length retail formats encoding only 12–13 digits. Use Code 128 when you need variable-length or alphanumeric data.
- Code 128 vs QR Code: QR codes can encode much more data (up to ~3000 characters) and support 2D scanning. Use Code 128 when scanners are laser-based or when the linear format is required by your system.
- Code 128 vs ITF-14: ITF-14 is used specifically for outer case/shipping container labels encoding 14 digits. Code 128 is more versatile but ITF-14 can be printed directly on corrugated cardboard without a label.
GS1-128 (Formerly UCC-128)
GS1-128 is a specific application of Code 128 that uses standardized Application Identifiers (AIs) to encode structured supply chain data. Examples:
- AI (01): GTIN — product identifier
- AI (10): Lot/batch number
- AI (11): Production date
- AI (17): Expiry date
- AI (21): Serial number
- AI (310x): Net weight in kilograms
GS1-128 labels are required by major retailers for carton receiving. This generator creates standard Code 128 barcodes — for full GS1-128 with Application Identifiers, you would need to format the data string according to GS1 specifications (the FNC1 character and proper AI formatting).
Frequently Asked Questions
What characters can Code 128 encode?
Code 128 can encode all 128 ASCII characters (0–127), including uppercase and lowercase letters, digits, punctuation, and control characters.
What is the difference between Code 128A, 128B, and 128C?
128A supports control characters and uppercase only. 128B supports full printable ASCII including lowercase. 128C encodes numeric pairs at highest density. The generator auto-selects the optimal subset.
How long can a Code 128 barcode be?
Code 128 is variable length with no fixed maximum. For reliable scanning, keep data under 80 characters. Very long barcodes become physically wider and harder to scan accurately.
What is GS1-128?
GS1-128 is a specific application of Code 128 using standardized Application Identifiers to encode supply chain data (lot numbers, expiry dates, serial numbers). Required by many retailers for carton-level logistics labels.