Code 39

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 is not critical, and may be chosen between 1:2 and 1:3.[citation needed]
The barcode itself does not contain a check digit (in contrast to—for instance—Code 128), 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 used by some postal services (although the Universal Postal Union recommends using Code 128 in all cases[1]), and can be decoded with virtually any barcode reader. One advantage of Code 39 is that since there is no need to generate a check digit, it can easily be integrated into an 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 and Ray Stevens of Intermec 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.[2] Four punctuation characters were later added, using no wide bars and three wide spaces, expanding the character set to 43 characters. Code 39 was later standardised as ANSI MH 10.8 M-1983 and MIL-STD-1189.[3] MIL-STD-1189 has been cancelled and replaced by ANSI/AIM BC1/1995, Uniform Symbology Specification — Code 39.[4]

Bars | Spaces | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|| ||| | +0 | ||| || | +10 | |||| | | +20 | | |||| | +30 | ||||||
▮|||▮ | 1 | ▮| ||▮ | 1 | 1 | ▮|| |▮ | A | 10 | ▮||| ▮ | K | 20 | ▮ |||▮ | U | 30 |
|▮||▮ | 2 | |▮ ||▮ | 2 | 2 | |▮| |▮ | B | 11 | |▮|| ▮ | L | 21 | | ▮||▮ | V | 31 |
▮▮||| | 3 | ▮▮ ||| | 3 | 3 | ▮▮| || | C | 12 | ▮▮|| | | M | 22 | ▮ ▮||| | W | 32 |
||▮|▮ | 4 | || ▮|▮ | 4 | 4 | ||▮ |▮ | D | 13 | ||▮| ▮ | N | 23 | | |▮|▮ | X | 33 |
▮|▮|| | 5 | ▮| ▮|| | 5 | 5 | ▮|▮ || | E | 14 | ▮|▮| | | O | 24 | ▮ |▮|| | Y | 34 |
|▮▮|| | 6 | |▮ ▮|| | 6 | 6 | |▮▮ || | F | 15 | |▮▮| | | P | 25 | | ▮▮|| | Z | 35 |
|||▮▮ | 7 | || |▮▮ | 7 | 7 | ||| ▮▮ | G | 16 | |||▮ ▮ | Q | 26 | | ||▮▮ | - | 36 |
▮||▮| | 8 | ▮| |▮| | 8 | 8 | ▮|| ▮| | H | 17 | ▮||▮ | | R | 27 | ▮ ||▮| | . | 37 |
|▮|▮| | 9 | |▮ |▮| | 9 | 9 | |▮| ▮| | I | 18 | |▮|▮ | | S | 28 | | ▮|▮| | ␣ | 38 |
||▮▮| | 10 | || ▮▮| | 0 | 0 | ||▮ ▮| | J | 19 | ||▮▮ | | T | 29 | | |▮▮| | * | |
||||| | | | | || | $ | 39 | | | || | | / | 40 | | || | | | + | 41 | || | | | | % | 42 |
Here is how to do the checksum 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 10 (for Mod 10 check digit) or by 43 (for Mod 43 check digit).
- The remainder is the value of the checksum character to be appended.
The following free and open source software can produce Code 39 barcodes:
- ^ As one example of an international standard, see "Identification of postal items – 13-character identifier" (PDF). Universal Postal Union. 17 October 2017.
- ^ Allais, D. C. (2006). "AIDC Memoirs" (PDF). Archived from the original (PDF) on 2013-01-26. Retrieved 2010-06-02.
{{cite journal}}
: Cite journal requires|journal=
(help) - ^ "MIL-STD-1189 Standard Department of Defense Barcode Symbology". 1989-08-10. Archived from the original on 2011-07-22. Retrieved 2010-07-22.
- ^ "Adoption Notice: AIM/BC1 Uniform Symbology Specification". 1997-06-19. Archived from the original on 2011-09-27. Retrieved 2011-04-06.
- ^ "GNU Barcode". GNU Project. 19 February 2020.
[[Barcode reader|]]