zpl.tools
Bar codes

^BE - EAN-13 Bar Code

Thirteen-digit retail symbology, the international form of UPC-A.

^BE prints an EAN-13 symbol, the retail bar code outside North America and a superset of ^BU UPC-A. A UPC-A number is an EAN-13 with a leading zero.

EAN-13 holds the same number of bars as UPC-A. It encodes a thirteenth digit into the parity pattern of the left-hand six digits, and that digit with the twelfth gives the country prefix.

^BU does not render yet. To print a UPC-A, add the leading zero and send the number through ^BE.

Syntax

^BEo,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
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: minimum (1), below the minimum (0), above the maximum (40000). No test at the 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 field data is exactly twelve digits. The thirteenth is a mod-10 check digit, and the printer computes it. We measured this against Labelary on 2026-07-30. The printer accepts all thirteen digits and recomputes the last one, so ^FD590123412345 and ^FD5901234123457 render the same symbol. The printer pads a shorter payload on the left with zeros.

Do not rely on a payload longer than thirteen digits. Validate the length upstream.

JAN-13 is the Japanese application of the same symbology, and its first two non-zero digits are 49.

For UCC and EAN-14 the guide names ^B2 Interleaved 2 of 5, not ^BE.

EAN-13 has a fixed print ratio, so the ^BY ratio argument has no effect and only the module width and the height apply. The interpretation line prints in the retail layout, with the leading digit outside the left guard bar.

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
  • The thirteenth digit is a check digit that the renderer computes from the first twelve. The renderer ignores a thirteenth digit in ^FD, so a payload with a wrong check digit prints corrected instead of rejected. — pinned by test_ean_13_reports_a_supplied_check_digit_that_disagrees

zpl.tools against Labelary

Where our output differs from Labelary for the same input. These are the differences that break a migration.

  • A payload longer than thirteen digits keeps its rightmost thirteen. This is the guide's left truncation applied to the data-plus-check form. Labelary keeps the first digit and the last eleven instead. On Labelary, ^FD123456789012345 encodes 1567890123459. That rule fits no reading of the guide, so the renderer does not reproduce it. The two engines encode different articles for the same field data. — not pinned by a test

Example

Twelve digits, with the thirteenth computed. The interpretation line reads 5 901234 123457:

^XA
^FO50,50^BY3
^BEN,80,Y,N
^FD590123412345^FS
^XZ

Open in viewer