^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,gSupport
Every documented parameter renders the same output Labelary produces.
Labelary renders this command.
Parameters
oBar code orientationoptional · one of a setRotation of the symbol and interpretation line.
- Default
- the orientation set by
^FW, which itself defaults toN - 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 NThe renderer appends the mod-43 check character.
- Default
- N
- Invalid value
- discarded, and the default applies. The renderer reports any character except
YorN, 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 · dotsHeight 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 NWhether the renderer prints the interpretation line.
- Default
- Y
- Invalid value
- discarded, and the default applies. The renderer reports any character except
YorN, 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 NWhere 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
YorN, 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:
$Afor SOH through$Zfor SUB;%Aupwards for the punctuation aboveZ;/Aupwards for the punctuation below0;+Ato+Zfor 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^FWto text fields only. A barcode after^FWRprints unrotated unless its ownoargument 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
Related commands
^BYBar Code Field DefaultSets the module width, wide-to-narrow ratio and height that every later bar code inherits.^FDField DataSupplies the text or barcode content of the field.^FOField OriginSets the top-left corner of the next field.^FTField TypesetPositions the next field by its text baseline rather than its top edge.^BLLOGMARS Bar CodeCode 39 profile mandated by US Department of Defense LOGMARS labeling, with a compulsory mod-43 check character.^BACode 93 Bar CodeDenser successor to Code 39, with two mandatory check characters and full ASCII through shift pairs.