zpl.tools
Bar codes

^B3 - Code 39 Bar Code

The general-purpose alphanumeric symbology, readable by every scanner and the safest default for internal labeling.

^B3 prints a Code 39 symbol. Code 39 is also called 3 of 9 Code or USD-3, and it is one of the three symbologies in ANSI MH10.8M. It is variable length, needs no check digit, and every scanner reads it. Those properties make it the safe choice for internal part labels and asset labels.

Choose ^BC Code 128 instead where the payload is long or must carry GS1 application identifiers. Code 39 uses nine elements per character and becomes wide quickly.

Syntax

^B3o,e,h,f,g

Support

Supportedparsed: full · state: full · rendered: full

Every documented parameter renders the same output Labelary produces.

Labelary renders this command.

Parameters

oBar code orientationoptional · one of a set

Rotation of the symbol and interpretation line.

Default
the orientation set by ^FW, which itself defaults to N
Invalid value
discarded, and the default applies. The renderer reports an unrecognized character as invalid, and uses the default.
Test coverage
Values exercised: N, R, I, B. The invalid-value rule is not pinned by a test.
N
No rotation (default)
R
Rotated 90° clockwise
I
Rotated 180°. The symbol reads upside down
B
Rotated 270° clockwise
eMod 43 check digitoptional · Y or N

The renderer appends the mod-43 check character.

Default
N
Invalid value
discarded, and the default applies. The renderer reports any character except Y or N, and adds no check digit.
Test coverage
Values exercised: Y, N. The invalid-value rule is not pinned by a test.
Y
Add the check character
N
No check character (default)
hBar code heightoptional · dots

Height of the bars, without the interpretation line.

Default
the height set by ^BY, which itself defaults to 10 dots
Accepted range
1 to 32000 dots
Invalid value
clamped to the nearest allowed value. We measured this against live Labelary on 2026-07-12. The renderer clamps an out-of-range value to the violated bound, and does not ignore it.
Test coverage
Bounds pinned: below the minimum (0), above the maximum (33000). No test at the minimum or maximum. The invalid-value rule is not pinned by a test.
fPrint interpretation lineoptional · Y or N

Whether the renderer prints the interpretation line.

Default
Y
Invalid value
discarded, and the default applies. The renderer reports any character except Y or N, and uses the default.
Test coverage
Values exercised: Y, N. The invalid-value rule is not pinned by a test.
Y
Print the text (default)
N
Print the symbol only
gInterpretation line aboveoptional · Y or N

Where the interpretation line sits. It has no effect without that line.

Default
N
Invalid value
discarded, and the default applies. The renderer reports any character except Y or N, and uses the default.
Test coverage
Values exercised: Y, N. The invalid-value rule is not pinned by a test.
Y
Above the symbol
N
Below the symbol (default)

Behavior

The native character set is digits, upper case A to Z, space and the six symbols -, ., $, /, + and %. Lower case is not in the set. The start and stop character is an asterisk, and the printer adds it and prints it in the interpretation line. ^FD123ABC therefore reads *123ABC* under the symbol.

Code 39 reaches the full 128-character ASCII set through paired characters:

  • $A for SOH through $Z for SUB;
  • %A upwards for the punctuation above Z;
  • /A upwards for the punctuation below 0;
  • +A to +Z for lower case.

Extended ASCII is a property of the scanner and not of the symbol. The guide's rule is to encode +$ at the start of the field data for extended ASCII and -$ to end it. The scanner configuration must match: a reader that does not expect a carriage return scans nothing from a symbol that encodes one.

The mod-43 check character is optional and off by default. Use ^BL LOGMARS where the check character is compulsory. It is the same symbology with the check character always on.

Code 39 is a two-width symbology, so the ^BY ratio applies over the guide's range of 2.0:1 to 3.0:1. The width of the label limits the field data. For a rotated symbol, the length of the label limits it. The data does not wrap.

Known issues

Tested behavior

Differences from the specification

zpl.tools against the ZPL II guide

Where our renderer behaves differently from the specification.

  • The guide takes the default orientation from ^FW. The renderer applies ^FW to text fields only. A barcode after ^FWR prints unrotated unless its own o argument rotates it. — not pinned by a test

Example

An 80-dot symbol with the interpretation line below. The printed text includes the asterisks the symbology adds:

^XA
^FO50,50^BY3
^B3N,N,80,Y,N
^FD123ABC^FS
^XZ

Open in viewer

  • ^BY Bar Code Field DefaultSets the module width, wide-to-narrow ratio and height that every later bar code inherits.
  • ^FD Field DataSupplies the text or barcode content of the field.
  • ^FO Field OriginSets the top-left corner of the next field.
  • ^FT Field TypesetPositions the next field by its text baseline rather than its top edge.
  • ^BL LOGMARS Bar CodeCode 39 profile mandated by US Department of Defense LOGMARS labeling, with a compulsory mod-43 check character.
  • ^BA Code 93 Bar CodeDenser successor to Code 39, with two mandatory check characters and full ASCII through shift pairs.