Code 39 Barcode FAQ & Tutorial
Code 39 Barcode Symbology
Code 39 is a common barcode type used for various labels such
as name badges, inventory and industrial applications. The symbology
of the Code 39 character set consists of barcode symbols representing
numbers 0-9, upper-case letters A-Z, the space character and the following
symbols: - . $ / + %. Lower-case characters may also be easily encoded
fonts provided in the
The Code 39 barcode is the easiest of the alpha-numeric barcodes
to use and is designed for character self-checking, thus eliminating
the need for check character calculations. Code 39 is also known as
the 3 of 9 Barcode, Code 3 of 9 and Barcode39. Several standards exist
that dictate how Code 39 barcodes should be printed for certain implementations.
Although a checksum character is optional, many standards require it.
The checksum character is a type of MOD43 calculation
provided in many of the IDAutomation
for the Code
39 Barcode Fonts. Enabling the check digit is also an option within IDAutomation
allow the component to automatically generate and include the
MOD43 checksum without fonts.
The following standards based on the 3 of 9 barcode require MOD43
- LOGMARS (Logistics Applications of Automated Marking
and Reading Symbols) is a standard based on Code 39 used by the
United States Department of Defense. LOGMARS is defined by Military
Standard MIL-STD-1189B and others such as MIL-STD-129, MIL-STD-2073-1C
- HIBC (Health
Industry Barcode) is a barcode label used in the health care
product industry. Several implementations of HIBC also use
The complete Code 39 barcode consists of a start character, data
digits, an optional check character and a stop character.
||Optional Check Character
The Code 39 asterisk character is usually used as a start/stop character,
and should not be part of the data in the barcode. The asterisk may
be used as the start/stop character with fonts; however, this may cause
problems in some applications such as MS Word, because they may treat
text surrounded with asterisks as bold text. In IDAutomation
Code 39 barcode
fonts, the exclamation and parentheses characters are also used
as start/stop characters to avoid these problems and provide additional
Printing & Generating Code 39 Barcodes
Printing of the Code 39 barcode as a font is an easy process if checksum
characters are not required for the implementation. If the checksum
is needed, IDAutomation provides several
for this purpose.
IDAutomation Code 39 Barcode Fonts may be created directly from the
used in a calculated field to dynamically produce multiple symbols
in many applications, including
To create a 3 of 9 barcode manually that encodes the data "BAR CODE-39",
the following may be performed:
- Type the start character of "*".
- Enter the data to be encoded, which is "BAR CODE-39".
- To create the space in the barcode using the standard Code 39 Fonts,
an underscore must replace the space in the data to encode:
- Type the stop character of "*" .
- Select only *BAR_CODE-39* and change the font to the Code 39 Barcode
When the IDAutomation
Code 39 Barcode Font is used, the parenthesis may be used as the
start and stop characters to keep the asterisks from appearing in the
text interpretation. For example, (BAR_CODE-39).
2014 Update: IDAutomation now provides
Symbol Encoded Fonts that
encode the space character
without a substitution character; available in the latest version of the
39 Fonts. After installation, these fonts are identified by the "Y"
character in the font name, for example IDAutomationYHC39S.
Calculated Field Use
Code 39 Barcodes may be dynamically created from a calculated field in a text
box by using a formula that appends the start and stop characters. This is possible in several applications
including the following:
- Active Reports:
- Crystal Reports: Enter
Field & "*" in a calculated field.
- FileMaker Pro: Enter
Field & "*" in a
so that the asterisk is appended to the beginning and ending of the data from
the source field.
- Lotus Notes: A formula that places a return function (in
extended39) between fields:
DataField1 + "$M" + DataField2 + "*"
- Lotus Approach:
Combine('*', DataField, '*')
- Here is an approach formula that also
replaces spaces with the "=" character as required:
Combine('*', Translate(DataField,' ','='), '*')
- Lotus 123 for Windows:
- this formula converts a number in cell C9 to text for barcoding:
- Microsoft® Access:
- Microsoft® Excel:
- Oracle Reports and Forms - Place an asterisk before and after the
data and apply IDAutomation's barcode font to the field.
- QuickBooks: Refer to IDAutomation's
Integration Guides are also available that suggest one or more barcode
39 printing options. These integration options should be examined to
determine whether to use barcode components, applications or fonts for
the printing of barcodes. A few of the
Integration Guides offered include the following:
Reading Code 39 Barcodes
The most common
method of reading barcodes is with a
Most barcode scanners recommended by IDAutomation perform keyboard emulation
and receive power from the USB port, so that no external power supply
is required. When a barcode is scanned using keyboard emulation, the
data scanned appears at the cursor as if it had been typed in from the
Most barcode scanners have the ability to read Code 39 barcodes by
default, such as the
USB Barcode Scanner. This scanner dependably reads the IDAutomation
Code 39 Barcode
Universal Barcode Font when printed as small as 6 points, which
is an X dimension of 4 mils.
The manual calculations described below are rarely necessary. IDAutomation
barcode font tools, plug-ins and source code samples that are free
to use with IDAutomation fonts, which
automatically format the start, stop and check characters to
the barcode fonts. Additionally, the check digit option in all
calculates and includes the checksum automatically.
Perform the following to calculate the optional modulus 43 check
- Using the table below, obtain the number value of each data
- Add all of these values together.
- Divide the total by 43 and obtain the remainder.
- The check character is the value of the remainder.
For example, perform the following calculations to determine the
check character using the data characters "CODE39":
- The values are 12, 24, 13, 14, 3 and 9.
- When added together, these total 75.
- Now divide 75 by 43 and the remainder is 32.
- The check character is W
Code 39 Character Values:
Character Set in Extended Code 39:
Within the IDAutomation
Code-39 Font Package,
fonts are provided to easily encode lower-case characters in addition
to upper-case letters and numbers. When these fonts are not being used,
or when it is necessary to encode additional characters, shift functions
may be used to extend the character set according to ISO 646. In
order for Extended Code 39 to be decoded properly, the scanner must
first be programmed to read it. Otherwise, the scanner will simply scan
the existing data, for example "+C" instead
When extended Code 39 is enabled, functions may be directly encoded
by using the format $? to specify
the function where ? equals the
character that represents the appropriate function in the chart below.
For example, Code$I3of9$M
will encode Code[TAB]3of9[RETURN].
The Extended Code 39 ASCII Character Table
Extended Code 39
ASCII Character Table
||SH (Start of Heading)
||FS (File Separator)
||SX (Start of Text)
||GS (Group Separator)
||EX (End of Text)
||RS (Record Separator)
||ET (End of Transmission)
||US (Unit Separator)
||BL (Bell-Audible of Attention
||HT (Horizontal Tabulation)
||LF (Line Feed)
||VT (Vertical Tabulation)
||FF (Form Feed)
||CR (Carriage Return)
||SO (Shift Out)
||SI (Shift In)
||DL (Data Link Escape)
||D1 (Device Control 1-XON)
||D2 (Device Control
||D3 (Device Control 3-XOFF)
||D4 (Device Control 4)
||NK (Negative Acknowledge)
||SY (Synchronous Idle)
||EB (End of Transmission Block)
(= or ~ in the fonts)
||EM (End of Medium)
A space symbol cannot usually be represented from a font
with an actual space (ASCII 32). To overcome this issue with
Back to Top