Code 39
Encyclopedia
__FORCETOC__
Code 39 is a variable length, discrete barcode
Barcode
A barcode is an optical machine-readable representation of data, which shows data about the object to which it attaches. Originally barcodes represented data by varying the widths and spacings of parallel lines, and may be referred to as linear or 1 dimensional . Later they evolved into rectangles,...

 symbology.

The Code 39 specification defines 43 characters, consisting of uppercase letters (A through Z), numeric digits (0 through 9) and a number of special characters (-, ., $, /, +, %, and space). An additional character (denoted '*') is used for both start and stop delimiters. Each character is composed of nine elements: five bars and four spaces. Three of the nine elements in each character are wide (binary value 1), and six elements are narrow (binary value 0). The width ratio between narrow and wide can be chosen between 1:2 and 1:3.

The barcode itself does not contain a check digit (in contrast to—for instance—Code 128
Code 128
Code 128 is a very high-density barcode symbology. It is used for alphanumeric or numeric-only barcodes. It can encode all 128 characters of ASCII and, by use of an extension character , the Latin-1 characters defined in ISO/IEC 8859-1...

), but it can be considered self-checking on the grounds that a single erroneously interpreted bar cannot generate another valid character. Possibly the most serious drawback of Code 39 is its low data density: It requires more space to encode data in Code 39 than, for example, in Code 128. This means that very small goods cannot be labeled with a Code 39 based barcode. However, Code 39 is still widely used and can be decoded with virtually any barcode reader
Barcode reader
A barcode reader is an electronic device for reading printed barcodes. Like a flatbed scanner, it consists of a light source, a lens and a light sensor translating optical impulses into electrical ones...

. One advantage of Code 39 is that since there is no need to generate a check digit, it can easily be integrated into existing printing system by adding a barcode font to the system or printer and then printing the raw data in that font.

Code 39 was developed by Dr. David Allais
David Allais
Dr. David Allais is an internationally recognized expert and inventor in the fields of bar coding and automatic identification and data capture. As vice president and later president and chief executive officer of Everett, Washington-based Intermec Inc...

 and Ray Stevens of Intermec
Intermec
Intermec Inc. is a manufacturer and worldwide supplier of Automated identification and data capture equipment, including barcode scanners, barcode printers, mobile computers and RFID systems....

 in 1974. Their original design included two wide bars and one wide space in each character, resulting in 40 possible characters. Setting aside one of these characters as a start and stop pattern left 39 characters, which was the origin of the name Code 39. Punctuation characters were later added that deviated from this pattern, expanding the character set to 43 characters. Code 39 was later standardised as ANSI
Ansi
Ansi is a village in Kaarma Parish, Saare County, on the island of Saaremaa, Estonia....

 MH 10.8 M-1983 and MIL-STD-1189. MIL-STD-1189 has been cancelled and replaced by ANSI/AIM BC1/1995, Uniform Symbology Specification - Code 39.

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 font
Font
In typography, a font is traditionally defined as a quantity of sorts composing a complete character set of a single size and style of a particular typeface...

s and will often appear with the human-readable representation alongside the barcode.

These tables outline the Code 39 specification:







Legend
Format1Format2Desc
WBWide - Black
NbNarrow - Black
wWWide - White
nwNarrow - 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 checksumCharFormat1Format2
00NnNwWnWnN bwbWBwBwb
11WnNwNnNnW BwbWbwbwB
22NnWwNnNnW bwBWbwbwB
33WnWwNnNnN BwBWbwbwb
44NnNwWnNnW bwbWBwbwB
55WnNwWnNnN BwbWBwbwb
66NnWwWnNnN bwBWBwbwb
77NnNwNnWnW bwbWbwBwB
88WnNwNnWnN BwbWbwBwb
99NnWwNnWnN bwBWbwBwb
10AWnNnNwNnW BwbwbWbwB
11BNnWnNwNnW bwBwbWbwB
12CWnWnNwNnN BwBwbWbwb
13DNnNnWwNnW bwbwBWbwB
14EWnNnWwNnN BwbwBWbwb
15FNnWnWwNnN bwBwBWbwb
16GNnNnNwWnW bwbwbWBwB
17HWnNnNwWnN BwbwbWBwb
18INnWnNwWnN bwBwbWBwb
19JNnNnWwWnN bwbwBWBwb
20KWnNnNnNwW BwbwbwbWB
21LNnWnNnNwW bwBwbwbWB
22MWnWnNnNwN BwBwbwbWb
23NNnNnWnNwW bwbwBwbWB
24OWnNnWnNwN BwbwBwbWb
25PNnWnWnNwN bwBwBwbWb
26QNnNnNnWwW bwbwbwBWB
27RWnNnNnWwN BwbwbwBWb
28SNnWnNnWwN bwBwbwBWb
29TNnNnWnWwN bwbwBwBWb
30UWwNnNnNnW BWbwbwbwB
31VNwWnNnNnW bWBwbwbwB
32WWwWnNnNnN BWBwbwbwb
33XNwNnWnNnW bWbwBwbwB
34YWwNnWnNnN BWbwBwbwb
35ZNwWnWnNnN 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*". [bWbwBwBwb]w[BwbwbWbwB]w[bWbwBwBwb]

The code will not be read without these spaces. Barcode fonts invariably include this space within the glyph for the character.

Code 39 mod 43

Code 39 is sometimes used with an optional modulo
Modulo operation
In computing, the modulo operation finds the remainder of division of one number by another.Given two positive numbers, and , a modulo n can be thought of as the remainder, on division of a by n...

 43 check digit
Checksum
A checksum or hash sum is a fixed-size datum computed from an arbitrary block of digital data for the purpose of detecting accidental errors that may have been introduced during its transmission or storage. The integrity of the data can be checked at any later time by recomputing the checksum and...

. Using it requires this feature to be enabled in the barcode reader. The code with check digit is referred to as Code 39 mod 43.

Here is how to do the checksum
Checksum
A checksum or hash sum is a fixed-size datum computed from an arbitrary block of digital data for the purpose of detecting accidental errors that may have been introduced during its transmission or storage. The integrity of the data can be checked at any later time by recomputing the checksum and...

 calculation:
  • Take the value (0 through 42) of each character in the barcode excluding start and stop codes.
  • Sum the values.
  • Divide the result by 43.
  • The remainder is the value of the checksum character to be appended.

Full ASCII Code 39

Code 39 is restricted to 43 characters. In Full ASCII
ASCII
The American Standard Code for Information Interchange is a character-encoding scheme based on the ordering of the English alphabet. ASCII codes represent text in computers, communications equipment, and other devices that use text...

 Code 39 Symbols 0-9, A-Z, "." ,and "-" are the same as their representations in Code 39. Lower case letters, additional punctuation
Punctuation
Punctuation marks are symbols that indicate the structure and organization of written language, as well as intonation and pauses to be observed when reading aloud.In written English, punctuation is vital to disambiguate the meaning of sentences...

characters and control characters are represented by sequences of two characters of Code 39.









































































































































































































Code Details
NrCharacterEncoding    NrCharacterEncoding    NrCharacterEncoding    NrCharacterEncoding
0NUL%U 32[space][space] 64@%V 96`%W
1SOH$A 33!/A 65AA 97a+A
2STX$B 34"/B 66BB 98b+B
3ETX$C 35#/C 67CC 99c+C
4EOT$D 36$/D 68DD 100d+D
5ENQ$E 37%/E 69EE 101e+E
6ACK$F 38&/F 70FF 102f+F
7BEL$G 39'/G 71GG 103g+G
8BS$H 40(/H 72HH 104h+H
9HT$I 41)/I 73II 105i+I
10LF$J 42*/J 74JJ 106j+J
11VT$K 43+/K 75KK 107k+K
12FF$L 44,/L 76LL 108l+L
13CR$M 45-- 77MM 109m+M
14SO$N 46.. 78NN 110n+N
15SI$O 47//O 79OO 111o+O
16DLE$P 4800 80PP 112p+P
17DC1$Q 4911 81QQ 113q+Q
18DC2$R 5022 82RR 114r+R
19DC3$S 5133 83SS 115s+S
20DC4$T 5244 84TT 116t+T
21NAK$U 5355 85UU 117u+U
22SYN$V 5466 86VV 118v+V
23ETB$W 5577 87WW 119w+W
24CAN$X 5688 88XX 120x+X
25EM$Y 5799 89YY 121y+Y
26SUB$Z 58:/Z 90ZZ 122z+Z
27ESC%A 59;%F 91[%K 123{%P
28FS%B 60<%G 92\%L 124|%Q
29GS%C 61=%H 93]%M 125}%R
30RS%D 62>%I 94^%N 126~%S
31US%E 63?%J 95_%O 127DEL%T, %X, %Y, %Z
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK