Code 128 Explained

Code 128 was developed by Computer Identics in 1981 and has become very popular over the years. It's widely used for warehouse management, in the transport industry (e.g. UPS) and in retail as Code 128 EAN / UCC. Originally called Code 128 EAN/UCC this variation is now known as 128 GS1. See Code 128 GS1 for a discussion of Code 128 GS1 but read this page first.

Code 128 Code Sets A, B, C

Three different code sets are defined for Code 128 (dubbed A, B, and C) that determine how the code is interpreted by the barcode scanner. The code sets differ in compaction and encodable character set.

Code 128 A: Partial ASCII set, no lower case, but ASCII control chars (TAB, CR/LF etc.)
Code 128 B: Full ASCII set, no ASCII control chars
Code 128 C: Only digits 0-9, encoded in pairs, very compact code

The code set to use is indicated to the scanner by the start symbol. Also defined are various mode switching or shift characters to switch from one set to another within a barcode symbol. Usually the code set selection and switching within a symbol is handled by the barcode software that creates the code.

Accented, Diacritic Characters and Umlauts with Code 128

In principle non-ASCII characters like German umlauts (e.g. ÄÖÜ) can be encoded in a Code 128 symbol by using a special character (FNC4). However, this feature is not widely supported. Using a 2D barcode symbology like Aztec or Datamatrix with dedicated support for non-ASCII data might be a better choice.

Checksum for Code 128

Code 128 uses a Modulo 103 checksum algorithm. All characters of a symbol are added up and modulo divided by 103. The remainder is the checksum. For a sample calculation, see the Wikipedia article on Code 128. Usually the barcode software that generates the code will calculate the check digit automatically.

Sample Code 128

Purely numeric code, resulting in a Code 128 C symbol:

Code 128 C

Mixed data, resulting in a Code 128 B full ASCII symbol (note the difference in the first three lines that indicate the start symbol). Also note that this code is wider than the previous example although less data is encoded:

Code 128 B

Mixed data ("ABC<TAB>DEF>"), resulting in a symbol that starts as Code 128 B to encode "ABC", then shifts to Code 128 A to encode the <TAB>, then back to 128 B to encode "DEF":

Code 128 A

When scanning this code, the barcode scanner will put out "ABC", followed by the <TAB>, then "DEF". This can be very useful: Consider a data entry mask with two fields. The <TAB> can be used to move the focus from one field to the next. The fist part of the code ("ABC") would go into the first field, the second part ("DEF") would go into the second field.

Non printable characters (like the <TAB> above) are entered into Softmatic BarcodePlus using the tilde notation: You enter the tilde, followed by the three digit ASCII code of the symbol. E.g. to encode a <TAB> into the code you would enter "~009":

Code 128 A Generator

Note that non-printable characters are not put into the human readable text under the barcode.

Code 128 A/B/C for Excel 2010, 2013, 365

For sequential Code 128 barcodes (e.g. for serial numbers etc.), our Excel Barcode Add-In is a very easy to use solution:


Please see Code 128 Barcodes in Excel for details.

Barcode scanners for reading Code 128

We can recommend the following barcode scanners for reliably reading Code 128:

Zebra/Motorola Symbol LS2208

USB connected laser scanner. Suitable for POS, warehouse, lab etc. It has a nice working range of up to 17" (43cm), ideal if you have to scan barcodes that are out of reach, like on shelves or behind desks.

Click for price

Honeywell Voyager 1250G

USB connected laser scanner with stand for hands-free operation. Suitable for checkout, warehouse, lab etc. The scanner is triggered automatically when a barcode is in front of it.

Click for price

Zebra/Motorola Symbol LS4278

A cordless (Bluetooth) laser scanner with battery and charger / docking station. Suitable for point-of-sale, warehousing, lab etc. Very convenient, simple plug-and-play installation and operation.

Click for price

Label Printer

Recommended label printers for low to medium print volume.

DYMO LabelWriter 450

Affordable USB connected thermal label printer for Windows and Mac. Cheap consumables, compatible with Word, Excel, Quickbooks, Paypal, Ebay.

Click for price

Brother QL-700 High-speed Label Printer

Very fast thermal label printer, up to 90 labels per minute. Can print long banners. Comes with convenient built-in cutter. USB connected.

Click for price

DYMO LabelWriter 4XL

Prints labels up to 4.19" (c. 110mm) wide. Very fast, prints more than 120 address labels per minute. High-res print head, ideal for barcodes.

Click for price

Softmatic is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon and the Amazon logo are trademarks of, Inc. or its affiliates.

Create Code 128 A, B, C

Softmatic BarcodePlus creates Code 128 A, B, C. The software analyzes the data to encode to determine what subtype to use. The Code 128 check digit is calculated automatically. The barcodes are exported as EPS (vector) and to common raster formats.

Windows PC - Softmatic® BarcodePlus (Win, V4, Windows XP or higher)

Download for Windows

Mac OS X - Softmatic® BarcodePlus (Mac, V4, 10.7 "Lion" or higher)

Download for Mac

Developers: Make sure to see our Code 128 .NET Barcode Generator.

Code 128 barcodes in Excel

The Softmatic Excel barcode plug-in creates all Code 128 variations (A/B/C, GS1, UCC/EAN) with a single mouse click:

              Code 128 in Excel

Combine with Excel auto-fill and you create barcode sequences in seconds.

More info about creating Code 128 in Excel.