Code 128 Barcode Generator
Generate Code 128 barcodes (A, B and C) for any text/number with PNG and SVG download — ideal for labels and logistics.
Code 128 — the high-density 1D barcode
Code 128 is a linear (1D) barcode symbology standardised by ISO/IEC 15417 (2007). It can encode the full 128-character ASCII set — uppercase, lowercase, digits and symbols — in a variable-length code that is roughly 24% denser per character than Code 39. This combination of full ASCII and compactness made Code 128 the dominant 1D symbology in logistics, shipping labels and supply-chain track-and-trace.
Subsets A, B and C — and automatic switching
Code 128 has three character subsets and a scanner reads embedded mode shifts to switch between them on the fly:
- Subset A — uppercase letters, digits, symbols and ASCII control codes (
0x00–0x1F). - Subset B — uppercase, lowercase, digits and printable symbols (most common general-purpose choice).
- Subset C — numeric only, but packs two digits per bar pair, making it the densest mode for long numeric payloads (GTINs, SSCCs, tracking numbers).
Each symbol carries a weighted modulo-103 checksum and requires a quiet zone of at least 10x the narrow-bar width on both sides to be read reliably.
GS1-128 and supply-chain traceability
GS1-128 (formerly UCC/EAN-128) is a superset of Code 128 that uses Application Identifiers prefixed by the FNC1 character to structure data globally. Common AIs include:
00SSCC (logistic unit),01GTIN (product identifier)10batch/lot,11production date,17expiration21serial number,310xnet weight,421ship-to postal code
Real-world uses
Code 128 is everywhere in operations: shipping labels (UPS, FedEx, DHL tracking numbers), inventory management, healthcare (patient wristbands, sample tubes) and pharmaceuticals. Drug serialization mandates such as EU FMD, US DSCSA, ANVISA RDC 157/2017 in Brazil and Mexico's ePedimento rely on GS1-128 or GS1 DataMatrix for end-to-end traceability. In Brazil, the DANFE (Documento Auxiliar da NF-e) carries the 44-digit chave de acesso encoded in Code 128.
Tools, libraries and label output
Common generators include bwip-js and JsBarcode (JavaScript), python-barcode and treepoem (Python). Production label printers usually consume ZPL (Zebra Programming Language) or EPL. Mobile reading is handled by ZXing, AVFoundation (iOS) and ML Kit (Android), all of which auto-detect Code 128.
FAQ
Code 128 vs Code 39? Code 128 supports the full ASCII set (Code 39 only 44 characters) and is roughly 24% denser per character. Choose Code 128 unless you have a legacy reader limited to Code 39.
Can I use it for global product serialization? Yes, via GS1-128 with Application Identifiers. Pure Code 128 has no semantic structure — GS1-128 adds the standardized data layer the supply chain expects.
Is Code 128 required for healthcare? Many jurisdictions mandate some traceable 1D or 2D barcode: GS1-128 and GS1 DataMatrix are the two GS1-endorsed options. Hospitals worldwide use Code 128 on patient wristbands and lab samples.
Why subset C for numeric data? Subset C encodes two digits per symbol character, so a 16-digit GTIN-like number takes only 8 characters of bar width — vastly smaller than Code 39 or even subsets A/B.
Related Tools
Handwriting Generator
Convert typed text into an image with handwriting appearance. Useful for adding a personal touch to digital work.
Resume Generator
Fill a simple printable A4 CV from a form with personal data, education and experience.
Favicon Generator
Generate a favicon from text/emoji in all common sizes (16, 32, 48, 64, 192, 512). PNG download.