Code 128 – Barcode Description
Code 128 supports the entire printable ASCII character set as well as 32 additional control characters – 128 characters in total, hence the name. The character set includes:
- Digits (0–9)
- Uppercase letters (A–Z) and lowercase letters (a–z)
- Control characters in the ASCII range 0–31 (e.g., Tabulator, Line Feed)
- The space character and the special characters !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
This makes Code 128 one of the most versatile linear barcodes available. For a detailed comparison with other common 1D barcode types, see our article Code 128 vs. Interleaved 2/5 vs. Code 39.
Code 128 versus GS1-128
Code 128 should not be confused with GS1-128 (formerly known as UCC/EAN-128). While GS1-128 is based on Code 128, it is a separate standard defined by the GS1 organization: it always begins with a special character (FNC1) and structures its data using standardized Application Identifiers (AIs) – fixed numeric prefixes that define the meaning of the following value (e.g., GTIN, expiry date or batch number). A plain Code 128 barcode contains no such structure. If you need to generate a GS1-128 barcode, use our dedicated GS1-128 Generator.
Code 128 – Variants A, B and C
In addition to Code 128, our online generator offers the variants Code 128 A, Code 128 B and Code 128 C. These are not standalone barcode types, but rather three internal character sets that a Code 128 barcode can switch between as needed. The result is always a standard Code 128 barcode, read and identified as "Code 128" by any conventional scanner.
Explicitly selecting Code 128 A, B or C in the generator is useful when the data to be encoded should undergo additional validation (e.g., the C variant enforces digit-only input, rejecting any other characters) or when a specific requirement demands it:
- Character set A: Digits (0–9), uppercase letters (A–Z), the space character, control
characters (ASCII 0–31) and the special characters !"#$%&'()*+,-./:;<=>?@[\]^_
(covers the ASCII range 0–95) - Character set B: Digits (0–9), uppercase letters (A–Z), lowercase letters (a–z),
the space character and the special characters !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
(covers the ASCII range 32–127) - Character set C: Digits only (0–9), encoded internally as digit pairs from 00 to 99. As a result, a purely numeric string requires only half the space compared to character set A or B – making Code 128 C very compact for numeric-only data. Since digit pairs are encoded, an even number of digits is required. See also the option Add a leading '0' when digit count is odd in the barcode generator.
Code 128 – Check Digit
In Code 128, the check digit is a mandatory part of the barcode specification – it is calculated automatically by our generator and integrated into the barcode. Unlike some other barcode types, the check digit is not visible in the human-readable text line below the barcode, as it serves exclusively for internal verification by the scanner.
When scanning, the scanner independently calculates the check digit using the same algorithm as was used during encoding and compares the result to the value found in the barcode. If both match, the scan is considered valid.
Download Formats – Vector and Raster
Vector formats (PDF, EPS, SVG) store geometric coordinates with six-digit decimal precision. The human-readable text line is converted to outlines, so no fonts are needed once the barcode is generated.
- PDF: Supports CMYK and RGB colors as well as transparent backgrounds. Ideal for direct use in print workflows.
- EPS: Functionally identical to PDF; additionally includes an embedded TIFF preview for DTP applications without native EPS support.
- SVG: Limited to RGB colors and particularly suited for integration into browser-based applications.
Raster formats (PNG, BMP, JPG) store the selected DPI resolution in the file header, allowing graphics applications to correctly interpret the physical size of the barcode. Bar widths are precisely aligned to the target resolution to avoid aliasing artifacts – even at print resolutions of 203 or 300 DPI, scannability is maintained.
- PNG: Lossless compression with support for transparent backgrounds.
- BMP: Uncompressed format without quality loss.
- JPG: Lossy compression; the high contrast of barcode graphics combined with a quality factor of 100% prevents visible compression artifacts.
Code 128 Generator for Professionals – Batch Mode, InDesign + Illustrator ready
For more demanding requirements, we recommend our desktop software Barcode Vectorizer, which combines all the features of our free online generator with a range of professional capabilities.
Standard Edition:
- Direct transfer of barcodes via Drag & Drop or Copy & Paste as PDF, EPS, or SVG into applications such as Adobe InDesign, Adobe Illustrator, or CorelDRAW
- Precise color selection with numeric values for color components (0–100 for CMYK, 0–255 for RGB)
- Save function for reusing your own designs
- Over 20 supported linear barcode types, including all Code 128 variants
Pro Edition – additionally:
- Batch mode: Generate hundreds of barcodes from your own lists at once – ideal for product labeling, inventory management or shipping labels
- Serial number generator: Automatic generation of sequential strings with freely selectable start, end and increment values
- Barcode API: Seamless integration of the barcode generator into your own applications or workflows
Download 30-Day Trial