2D Barcode
Linear Barcode
Code 39
Code 39
Code 39 is a linear barcode symbology. In 1974, Code 39 was the first phanumeric symbology developed by Dr. David Allais and Ray Stevens of Intermec. Code 39 is also known as Alpha39, Code 3 of 9, Code 3/9, Type 39, USS Code 39, or USD-3. It is widely used in non-retail industries, such as medical, name badges, telecommunications, and government applications. Code 39 was defined as government symbology standard of official Department of Defense in 1981. It was also barcode specifications for American National Standards Institute (ANSI), Automotive Industry Action Group and Health Industry Business Communications Council (HIBCC).
Formation of Code 39
Code 39 is a discrete barcode with variable-length. It was designed for self-checking. Checksum is not required for Code 39. In this case, Code 39 could be merged easily used in existing system by adding barcode font. This makes Code 39 applealing for many applications. An intercharacter gap with same size and width separated each character. Minimum ratio is made in order to help decoder to read wide elements and narrow elements more precisely.

Each Code 39 character contains 9 elements (including 5 bars and 4 spaces).

Each character composed of 3 wide elements (represented by value "1") and 6 narrow elements (represented by value "0").
  • Width of wide element must be at least 2 times larger than the narrow element.
  • Width of a narrow bar = width of a narrow space.
  • Width of a wide bar = width of a wide space.
  • Both start character and stop character is an asterisk (*)
  • Encoding No.
  • Optional checksum digit.
Data To Be Encoded
Code 39 could be any length with the digits below. There are 43 characters which including numbers, letters, symbols defined by the specification of Code 39:
  • Upper case Letters A-Z.
  • Special character and symbols: space, minus (-), plus (+), period (.), dollar sign ($), slash (/), and percent (%).
  • An additional character asterisk (*) is used for start and stop characters.
Modulo 43 Checksum Digit
Check digit is not required for Code 39. And 43 checksum digits could be appended in more accuracy standards for increasing data. Such as LOGMARS, stands for Logistics Applications of Automated Marking and Reading Symbols, is a standard specified by Military Standard MIL-STD-1189B, MIL-STD-129, MIL-STD-2073-1C and MIL-STD-129N. It is used by United States Department of Defense. HIBC, short for Health Industry Barcode, is a barcode label. It is used in the health care product industry. Follow the steps to calculate the checksum digit:
  • Divide the result by 43.
  • The remainder of the division is the checksum digit.
Extended Code 39
In order to encoding more types of characters, extended Code 39 was developed. Extended Code 39 could easily encode lower-case characters while Code 39 only deals with upper-case letters A-Z. Extended Code 39 could encode all 128 ASCII characters. It is encoded by a pair of Code 39 characters.

Eg. 'a' in Extended Code 39 = '+A'
'b' in Extended Code 39 = '+B'

Note: '245+BCD' could be encoded as '245+BCD' (normal Code 39) or '245bCD' (Extended Code 39). Be cautious to use Extended Code 39 unless all scanners could be controlled. Since each extended character is represented by a pair of two barcode characters, it may cause waste of space.