Code 39 & Code 39 Extended
Code 39 was the first alphanumeric symbology designed for non-retail use, and remains widely used today, with variants including Code 39 Mod 43, Code 39 Extended, and the LOGMARS defense standard.
Code 39 (also known as USS Code 39, or Code Three of Nine) is the first alphanumeric symbology developed for use in non-retail environments. It is widely used to encode alphanumeric information, such as model numbers.
Code 39 is designed to encode 26 upper-case letters, 10 digits, and 7 special characters:
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T,
U, V, W, X, Y, Z
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
-, ., *, $, /, +, %, SPACE.
It is called Code 39, or Three of Nine, because each encoded character is made up of 5 bars and 4 spaces — 9 elements in total — 3 of which are always wide. A complete Code 39 bar code must include a start character (*) and a stop character (*). This makes Code 39 self-checking. The height of the bars must be at least 0.15 times the symbol's length, or 0.25 inches, whichever is larger.
Code 39 is a discrete symbology. Two adjacent characters are separated by an inter-character gap. For good bar code quality, the width of the inter-character gap should equal the width of the narrowest element, referred to as X.
Code 39 requires a leading quiet zone of at least 10 times the X dimension, or 0.10 inch, whichever is greater. The same width requirement applies to the trailing quiet zone.
Code 39 is also known as "3 of 9 Code" and "USD-3."
- Code 39 Mod 43 — In applications requiring a very high level of accuracy, a modulo-43 checksum digit is appended to the last character. Also known as HIBC and LOGMARS.
- Code 39 Extended — this encoding variant allows the full ASCII table of 128 characters to be encoded.
A typical Code 39 bar code has the following structure:
- A start character — the asterisk (*)
- The encoded message
- A stop character — the second asterisk (*)
To calculate the optional checksum digit, follow these steps:
- Take the value (0 through 42) of each character in the bar code. The start and stop characters are not included in the checksum calculation.
- Sum the values of each of the characters described in step 1.
- Divide the result from step 2 by 43.
- The remainder from the division in step 3 is the checksum character, which is appended to the data message before the stop character.
The Code 39 symbology can be extended to encode all 128 characters in the ASCII table. In full ASCII mode, the symbols $, /, %, and + are used as precedence codes together with the 26 letters, as shown below. Since the same symbol can now be interpreted as one character in Extended Code 39 mode and as two characters in standard Code 39 mode, readers must be set to extended mode to interpret the data correctly. The mapping chart is listed on the left. Code 39 Extended is sometimes called Code 39 Full ASCII.
LOGMARS (Logistics Applications of Automated Marking and Reading Symbols) is a special application of Code 39 used by the U.S. Department of Defense, governed by Military Standard MIL-STD-1189B. The standard defines acceptable ranges for a number of variables, including density, ratio, bar height, and the size of the human-readable interpretation line. The modulo-43 check digit, optional in standard Code 39, is defined and recommended in the specification. While not required by the general specification, it may be required in specific Department of Defense applications. Be sure to check the requirements for your project or contract.