Code 39 Barcode FAQ

What is Code 39 barcode, checksum digit, text character set, module size, reading Code 39











Code 39 Barcode Introduction

What is Code 39 barcode?

Barcode Code 39 (also known as "Code 3 of 9", "USS Code 39", "Code 3/9", "USD-3", "Alpha39", "Type 39") is a barcode symbology that can encode uppercase letters (A through Z), digits (0 through 9) and a handful of special characters like the $ sign.

What are Code 39 standards?

Code 39 barcode specification is defined in ISO/IEC 16388. The specification full name is "ISO/IEC 16388 Information technology - Automatic identification and data capture techniques - Code 39 bar code symbology specification".

The new version of Code 39 specification "ISO/IEC PRF 16388" is under development by Technical Committee "ISO/IEC JTC 1/SC 31"

There are two standards based on Code 3 of 9 specification.

  • HIBC Bar Code (Health Industry Barcode) is a solution for world wide product tracking in the health industry. Besides Code 39, HIBC will also use Code 128, EAN 13, and EAN 128
  • LOGMARS is a barcode standard based on the Code 39 specification. LOGMARS stands for Logistics Applications of Automated Marking and Reading Symbols, and it is used by the U.S. government for the military goods supply.

What is Code 39 used for?

Code 39 is a common linear barcode type used in:

  • Inventory tracking
  • Postal services
  • Health sector
  • Aviation industry
  • Government (such as US Defense department is using LOGMARS for the military equipments)


Code 39 Barcode Symbol Structure

Code 39 barcode symbols shall comprise the following parts:

  1. leading quiet zone
  2. start character
  3. code 39 character set with check digit, if used
  4. stop character
  5. trailing quiet zone

Note: characters are separated by a space (the intercharacter gap).


Start/Stop Characters

Code 39 uses asterisk character (*) as Start and Stop characters, and it should not be part of the Code 39 barcode data. In the barcode Human-readable interpretation, it can display or hide start/stop characters (asterisk *).

Example: Code 39 barcode with start/stop displayed



Code 39 Encoding Character Set



Code 39 barcode standard mode supports 43 characters, including

  • Numeric digit: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • Uppercase letters (A - Z)
  • Special characters: - (Dash), $ (Dollar), % (Percentage), (Space), . (Point), / (Slash), + (Plus)
  • Start/Stop character


Code 39 Full ASCII

Code 39 supports encoding the full 128 character ASCII character set in accordance with ISO 646 IRV.

In full ASCII code 39 symbols, regular mode supported chars (0-9, A-Z, ".", "-" and space) are the same as their representations in Code 39. Lower case letters, additional punctuation characters and control characters are represented by sequences of two characters of Code 39.


Table-1: Encode the Full ASCII character set in Code 39

ASCII CODE ASCII CODE ASCII CODE ASCII CODE
NUL %U SP SPACE @ %V ' %W
SOH $A ! /A A A a +A
STX $B " /B B B b +B
ETX $C # /C C C c +C
EOT $D $ /D D D d +D
ENQ $E % /E E E e +E
ACK $F & /F F F f +F
BEL $G ' /G G G g +G
BS $H ( /H H H h +H
HT $I ) /I I I i +I
LF $J * /J J J j +J
VT $K + /K K K k +K
FF $L , /L L L l +L
CR $M - - M M m +M
SO $N . . N N n +N
SI $O / /O O O o +O
DLE $P 0 0 P P p +P
DC1 $Q 1 1 Q Q q +Q
DC2 $R 2 2 R R r +R
DC3 $S 3 3 S S s +S
DC4 $T 4 4 T T t +T
NAK $U 5 5 U U u +U
SYN $V 6 6 V V v +V
ETB $W 7 7 W W w +W
CAN $X 8 8 X X x +X
EM $Y 9 9 Y Y y +Y
SUB $Z : /Z Z Z z +Z
ESC %A ; %F [ %K { %P
FS %B < %G \ %L | %Q
GS %C = %H ] %M } %R
RS %D > %I ^ %N ~ %S
US %E ? %J _ %O DEL %T or %X or %Y or %Z


How many characters in a Code 39 barcode?

  • Code 39 standard mode: it supports 43 characters.
  • Code 39 Full ASCII mode: it supports 128 characters.


What is the Code 39 barcode minimum length?

There are no rigid requirements for Code 39 barcode data size.

Some barcode scanners will not scan code 39 for less than 4 characters by default. You need configure barcode scanner settings to minimize the length of code 39 characters to 0.



Code 39 Check Digit Calculator with example

Code 39 does not include a checksum or check digit by default. For applications requiring enhanced data security, the modulo 43 (MOD43) check character may be used as a check digit.




How to calculate Code 39 check digit?

When a checksum or check digit is included in the Code 39 barcode, the following check character algorithm (MOD43) should be used.

  1. Each data character is assigned a numerical value as shown in Table-1 below
  2. Calculate the sum of the numerical values for all the data characters of a symbol
  3. Divide this sum by 43.
  4. The character whose value (from Table-1) is the remainder from the division in step 3) is used as the check character.

For example, calculate the check character for Code 39 data "CODE 39"

  1. All 7 chars character values are 12, 24, 13, 14, 38, 3 and 9
  2. Sum of the values is 113
  3. Divid by 43: 113/43= 2 with remainder 27
  4. Character value 27 is "R"
  5. The calculated check digit is "R"
  6. The complete Code 39 data with checksum is "CODE 39R"



Table-2: Code 39 numerical character values for modulo 43 check

Character Value Character Value Character Value
0 0 F 15 U 30
1 1 G 16 V 31
2 2 H 17 W 32
3 3 I 18 X 33
4 4 J 19 Y 34
5 5 K 20 Z 35
6 6 L 21 - 36
7 7 M 22 . 37
8 8 N 23 SPACE 38
9 9 O 24 $ 39
A 10 P 25 / 40
B 11 Q 26 + 41
C 12 R 27 % 42
D 13 S 28    
E 14 T 29    



Code 39 text label

Code 39 barcode text label is also known as human-readable interpretation. It should normally be printed with the Code 39 symbol.

A sample Code 39 image without human-readable interpretation printed.



Code 39 start/stop characters my be printed. A sample Code 39 image without start/stop characters printed.





Code 39 Barcode Dimension Size

Code 39 barcode uses the following dimension settings:

  • Width of narrow element (X): the mimumum bar width is defined by the application specification
  • Wide/narrow ratio (N): the valid value is from 2.0 to 3.0 inclusive.
  • Width of intercharacter gap (I):
    • minimum gap is equal to X
    • maximum: for X < 0.287mm, is 5.3X; for X >= 0.287mm, is 1.52mm or 3X, whichever is greater.
  • Quiet zone: the minimum width of quiet zone is 10X.
  • Bar code height: the minimum height is 5.0mm or 15% of symbol width (excluding quiet zones), whichever is greater.


Code 39 barcode dimension size calculator

The width of a Code 39 barcode, including quiet zones, can be calculated from the following expression:

W = (C + 2)(3N + 6) X + (C +1) I + 2Q

where

  • W: is the barcode width
  • C: is the number of Code 39 data characters (including the check digit if used)
  • N: is the width/narrow ratio
  • X: is the width of a narrow element
  • I: is the width of the intercharacter gap
  • Q: is the width of the quiet zone



Reading & decoding Code 39 barcode image

To be scannable by barcode scanner device or barcode reader software, you need follow the guide in the barcode specification. Here are some:

  • Code 39 wide/narow bar ratio should be 2.0 and 3.0
  • The minium of intercharacter gap is equal to bar width
  • Minium width of quite zone should be equal or greater than 10 * bar width

OnBarcode provides several barcode reading solutions for you.






Code 39 Software & Components

OnBarcode also provides high quality Code 39 barcode generator / reader library, component and SDK for you.










Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.