Code39 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 character encoded is made up of 5 bars and 4 spaces for a total of 9 elements and 3 out of 9 element are always wide. A complete code 39 barcode must include a start character * and a stop character *. In this way code 39 is self-checking. The height of the bars must be at least 0.15 times of 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. To have the good barcode quality, the width of the inter-character gap usually equals to the width of the narrowest element, called X.
Code39 requires a starting quiet zone with the minimum
10 times of X dimension or 0.10 inch whichever is greater.
The same width requirement applies to the trailing quiet
Code 39 is also known as "3 of 9 Code" and "USD-3".
2. Code 39 Extended – this encoding variant allows the full ASCII table, 128 characters to be encoded.
1. A start character – the asterisk(*)
2. Message encoded
3. A stop character – the second asterisk(*)
2. Take the value (0 through 42) of each character in the barcode. The start and stop characters are not included in the checksum calculation.
3. Sum the value of each of the values of each of the characters described in step 1.
4. Divide the result from step 2 by 43.
5. The remainder from the division in step 3 is the checksum character that will be appended to the data message before the stop character.