Bar Code 1®
A Web Of Information About Bar Code
BarCode 1 Code 128 Page









[BarCode 1 Sponsor]
This Visit Brought To You By


Code 128 sample barcode labelAll About Code 128 Barcode
(For a table of Code 128 characters, see the Code 128 Character Table Page)

Code 128 is a very high density alphanumeric bar code. The symbol can be as long as necessary to store the encoded data. It is designed to encode all 128 ASCII characters, and will use the least amount of space for data of 6 characters or more of any 1-D symbology.

Each data character encoded in a Code 128 symbol is made up of 11 black or white modules. The stop character, however, is made up of 13 modules. Three bars and three spaces are formed out of these 11 modules. Bar and spaces can vary between 1 and 4 modules wide.

The symbol includes a quiet zone (10 x-dimensions), a start character, the encoded data, a check character, the stop character, and a trailing quiet zone (10 x-dimensions). For optimum hand-scanning with a contact reader, the quiet zone should be at least 0.25 inches.

For labels in an open system, the minimum x-dimension is 7.5 mils. The minimum bar height is 15 percent of the symbol length or 0.25 inches, whichever is greater

Diagram of Code 128 label

There are 106 different 3 bar/3space combinations. Each of the 106 combinations can be assigned one of three different character set meanings. To see the character sets for Code 128, click here. These meanings are set by using one of three different start characters. Start Code A allows encoding all the standard alphanumeric keyboard characters plus control characters and special characters. Start Code B includes all standard alphanumeric keyboard characters plus lower case alpha and special characters. Start Code C includes a set of 100 digit pairs from 00 to 99 and can be used to double the density of encoding numeric-only data.

Within a symbol, one can shift between code sets by using the special character CODE and SHIFT. The CODE character shifts the code for all subsequent characters to the specified code set. The SHIFT character just changes the next character and only changes between Code Set A and Code Set B or the reverse.

The FNC codes define instructions for the bar code reader. FNC 1 is reserved for future use. FNC 2 tells the reader to store the data read and transmit it with the next symbol. FNC 3 is reserved for code reader initializing and other code reader functions. FNC 4 is reserved for future applications.

Each character has a value ranging from 0 to 105. This value is used to calculate the check character for each symbol.

The check character is a Modulus 103 Checksum that is calculated by summing the start code value plus the product of each character position (most significant character position equals 1) and the character value of the character at that position. This sum is divided by 103. The remainder of the answer is the value of the Check Character (which can be looked up from the table). Every encoded character is included except the Stop and Check Character.

Example: BarCode 1
Message : Start B   B   a   r   C   o   d   e      1
Value      104      34  65  82  35  79  68  69  0  17
Position:   -       1   2   3   4   5   6   7   8  9
Calculate Total: 104 + (34x1) + (65x2) + (82x3) + (35x4) + (79x5) +
                 (68x6) + (69x7) + (0x8) + (17x9) = 2093
2093/103 = 20 remainder 33
33 = A
Final message: (Start B)BarCode 1(A)(STOP)

PLEASE NOTE: When you print the checksum character "A", you are REALLY printing ASCII character number 65 (not 33). You must add 32 to whatever the checksum number to find out what ASCII CHARACTER must be printed. Let's say you are printing a code A barcode using START A, and the checksum number you calculate is 64. You might think you would print a NULL character, but you would be wrong. You must add 32 to 64 to get 96. You would print ASCII character 96 (or the ` character)

The height of the bars must be at least .15 times the symbol's length or .25 inches, whichever is larger. The overall length of the symbol is given by the equation:

L = (11C + 35)X (alphanumeric) L = (5.5C + 35)X (numeric only using Code C)

where

L = length of symbol (not counting quiet zone)
C = number of data characters, code characters and shift characters (do not include start, stop or checksum. They are automatically added in.)
X = X-dimension

This calculator will show you the length of a Code 128 bar code given the X dimension and total number of data characters, including function characters and shift characters. Note that one data character can encode two numeric digits if character subset C is used. Please note: if you want an X-dimension of, for example, 0.0085 inches, you need to enter "8.5".

Number of
Characters
X-Dimension
(in mils)
 
Length
In Inches
Code 128
Length Calculator
=

You can see a table of characters, values, and bar/space patterns for Code 128 by clicking here.

Other Sources Of The Specification

Altek Instruments based in the UK also has pages with Code 128 specifications.

You can purchase complete, official specifications from the following organizations:

Barcode Mill from Altek Instruments allows you to issue unique, identifiable documents from your own web site, dynamically and in real time! This service can produce Code 128 and other codes.

You can find a Code 128 creation page here.

There are many shareware, freeware and demoware programs on the BarCode 1 Software Page for printing Code 128.


BarCode 1 is a registered trademark of Adams Communications.
Send comments and questions by e-mail to Russ Adams