Code 39 Specification

Code 39 (also known as Code 3 of 9, Code 3/9, USS Code 39, Code three of nine, or USD-3) is the first alpha-numeric symbology developed to be used in non-retail environment. It is widely used to code alphanumeric information, such as the model number etc.

Code39 is capable of encoding 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 zone.


  • Code 39 Mod 43 — In applications that require very high level of accuracy a modulo 43 check sum digit is appended to the last character. Also known as HIBC and LOGMARS.

  • Code 39 Extended — this encoding variant allows all 128 ASCII characters to be encoded.

Code 39 Mod 43

In this variant, a check character is appended to the end of data encoded, using modulo 43 algorithm. To calculate the checksum digit, follow the steps below:

  1. Take the value (0 through 42) of each character in the barcode. The start and stop characters are not included in the checksum calculation.

  2. Sum the value of each of the values of each of the characters described in step 1.

  3. Divide the result from step 2 by 43.

  4. The remainder from the division in step 3 is the checksum character that will be appended to the data message before the stop character.

Table 1. Code39 Character Value Table


Extended Code 39

The code 39 symbology can be extended to encode all 128 characters in the ASCII table. In the full ASCII mode, the symbols $ / % and + are used as precedence codes with the 26 letters as shown below. Since the same symbol now can be interpreted as one character in Extended Code 39 mode and two characters in Code 39 mode, the readers must be set to extended mode to read the data correctly. Extended Code39 is sometimes called Code39 Full ASCII.

ValASCIIEncoding ValASCIIEncoding ValASCIIEncoding ValASCIIEncoding
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

Structure of Code 39 Barcode

A typical code 39 barcode has the following structure:

  • A start character – the asterisk(*)

  • Message encoded

  • Optionally the check digit based on mod 43 algorithm.

  • A stop character – the second asterisk(*)