ZPLToolkit

^BE

EAN-13 Bar CodePreview: partial

The retail bar code used everywhere outside North America. Twelve digits in, and the printer works out the thirteenth.

Syntax

^BEo,h,f,g

Parameters

ParameterDescription and accepted valuesIf omitted
oRotation of the bar code on the label.N normal, R 90°, I 180°, B 270°Last ^FW value, else N
hBar height in dots. Retail EAN symbols are normally 25.9 mm tall at full size.1 to 32000 dotsHeight set by ^BY
fPrints the digits underneath the bars as text.Y or N — print the human-readable lineY
gMoves those digits above the bars instead.Y or N — put that line above the barsN

How it works

^BE prints EAN-13, the symbology on almost every consumer product sold outside the United States and Canada. It encodes exactly 12 digits plus a check digit, and nothing else — no letters, no variable length.

Send 12 digits and the printer calculates the check digit for you. Send 13 and it verifies the one you supplied; if it disagrees, the field is rejected rather than printed wrong. Sending your own is worth it only when the value comes from a system that already validated it.

The symbol is a fixed 95 modules wide whatever the digits are, so ^BY is what controls its size: 95 × 2 dots at ^BY2, 95 × 3 at ^BY3. Retail scanning also expects a wide quiet zone — 11 modules on the left and 7 on the right — which is more than most symbologies need and the usual reason a shelf-edge label fails at the till.

Example

ZPL
^XA
^BY3
^FO60,50^BEN,80,Y,N^FD5901234123457^FS
^XZ

Rendering…

A complete 13-digit EAN at a module width of 3 dots.
Open in the viewer

How the preview on this site handles it

Drawn with a real EAN-13 encoder, rotation included, and a wrong digit count is drawn as a hatched red box rather than as a bar code that would not scan. One detail still differs from a printer: the guard bars are drawn the same height as the rest instead of extending past the bottom of the symbol.

Common mistakes

  • Passing a UPC-A into ^BE. Twelve digits are accepted, but they are read as an EAN-13 body and the check digit will not be the one on the product.
  • Shrinking the symbol with ^BY1 to make it fit. EAN has a defined magnification range, and below it retail scanners start to fail.
  • Placing it flush against the label edge. EAN needs a wider quiet zone than any other symbology on a shipping label.

See also