← Guides & articles
ED
Eduard Diaz
IT technician at S-IE, an official Zebra partner · Updated

^BY · Barcode Field Default

Defines module width and default barcode height.

Syntax and practical example

^BYw,r,h

Example: ^BY3,2,80 (module, ratio, height)

^XA
^PW600
^LL400
^FO40,40^BY2,2,60^BCN,60,Y,N,N^FDAB12^FS
^FO40,180^BY3,2,60^BCN,60,Y,N,N^FDAB12^FS
^XZ

Educational example; not a certified label or a physical print test. Sample text and codes stay the same in every language for comparison.

Expected result with ^BY

Both Code 128 symbols encode AB12 at 60 dots high. The upper one uses module width 2 and the lower 3: the latter is wider with identical data. Compare their widths before setting the right margin.

What should I check if ^BY does not give the expected result?

The second parameter is the wide-to-narrow bar ratio, not a universal horizontal scale: it has no effect on fixed-ratio Code 128. ^BY does not size QR codes; use ^BQ for that.

Related commands

Zebra technical reference ↗

ED

About the author

Eduard Diaz

Eduard Diaz is an IT technician (development) at S-IE, an official Zebra partner with more than 20 years providing identification and labelling services. He builds and maintains EditorZPL to make working with ZPL and Zebra label printers easier.

s-ie.cat

Related tools