The Code 128 specification (ISO/IEC 15417) does not specify the maximum number of characters in a single Code 128 barcode image.
However some Code 128 standard application will provide the limits. For example,
GS1-128 has limits the maximum length of Code 128 data to 48 characters.
To encode data characters efficiently, Code 128 uses three Code Sets to encode data message.
- Code Sets A: encodes all of the standard upper case alphanumeric characters and punctuation characters together with the control characters.
- Code Sets B: encodes all of the standard upper case alphanumeric characters and punctuation characters together with the lower case alphabetic characters and seven special characters.
- Code Sets C: encodes the set of 100 digit pairs from 00 to 99 inclusive, as well as three special characters. This allows numeric data to be encoded as two data digits per symbol character.
Using KeepAutomation C# barcode generator library, you do not need analyze your encoding Code 128 data and choose the matched Code 128 Code Set. The barcode
generator C# library will automatically choose the best Code Sets combination for you based on your encoding data.
BarCode code128 = new BarCode();
code128.Symbology = KeepAutomation.Barcode.Symbology.Code128Auto;
code128.CodeToEncode = "ABC-123-abc";
With Code 128 type
KeepAutomation.Barcode.Symbology.Code128Auto, the barcode library will use the best Code Sets to create Code 128 in C# class.
Code 128 barcode supports the following special characters
- Function characters: Code 128 Function Characters (FNC) includes 4 characters: FNC1, FNC2, FNC3, FNC4. FNC1 is for GS1 system. FNC4 is to encode extended character set.
- Code Set shift characters: Code Set A, B, or C and Shift characters shall be used to change from one code set to another.
- Start/Stop characters: 3 start chars A, B and C define the corresponding code set to be used initially in the symbol.
You do not need know how to encode special characters into Code 128 barcode. The barcode C# library will automatically generate and insert the special characters in the right position in the generated Code 128 barcodes.
Code 128 barcode contains a mandatory check digit (checksum) character, which is based on module 103 (mod 103).
The Code 128 check character will not be displayed in Code 128 barcode text label, and it will not be returned by the barcode decoder and reader also.
Same as special characters in Code 128, the C# Code 128 generator library will automatically calculate the check digit and insert the check sum character in the end of
Code 128 data message in the generated Code 128 symbology.
Code 128 text label printed below barcode is also named Code 128
human-readable interpretation (HRI).
Required by Code 128 specification, Code 128 barcode HRI (text label) should apply the following rules.
- HRI should be printed with the Code 128 symbol barcode.
- Special characters (function characters, code set shift characters, start/stop characters) shall not be printed.
- Checksum digit character should not be printed also.
- Text size and font style are not specified.
- Text can be printed anywhere in the area surrounding the barcode, as long as quiet zone boundaries are not violated.
Code 128 barcode is a valid data carrier for GS1 system. To encode GS1 data message in Code 128 barcode,
you could learn more information here:
How to generate GS1-128 barcodes using C#
What does Code 128 barcode text encoding include?
Code 128 is a dense linear barcode. It can encode digits, text, and special functions, and the full set of 128 ASCII characters.
Using C# Code 128 Barcode Generator library, you can quickly create, print Code 128 barcodes with full 128 ASCII table chars encoding in
C# ASP.NET Core, Framework, MVC, Blazor, Windows Forms, and WPF applications.
What purposes does Code 128 serve?
Code 128 is a widely used linear barcode, applied in common applications include shipping labels,
product identification in retail, and asset tracking in healthcare and government.
Using C# Code 128 Barcode Generator SDK api, you can easily generate and encode ISO standard Code 128 barcodes in C# Visual Studio .NET projects.
What's Code 128's check digit?
A Code 128 barcode must include a check digit (checksum), It is computed based on a Mod 103 calculation,
which the scanner uses to verify the barcode was read correctly. C# Code 128 Generator library will automatically calculate and insert the Code 128 check digit in
barcode symbology in C# class.
How many characters can a Code 128 barcode hold at most?
There's no official maximum character count for Code 128 in its ISO standard.
In practice, application standards impose limits, such as the 48-character restriction in GS1-128.
Using C# Code 128 Barcode Generator SDK library, you can quickly create Code 128 for various industry standards in C# ASP.NET Core application.
What's the way to read Code 128 barcodes?
Code 128 barcodes can be read by a variety of devices. You can read Code 128 by installing free scanner software, using a barcode scanner device,
or leveraging third-party phone apps. Such as a physical barcode scanner, a smartphone using a free scanning app,
or a computer with a webcam and appropriate software. KeepAutomation only provides Code 128 barcode generation for .NET, also provides
Code 128 decoding and reading C# library.
Is Code 128 a better barcode than Code 39?
Code 39 is less compact - Code 128 fits more encoded data into a smaller area, and it encodes data more compactly than Code 39.
Using C# Code 128 Barcode Generator library, you can encode both Code 39 and Code 128 barcode images in C# ASP.NET, MVC, and Windows Forms application.