BarCode 1 Code 128 Page
This Visit Brought To You By
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
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)
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".
You can see a table of characters, values, and bar/space patterns for Code 128 by clicking here.
Altek Instruments based in the UK also has pages with Code 128 specifications.
You can purchase complete, official specifications from the following organizations:
X5-4, Uniform Symbol Specification - Code 128
AIM Global, Inc.
prEN 799 Bar coding - Symbology specifications - Code 128
NNI, P.O. Box 5059, NL-2600 GB DELFT, THE NETHERLANDS
Tel. +31 15 690 256, Fax. +31 15 690 190
ANSI, 11 West 42nd Street, 13th floor, New York, NY 10036, USA
Tel. (212) 642-4900, Fax. (212) 398-0023; Internet: ANSI
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.