⚡ LIMITED TIME: USE CODE "NEDJECT30" FOR 30% OFF & 30-DAY EXTENDED FREE TRIAL ON ALL PRO PASSES
NEDJECT
HomeBlogSupply Chain & Logistics
Supply Chain & LogisticsApril 2, 20268 min readISO/IEC Print Verified

Barcode Generator 128: Complete Technical Guide to Code 128 Subsets A, B, C & Modulo 103 Verification

An authoritative engineering specification of Code 128 barcode generation. Learn how Subsets A, B, and C function, how the Modulo 103 check digit is calculated, how to format GS1-128 shipping labels, and how to eliminate scannability dropouts in warehouse automation.

Marcus Chen
Marcus Chen
Logistics & Barcode Standards Director
Industrial automated conveyor sorting packages with Code 128 barcodes
FIGURE SPECHigh-speed automated distribution center optical scanner verifying Code 128 logistics labels.

Anatomy and Architecture of Code 128

Code 128 is a continuous, self-checking, high-density linear barcode symbology capable of encoding the entire 128-character standard ASCII set (values 0 to 127). Standardized internationally under ISO/IEC 15417, it remains the primary workhorse of global transportation, warehouse inventory management, medical supply distribution, and retail distribution containers.

Unlike fixed-length barcodes such as UPC-A (12 digits) or EAN-13 (13 digits), Code 128 is variable-length. Each encoded character is composed of exactly 11 modules, organized into three distinct bars and three distinct spaces (with the exception of the STOP character, which utilizes 13 modules consisting of four bars and three spaces).

[10-Module Quiet Zone]
  [Start Character (11 modules)]
    [Encoded Data Characters (11 modules each)]
      [Modulo 103 Checksum Character (11 modules)]
        [Stop Pattern (13 modules)]
[10-Module Quiet Zone]

The total width of a Code 128 barcode symbol in modules is calculated with the following equation:

$$\text{Total Modules} = 11 \times (N + 2) + 13 + 20$$

Where $N$ is the number of data characters, $+2$ accounts for the START and CHECKSUM characters, $+13$ represents the STOP character, and $+20$ represents the two 10-module Quiet Zones on the left and right margins.


Code 128 Subsets: When to Use Subset A, B, or C

The unique efficiency of Code 128 stems from its three distinct character subsets. Sophisticated barcode generator engines switch dynamically between subsets within a single barcode to minimize physical symbol width.

Subset CodeTarget Payload TypesCharacter Set CoverageIdeal Use Case
**Code 128 Subset A**ASCII 00 to 95Uppercase letters, numbers, ASCII control codes (CR, LF, TAB, NUL), punctuationIndustrial PLC telemetry, mainframe serial links, EDI communications
**Code 128 Subset B**ASCII 32 to 127Uppercase letters, lowercase letters, numbers, standard punctuation, deleteStandard alphanumeric inventory, SKU tags, human-readable serial numbers
**Code 128 Subset C**Numeric Pairs 00 to 99Dual-digit numeric encoding (each 11-module character encodes TWO digits)GS1-128 shipping labels, SSCC-18 containers, long tracking IDs

The Power of Subset C Dual-Digit Packing

When encoding purely numeric sequences (such as a 14-digit GTIN or 18-digit Serial Shipping Container Code), Subset C halves the horizontal bar count. A 10-digit number that requires 10 data characters in Subset B requires only 5 data characters in Subset C. This drastically reduces the physical footprint on corrugated boxes and prevents scanner beam overshoot.


Step-by-Step Modulo 103 Checksum Calculation Formula

Code 128 integrates mandatory checksum verification to prevent misreads. The checksum is computed using a Modulo 103 weighted sum algorithm:

1.Take the numerical symbol value of the START character.
2.Multiply the symbol value of each subsequent data character by its position index (starting at index 1 for the first data character).
3.Sum the start value and all weighted products.
4.Divide the total sum by 103 and take the remainder (Modulo 103).
5.The remainder corresponds to the symbol value of the check character placed immediately before the STOP character.

$$\text{Checksum} = \left( \text{Value}_{\text{START}} + \sum_{i=1}^{N} (i \times \text{Value}_{i}) \right) \pmod{103}$$

Worked Example: Encoding "NED26" in Code 128 Subset B

CharacterPosition ($i$)Symbol ValueWeight MultiplierProduct
**START B**01041104
**N**146146
**E**237274
**D**3363108
**2**418472
**6**5225110
**Total Weighted Sum**———**514**

$$\text{Check Digit Value} = 514 \pmod{103} = 102$$

Symbol value 102 corresponds to the reverse stop delimiter character. The barcode generator automatically appends this character, guaranteeing that handheld and automated scanners reject any scan corrupted by dust, ink smudging, or damaged packaging.


GS1-128 and Application Identifiers (AI) in Logistics

When Code 128 begins with the special Function 1 (FNC1) character immediately following the Start pattern, it designates a GS1-128 (formerly UCC/EAN-128) standard symbol.

GS1-128 uses standardized two-to-four digit Application Identifiers (AI) enclosed in parentheses to define the semantic meaning of the payload:

  • (01) Global Trade Item Number (GTIN-14)
  • (10) Batch / Lot Number
  • (17) Expiration Date (YYMMDD format)
  • (21) Serial Number
  • (00) Serial Shipping Container Code (SSCC-18)
  • (01) 00850012345678 (17) 261231 (10) BATCH-994

    When parsed by enterprise warehouse management systems (SAP, Oracle SCM, Manhattan Associates), the scanner decodes both the data and the structural taxonomy in a single optical pass.


    Generating Code 128: Office Tools vs Prepress Vector Engines

    Many warehouse operators attempt to generate Code 128 barcodes using standard office document software (like Microsoft Word or Excel) with third-party TrueType font files. While functional for internal office documentation, this approach creates severe vulnerabilities in industrial packaging:

    1.Font Smoothing & Anti-Aliasing: Operating systems apply sub-pixel anti-aliasing to TrueType fonts, causing bar edges to bleed into adjacent white spaces on high-speed thermal printers.
    2.Missing Quiet Zones: Font glyphs lack automated 10-module quiet zone enforcement, resulting in barcode truncation when placed too close to table borders or label margins.
    3.Manual Checksum Errors: Typing raw text with a barcode font without computing the Modulo 103 check character produces an invalid barcode that cannot be decoded by commercial scanners.

    The Nedject Advantage: Native Vector Engine

    The Nedject Barcode Studio generates mathematically pristine, vector-rendered SVG and 300 DPI rasterized Code 128 symbols with automated subset switching (A/B/C), exact Modulo 103 checksum calculation, and configurable Quiet Zone margins for thermal-transfer, flexo, and direct-thermal printing.


    Preflight Inspection Checklist for Code 128 Barcodes

    Before releasing Code 128 packaging artwork to commercial print houses, verify the following parameters:

  • [ ] Narrow Bar Width (X-Dimension): Minimum 0.25mm (10 mil) for handheld scanners; 0.38mm to 0.50mm (15–20 mil) for automated high-speed conveyor belts.
  • [ ] Quiet Zones: Verify at least 10 times the X-dimension (or minimum 2.5mm / 0.10 inch) of clean, unprinted margin on both the leading and trailing edges.
  • [ ] Aspect Ratio: Height should be at least 15% of total symbol length or 12.7mm (0.50 inch), whichever is greater, to allow omnidirectional laser raster sweeping.
  • [ ] Ink Reflectance (PCS): Ensure print contrast signal (PCS) exceeds 75% between black bars and white substrate.
  • [ ] Bar-Width Reduction (BWR): Apply 0.02mm to 0.04mm negative stroke compensation if printing on corrugated cardboard to counteract flexographic ink squash.
  • TOPIC TAXONOMY & SPECIFICATIONS
    #Barcode Generator 128#Code 128#GS1-128#Barcode Guide#Modulo 103#Inventory Automation
    Marcus Chen
    Written by
    Marcus Chen
    GS1 Standards Committee advisor specializing in automated supply chain optical identification, thermal transfer dynamics, and Amazon FNSKU compliance.

    Related Technical Publications

    View all articles
    Print Engineering

    Mastering 300 DPI QR Codes for High-Speed Commercial Print Runs

    A deep dive into dot gain compensation, Quiet Zone geometry, CMYK ink separation, and Reed-Solomon Error Correction Level H to guarantee 100% optical readability at 300+ DPI on commercial flexographic and offset presses.

    6 min readRead →
    Supply Chain & Logistics

    The Industrial Barcode Blueprint: Precision Formatting for UPC-A, EAN-13, and Amazon FNSKU

    Comprehensive guide to 1D linear symbology, Modulo 10 check digit algorithms, thermal transfer label stock calibration, and Amazon FNSKU compliance for automated warehouse fulfillment.

    8 min readRead →