Code 128 Barcode Font
Code 128 is one of the most popular modern barcodes. It is a high-density barcode supporting alphanumeric characters. This barcode is used as the underlying symbology for many other barcodes like UCC/EAN, HIBC(Health Industry Barcode), and the Blood Bank Industry barcode.Other than being high density, this barcode supports the ASCII character set and is increasingly adopted in many different applications. This barcode has 106 unique representations and supports ASCII by using a multiple character set mechanism.
Character Set supported in barcode
- Code128 Auto - Support Code 128 A/B/C characters. Automatically switch between the different code sets and performs characters optimization
- Code128A - ASCII without lowercase characters
- Code128B - ASCII without the initial ASCII special characters
- Code128C - Numeric
Barcode Font Names and Sizes
ConnectCode Code 128 (Auto/A/B/C) barcode font supports up to seven different heights. These barcodes with seven different heights are provided in seven fonts with different names. The barcode names are appended with characters like "S1" or "S2" etc., with each representing a different height. The list below illustrates the seven different fonts that are supplied for Code128.- CCode128_S1
- CCode128_S2
- CCode128_S3
- CCode128_S4
- CCode128_S5
- CCode128_S6
- CCode128_S7
- CCode128B_HS3
Code 128 Character Mappings
All characters supported by the barcode are as shown below. All of them have a simple direct mapping.Code 128 Value (For Check Character) | Code 128 A | Code 128 B | Code 128 C | Barcode Font Character |
0 | ' ' | ' ' | 00 | ' ' (Space) |
1 | '!' | '!' | 01 | '!' |
2 | '"' | '"' | 02 | '"' |
3 | '#' | '#' | 03 | '#' |
4 | '$' | '$' | 04 | '$' |
5 | '%' | '%' | 05 | '%' |
6 | '&' | '&' | 06 | '&' |
7 | ''' | ''' | 07 | ''' |
8 | '(' | '(' | 08 | '(' |
9 | ')' | ')' | 09 | ')' |
10 | '*' | '*' | 10 | '*' |
11 | '+' | '+' | 11 | '+' |
12 | ',' | ',' | 12 | ',' |
13 | '-' | '-' | 13 | '-' |
14 | '.' | '.' | 14 | '.' |
15 | '/' | '/' | 15 | '/' |
16 | '0' | '0' | 16 | '0' |
17 | '1' | '1' | 17 | '1' |
18 | '2' | '2' | 18 | '2' |
19 | '3' | '3' | 19 | '3' |
20 | '4' | '4' | 20 | '4' |
21 | '5' | '5' | 21 | '5' |
22 | '6' | '6' | 22 | '6' |
23 | '7' | '7' | 23 | '7' |
24 | '8' | '8' | 24 | '8' |
25 | '9' | '9' | 25 | '9' |
26 | ':' | ':' | 26 | ':' |
27 | ';' | ';' | 27 | ';' |
28 | '<' | '<' | 28 | '<' |
29 | '=' | '=' | 29 | '=' |
30 | '>' | '>' | 30 | '>' |
31 | '?' | '?' | 31 | '?' |
32 | '@' | '@' | 32 | '@' |
33 | 'A' | 'A' | 33 | 'A' |
34 | 'B' | 'B' | 34 | 'B' |
35 | 'C' | 'C' | 35 | 'C' |
36 | 'D' | 'D' | 36 | 'D' |
37 | 'E' | 'E' | 37 | 'E' |
38 | 'F' | 'F' | 38 | 'F' |
39 | 'G' | 'G' | 39 | 'G' |
40 | 'H' | 'H' | 40 | 'H' |
41 | 'I' | 'I' | 41 | 'I' |
42 | 'J' | 'J' | 42 | 'J' |
43 | 'K' | 'K' | 43 | 'K' |
44 | 'L' | 'L' | 44 | 'L' |
45 | 'M' | 'M' | 45 | 'M' |
46 | 'N' | 'N' | 46 | 'N' |
47 | 'O' | 'O' | 47 | 'O' |
48 | 'P' | 'P' | 48 | 'P' |
49 | 'Q' | 'Q' | 49 | 'Q' |
50 | 'R' | 'R' | 50 | 'R' |
51 | 'S' | 'S' | 51 | 'S' |
52 | 'T' | 'T' | 52 | 'T' |
53 | 'U' | 'U' | 53 | 'U' |
54 | 'V' | 'V' | 54 | 'V' |
55 | 'W' | 'W' | 55 | 'W' |
56 | 'X' | 'X' | 56 | 'X' |
57 | 'Y' | 'Y' | 57 | 'Y' |
58 | 'Z' | 'Z' | 58 | 'Z' |
59 | '[' | '[' | 59 | '[' |
60 | '\' | '\' | 60 | '\' |
61 | ']' | ']' | 61 | ']' |
62 | '^' | '^' | 62 | '^' |
63 | '_' | '_' | 63 | '_' |
64 | NUL | '`' | 64 | '`' |
65 | SOH | 'a' | 65 | 'a' |
66 | STX | 'b' | 66 | 'b' |
67 | ETX | 'c' | 67 | 'c' |
68 | EOT | 'd' | 68 | 'd' |
69 | ENQ | 'e' | 69 | 'e' |
70 | ACK | 'f' | 70 | 'f' |
71 | BEL | 'g' | 71 | 'g' |
72 | BS | 'h' | 72 | 'h' |
73 | HT | 'i' | 73 | 'i' |
74 | LF | 'j' | 74 | 'j' |
75 | VT | 'k' | 75 | 'k' |
76 | FF | 'l' | 76 | 'l' |
77 | CR | 'm' | 77 | 'm' |
78 | SO | 'n' | 78 | 'n' |
79 | SI | 'o' | 79 | 'o' |
80 | DLE | 'p' | 80 | 'p' |
81 | DC1 | 'q' | 81 | 'q' |
82 | DC2 | 'r' | 82 | 'r' |
83 | DC3 | 's' | 83 | 's' |
84 | DC4 | 't' | 84 | 't' |
85 | NAK | 'u' | 85 | 'u' |
86 | SYN | 'v' | 86 | 'v' |
87 | ETB | 'w' | 87 | 'w' |
88 | CAN | 'x' | 88 | 'x' |
89 | EM | 'y' | 89 | 'y' |
90 | SUB | 'z' | 90 | 'z' |
91 | ESC | '{' | 91 | '{' |
92 | FS | '|' | 92 | '|' |
93 | GS | '}' | 93 | '}' |
94 | RS | '~' | 94 | '~' |
95 | US | DEL | 95 | 227 (ASCII value) |
96 | FNC3 | FNC3 | 96 | 228 (ASCII value) |
97 | FNC2 | FNC2 | 97 | 229 (ASCII value) |
98 | Shift | Shift | 98 | 230 (ASCII value) |
99 | Code C | Code C | 99 | 231 (ASCII value) |
100 | Code B | FNC4 | Code B | 232 (ASCII value) |
101 | FNC4 | Code A | Code A | 233 (ASCII value) |
102 | FNC1 | FNC1 | FNC1 | 234 (ASCII value) |
103 | Start A | Start A | Start A | 235 (ASCII value) |
104 | Start B | Start B | Start B | 236 (ASCII value) |
105 | Start C | Start C | Start C | 237 (ASCII value) |
106 | Stop | Stop | Stop | 238 (ASCII value) |
Using the Code 128 barcode font
Code 128 A
To encode "ABCDEF" in Code 128A.
'J' is the check character. The calculation of this character is specified in the next section. 'ë' is the start character of Code 128 A while 'î' is the stop character.
Input: ëABCDEFJî
Output:
Code 128 B
To encode "abcdef" in Code 128B.
'å' is the check character. The calculation of this character is specified in the next section. 'ì' is the start character of Code 128 B while 'î' is the stop character.
Input: ìabcdefåî
Output:
Code 128 C
To encode "12345678" in Code 128C.
'O' is the check character. The calculation of this character is specified in the next section. 'í' is the start character of Code 128 C while 'î' is the stop character.
Input: í,BXnOî
Output:
If you are using the Encoder, it will automatically put in the start/stop characters and generate the check character for you.
Code 128 Auto
It is recommended to use the Encoder or VB macros to generate the barcode if you intend to use Code 128 Auto. For example, to encode "12345678".
Input (Using the Encoder or VB macros): 12345678
Output:
Calculation of Code128 Check Character
Code 128A
Data - ABCDEF
Data Characters | A | B | C | D | E | F |
Multiply each of the characters (the Code 128 value) with increasing weight. | ||||||
Code 128 Value | 33 | 34 | 35 | 36 | 37 | 38 |
Weight | *1 | *2 | *3 | *4 | *5 | *6 |
Sum : | (33*1) + (34*2) + (35*3) + (36*4) + (37*5) + (38*6) = 763 | |||||
For Code 128A, add an additional of 103 to the sum above | ||||||
Total | 763 + 103 = 866 | |||||
Modulo 103 Check Character: | 866 % 103 = 42 (which maps to the character 'J') |
Code 128B
Data - abcdef
Data Characters | a | b | c | d | e | f |
Multiply each of the characters (the Code 128 value) with increasing weight. | ||||||
Code 128 Value | 65 | 66 | 67 | 68 | 69 | 70 |
Weight | *1 | *2 | *3 | *4 | *5 | *6 |
Sum : | (65*1) + (66*2) + (67*3) + (68*4) + (69*5) + (70*6) = 1435 | |||||
For Code 128B, add an additional 104 to the sum above | ||||||
Total | 1435 + 104 = 1539 | |||||
Modulo 103 Check Character: | 1539 % 103 = 97 |
Code 128C
Data - 345678
Data Characters | 3 | 4 | 5 | 6 | 7 | 8 |
Multiply each of the two digits with increasing weight. | ||||||
Weight | *1 | *2 | *3 | |||
Sum : | (34*1) + (56*2) + (78*3) = 380 | |||||
For Code 128C, add an additional 105 to the sum above | ||||||
Total | 380 + 105 = 485 | |||||
Modulo 103 Check Character: | 485 % 103 = 73 (which maps to the character 'i') |