Home Forum Riddle Tools Wallpapers Links
Code 128
 
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).

There are 107 different 3 bar/3 space combinations. Each of the 107 combinations can be assigned one of three different character set meanings. 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.

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
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)

    Summary

  • The width of a slim bar is called the module.
  • There are bars of 1, 2, 3 or 4 modules; equally for the spaces.
  • There are 107 combinations, each is coded with 11 modules including 3 bars and 3 spaces (The STOP pattern has 4 bars).
  • There are 3 tables giving the character or the function for each pattern.
    * Table A contains the capital letters, the digits, the punctuations, some control codes and special codes.
    * Table B contains capital and lower case letters, the digits, the punctuation marks and special codes.
    * Table C contains pairs of digits (giving the ability to double the density) and special codes.
  • Quiet zones of at least 10 modules are found on the left and on the right of the code.
  • There is a START character at the beginning of the code. There are 3 START characters fixing the table used for the start.
  • The code ends with a STOP character.
  • Some special characters (99, 100 and 101) make it possible to pass from one table to another; the SHIFT character (98) switches the next character between tables A and B.
  • A checksum must be added; its value is calculated by adding up the value of the START then the value of each pattern multiplied by its row; then by taking the remainder of the division of this sum by 103.
  • In the table below a bar module is symbolized by '1' and a space module by '0'.
  • The columns "ASCII Code" and "Character" indicate the place of the patterns in the code128 font
  • The character no. 0 (Space) is obtained with the code 32 or with the code 207 because some programming tools cannot use code 32.
 
Table of Characters
 
 
Value Table A Table B Table C ASCII Code Character Pattern
0
Space
Space
00
0032 or 0207
Space or Ï
11011001100
1
!
!
01
0033
!
11001101100
2
"
"
02
0034
"
11001100110
3
#
#
03
0035
#
10010011000
4
$
$
04
0036
$
10010001100
5
%
%
05
0037
%
10001001100
6
&
&
06
0038
&
10011001000
7
'
'
07
0039
'
10011000100
8
(
(
08
0040
(
10001100100
9
)
)
09
0041
)
11001001000
10
*
*
10
0042
*
11001000100
11
+
+
11
0043
+
11000100100
12
,
,
12
0044
,
10110011100
13
-
-
13
0045
-
10011011100
14
.
.
14
0046
.
10011001110
15
/
/
15
0047
/
10111001100
16
0
0
16
0048
0
10011101100
17
1
1
17
0049
1
10011100110
18
2
2
18
0050
2
11001110010
19
3
3
19
0051
3
11001011100
20
4
4
20
0052
4
11001001110
21
5
5
21
0053
5
11011100100
22
6
6
22
0054
6
11001110100
23
7
7
23
0055
7
11101101110
24
8
8
24
0056
8
11101001100
25
9
9
25
0057
9
11100101100
26
:
:
26
0058
:
11100100110
27
;
;
27
0059
;
11101100100
28
<
<
28
0060
<
11100110100
29
=
=
29
0061
=
11100110010
30
>
>
30
0062
>
11011011000
31
?
?
31
0063
?
11011000110
32
@
@
32
0064
@
11000110110
33
A
A
33
0065
A
10100011000
34
B
B
34
0066
B
10001011000
35
C
C
35
0067
C
10001000110
36
D
D
36
0068
D
10110001000
37
E
E
37
0069
E
10001101000
38
F
F
38
0070
F
10001100010
39
G
G
39
0071
G
11010001000
40
H
H
40
0072
H
11000101000
41
I
I
41
0073
I
11000100010
42
J
J
42
0074
J
10110111000
43
K
K
43
0075
K
10110001110
44
L
L
44
0076
L
10001101110
45
M
M
45
0077
M
10111011000
46
N
N
46
0078
N
10111000110
47
O
O
47
0079
O
10001110110
48
P
P
48
0080
P
11101110110
49
Q
Q
49
0081
Q
11010001110
50
R
R
50
0082
R
11000101110
51
S
S
51
0083
S
11011101000
52
T
T
52
0084
T
11011100010
53
U
U
53
0085
U
11011101110
Value Table A Table B Table C ASCII Code Character Pattern
54
V
V
54
0086
V
11101011000
55
W
W
55
0087
W
11101000110
56
X
X
56
0088
X
11100010110
57
Y
Y
57
0089
Y
11101101000
58
Z
Z
58
0090
Z
11101100010
59
[
[
59
0091
[
11100011010
60
\
\
60
0092
\
11101111010
61
]
]
61
0093
]
11001000010
62
^
^
62
0094
^
11110001010
63
_
_
63
0095
_
10100110000
64
nul
`
64
0096
`
10100001100
65
soh
a
65
0097
a
10010110000
66
stx
b
66
0098
b
10010000110
67
etx
c
67
0099
c
10000101100
68
eot
d
68
0100
d
10000100110
69
eno
e
69
0101
e
10110010000
70
ack
f
70
0102
f
10110000100
71
bel
g
71
0103
g
10011010000
72
bs
h
72
0104
h
10011000010
73
ht
i
73
0105
i
10000110100
74
lf
j
74
0106
j
10000110010
75
vt
k
75
0107
k
11000010010
76
ff
l
76
0108
l
11001010000
77
cr
m
77
0109
m
11110111010
78
s0
n
78
0110
n
11000010100
79
s1
o
79
0111
o
10001111010
80
dle
p
80
0112
p
10100111100
81
dc1
q
81
0113
q
10010111100
82
dc2
r
82
0114
r
10010011110
83
dc3
s
83
0115
s
10111100100
84
dc4
t
84
0116
t
10011110100
85
nak
u
85
0117
u
10011110010
86
syn
v
86
0118
v
11110100100
87
etb
w
87
0119
w
11110010100
88
can
x
88
0120
x
11110010010
89
em
y
89
0121
y
11011011110
90
sub
z
90
0122
z
11011110110
91
esc
{
91
0123
{
11110110110
92
fs
|
92
0124
|
10101111000
93
gs
}
93
0125
}
10100011110
94
rs
~
94
0126
~
10001011110
95
us
del
95
0195
Ã
10111101000
96
Fnc 3
Fnc 3
96
0196
Ä
10111100010
97
Fnc 2
Fnc2
97
0197
Å
11110101000
98
Shift
Shift
98
0198
Æ
11110100010
99
Code C
Code C
99
0199
Ç
10111011110
100
Code B
Fnc 4
Code B
0200
È
10111101110
101
Fnc 4
Code A
Code A
0201
É
11101011110
102
Fnc 1
Fnc 1
Fnc 1
0202
Ê
11110101110
103
Start A
Start A
Start A
0203
Ë
11010000100
104
Start B
Start B
Start B
0204
Ì
11010010000
105
Start C
Start C
Start C
0205
Í
11010011100
106
Stop
Stop
Stop
0206
Î
1100011101011
             
back to top
 
 
Sources:

Grand Zebu - Code128

Bar Code 1 - Code128