zpl.tools
Bar codes

^BZ - Postal Bar Code

USPS postal symbologies — POSTNET, PLANET and Intelligent Mail — selected by a type argument.

^BZ prints one of the USPS postal symbologies, chosen by its type argument: POSTNET, PLANET, or the Intelligent Mail barcode. The USPS accepts only Intelligent Mail for new mailings, so a current address block needs type 3. The other two reproduce existing artwork.

Syntax

^BZo,h,f,g,t

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
No documented value is exercised by a test (N, R, I, B). The invalid-value rule is pinned by 1 test.
N
No rotation (default)
R
Rotated 90° clockwise
I
Rotated 180°. The symbol reads upside down
B
Rotated 270° clockwise
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 (99999). 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
N
Invalid value
discarded, and the default applies. The renderer reports any character except Y or N, and uses the default.
Test coverage
No documented value is exercised by a test (Y, N). The invalid-value rule is not pinned by a test.
Y
Print the text
N
Print the symbol only (default)
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. Not exercised: N. The invalid-value rule is not pinned by a test.
Y
Above the symbol
N
Below the symbol (default)
tPostal bar code typeoptional · one of a set

Which postal symbology to encode. Intelligent Mail is the only symbology that the USPS still accepts for new mailings.

Default
0
Invalid value
not documented, and we have not measured it. No measurement covers a type that the renderer does not recognize. The reserved type 2 is a different case: it is a documented value, and the renderer draws nothing and reports an invalid argument.
Test coverage
Bounds pinned: above the maximum (4). Values exercised: 0, 1, 2, 3.
0
POSTNET (default)
1
PLANET
2
Reserved. The renderer draws nothing for the field and reports an invalid argument. Labelary also draws nothing. Labelary reports no warning.
3
USPS Intelligent Mail (four-state)

Behavior

All three types are height-modulated and not width-modulated. POSTNET and PLANET use five bars of two heights for each digit, and Intelligent Mail uses four states for each bar. The ^BY ratio therefore has no meaning here, and the height argument applies.

The field data is digits, and the length of the number distinguishes one code from another within each type. A POSTNET ZIP, ZIP+4 and delivery-point code are the same symbology at three lengths. The guide gives no length rule of its own, so the payload must be valid for the selected type. Nothing converts between them.

As with ^B5, the interpretation line is off by default. A person is not the intended reader of a postal code, and on a mailpiece the printed digits sit in the address block and not under the bars.

The renderer does not parse ^BZ. It reports the command as valid ZPL that it does not support, and it draws nothing. ^B5 renders a PLANET symbol, which covers the type 1 case only. Nothing substitutes for POSTNET or Intelligent Mail.

Known issues

Tested behavior

Differences from the specification

Labelary against the ZPL II guide

Where Labelary — our compatibility target — behaves differently from the printed specification.

  • The 2006 guide documents ^BZ as POSTNET only, with four arguments and no way to select a symbology. Later firmware adds the fifth type argument, PLANET and Intelligent Mail. Labelary documents that firmware. The renderer follows Labelary. — not pinned by a test

Example

An Intelligent Mail barcode, the only type still accepted for new mailings:

^XA
^FO50,50^BY3
^BZN,80,N,N,3
^FD00040123456200800001^FS
^XZ

Open in viewer