A typical Code 39 bar code is:
Code 39 is a discrete, variable-length symbology. It is self-checking in that a single print defect cannot transpose one character into another valid character.
To calculate the optional checksum digit, follow the following steps.
In the following text, we will discuss the encoding of the bar code by considering that the number "1" represents a "dark" or "bar" section of the bar code whereas a "0" represents a "light" or "space" section of the bar code. Thus the numbers 1101 represents a double-wide bar (11), followed by a single-wide space (0), followed by a single-wide bar (1). This would be printed in the bar code as:
Keep in mind that each character begins and ends with a bar, thus the "bar code encoding" always starts and ends with a "1".
CHECK VALUE |
ASCII CHAR |
WIDTH ENCODING |
BARCODE ENCODING |
CHECK VALUE |
ASCII CHAR |
WIDTH ENCODING |
BARCODE ENCODING |
0 | 0 | NNNWWNWNN | 101001101101 | 22 | M | WNWNNNNWN | 110110101001 |
1 | 1 | WNNWNNNNW | 110100101011 | 23 | N | NNNNWNNWW | 101011010011 |
2 | 2 | NNWWNNNNW | 101100101011 | 24 | O | WNNNWNNWN | 110101101001 |
3 | 3 | WNWWNNNNN | 110110010101 | 25 | P | NNWNWNNWN | 101101101001 |
4 | 4 | NNNWWNNNW | 101001101011 | 26 | Q | NNNNNNWWW | 101010110011 |
5 | 5 | WNNWWNNNN | 110100110101 | 27 | R | WNNNNNWWN | 110101011001 |
6 | 6 | NNWWWNNNN | 101100110101 | 28 | S | NNWNNNWWN | 101101011001 |
7 | 7 | NNNWNNWNW | 101001011011 | 29 | T | NNNNWNWWN | 101011011001 |
8 | 8 | WNNWNNWNN | 110100101101 | 30 | U | WWNNNNNNW | 110010101011 |
9 | 9 | NNWWNNWNN | 101100101101 | 31 | V | NWWNNNNNW | 100110101011 |
10 | A | NNWWNNWNN | 110101001011 | 32 | W | WWWNNNNNN | 110011010101 |
11 | B | NNWNNWNNW | 101101001011 | 33 | X | NWNNWNNNW | 100101101011 |
12 | C | WNWNNWNNN | 110110100101 | 34 | Y | WWNNWNNNN | 110010110101 |
13 | D | NNNNWWNNW | 101011001011 | 35 | Z | NWWNWNNNN | 100110110101 |
14 | E | WNNNWWNNN | 110101100101 | 36 | - | NWNNNNWNW | 100101011011 |
15 | F | NNWNWWNNN | 101101100101 | 37 | . | WWNNNNWNN | 110010101101 |
16 | G | NNNNNWWNW | 101010011011 | 38 | SPACE | NWWNNNWNN | 100110101101 |
17 | H | WNNNNWWNN | 110101001101 | 39 | $ | NWNWNWNNN | 100100100101 |
18 | I | NNWNNWWNN | 101101001101 | 40 | / | NWNWNNNWN | 100100101001 |
19 | J | NNNNWWWNN | 101011001101 | 41 | + | NWNNNWNWN | 100101001001 |
20 | K | WNNNNNNWW | 110101010011 | 42 | % | NNNWNWNWN | 101001001001 |
21 | L | NNWNNNNWW | 101101010011 | n/a | * | NWNNWNWNN | 100101101101 |
If a Code 39 bar code starts with a space, that bar code will be appended to any previous code 39 bar code in the buffer and the system will wait for additional bar code(s). If a Code 39 bar code doesn't start with a space, the bar code will be appended to any previous code 39 bar codes and the entire message will be delivered to the application.
In other words, if a code 39 bar code has additional bar codes to follow, it must start with a space-if the bar code is the last bar code in the message it must not start with a space.
ASCII | ENCODING | ASCII | ENCODING | ASCII | ENCODING | ASCII | ENCODING |
NUL | %U | SP | Space | @ | %V | ` | %W |
SOH | $A | ! | /A | A | A | a | +A |
STX | $B | " | /B | B | B | b | +B |
ETX | $C | # | /C | C | C | c | +C |
EOT | $D | $ | /D | D | D | d | +D |
ENQ | $E | % | /E | E | E | e | +E |
ACK | $F | & | /F | F | F | f | +F |
BEL | $G | ' | /G | G | G | g | +G |
BS | $H | ( | /H | H | H | H | H |
HT | $I | ) | /I | I | I | i | +I |
LF | $J | * | /J | J | J | j | +J |
VT | $K | + | /K | K | K | k | +K |
FF | $L | , | /L | L | L | l | +L |
CR | $M | - | - | M | M | m | +M |
SO | $N | . | . | N | N | n | +N |
SI | $O | / | /O | O | O | o | +O |
DLE | $P | 0 | 0 | P | P | p | +P |
DC1 | $Q | 1 | 1 | Q | Q | q | +Q |
DC2 | $R | 2 | 2 | R | R | r | +R |
DC3 | $S | 3 | 3 | S | S | s | +S |
DC4 | $T | 4 | 4 | T | T | t | +T |
NAK | $U | 5 | 5 | U | U | u | +U |
SYN | $V | 6 | 6 | V | V | v | +V |
ETB | $W | 7 | 7 | W | W | w | +W |
CAN | $X | 8 | 8 | X | X | x | +X |
EM | $Y | 9 | 9 | Y | Y | y | +Y |
SUB | $Z | : | /Z | Z | Z | z | +Z |
ESC | %A | ; | %F | [ | %K | { | %P |
FS | %B | << | %G | \ | %L | | | %Q |
GS | %C | = | %H | ] | %M | } | %R |
RS | %D | > | %I | ^ | %N | ~ | %S |
YS | %E | ? | %J | _ | %O | DEL | %T, %X, %Y, %Z |