Code 39 - Encoding

Encoding

The * character presented below is not a true encodable character, but is the start and stop symbol for Code 39. The asymmetry of the symbol allows the reader to determine the direction of the barcode being scanned. This code is traditionally mapped to the * character in barcode fonts and will often appear with the human-readable representation alongside the barcode.

These tables outline the Code 39 specification:

Legend
Format1 Format2 Desc
W B Wide - Black
N b Narrow - Black
w W Wide - White
n w Narrow - White


(Note, Format1 and Format2 are just two different ways of describing the same underlying encoding, not two variants of Code 39.)

><

Code Details
Char nr for checksum Char Format1 Format2
0 0 NnNwWnWnN bwbWBwBwb
1 1 WnNwNnNnW BwbWbwbwB
2 2 NnWwNnNnW bwBWbwbwB
3 3 WnWwNnNnN BwBWbwbwb
4 4 NnNwWnNnW bwbWBwbwB
5 5 WnNwWnNnN BwbWBwbwb
6 6 NnWwWnNnN bwBWBwbwb
7 7 NnNwNnWnW bwbWbwBwB
8 8 WnNwNnWnN BwbWbwBwb
9 9 NnWwNnWnN bwBWbwBwb
10 A WnNnNwNnW BwbwbWbwB
11 B NnWnNwNnW bwBwbWbwB
12 C WnWnNwNnN BwBwbWbwb
13 D NnNnWwNnW bwbwBWbwB
14 E WnNnWwNnN BwbwBWbwb
15 F NnWnWwNnN bwBwBWbwb
16 G NnNnNwWnW bwbwbWBwB
17 H WnNnNwWnN BwbwbWBwb
18 I NnWnNwWnN bwBwbWBwb
19 J NnNnWwWnN bwbwBWBwb
20 K WnNnNnNwW BwbwbwbWB
21 L NnWnNnNwW bwBwbwbWB
22 M WnWnNnNwN BwBwbwbWb
23 N NnNnWnNwW bwbwBwbWB
24 O WnNnWnNwN BwbwBwbWb
25 P NnWnWnNwN bwBwBwbWb
26 Q NnNnNnWwW bwbwbwBWB
27 R WnNnNnWwN BwbwbwBWb
28 S NnWnNnWwN bwBwbwBWb
29 T NnNnWnWwN bwbwBwBWb
30 U WwNnNnNnW BWbwbwbwB
31 V NwWnNnNnW bWBwbwbwB
32 W WwWnNnNnN BWBwbwbwb
33 X NwNnWnNnW bWbwBwbwB
34 Y WwNnWnNnN BWbwBwbwb
35 Z NwWnWnNnN bWBwBwbwb
36 - NwNnNnWnW bWbwbwBwB
37 . WwNnNnWnN BWbwbwBwb
38 (space) NwWnNnWnN bWBwbwBwb
39 $ NwNwNwNnN bWbWbWbwb
40 / NwNwNnNwN bWbWbwbWb
41 + NwNnNwNwN bWbwbWbWb
42 % NnNwNwNwN bwbWbWbWb
* NwNnWnWnN bWbwBwBwb


Please Note: In between each character (the start and stop characters included) there is a thin space (shown as w below). For example, if you wanted a Code 39 barcode composed of the letter "A", you would need the following to be encoded (using Format 2 as described above): "*A*". ww
The code will not be read without these spaces. Barcode fonts invariably include this space within the glyph for the character.

Read more about this topic:  Code 39