ZPL dots and printer resolution

ZPL positions and sizes everything in dots, the smallest point a printer can print: ^FO positions, ^PW print width, ^LL label length, ^GB box sizes and ^BY bar widths. How big a dot is depends on the printer’s resolution.

Resolutions: dpmm, not dpi

Label printers are sold as 203, 300 or 600 dpi. Internally they work in dots per millimetre, and the dpi values are rounded:

Sold asDots per mmActual dpiOne dot
152 dpi6152.40.167 mm
203 dpi8203.20.125 mm
300 dpi12304.80.083 mm
600 dpi24609.60.042 mm

This matters for inch-based labels. A 4 inch wide label at 300 dpi is not 4 × 300 = 1200 dots but 4 × 25.4 × 12 = 1219 dots. With 1200 the layout would be 1.6 mm too narrow.

Converting to dots

dots = mm × dots per mm      (rounded down)
mm   = inches × 25.4

Rounding down ensures the layout never gets larger than the label. Examples: 100 mm at 8 dpmm = 800 dots. 4 in at 8 dpmm = 812 dots.

The same ZPL on a different printer

ZPL does not scale automatically. A label designed for 203 dpi printed on a 300 dpi printer comes out about one third smaller, because every dot is smaller. To keep the physical size, all dot values must be multiplied by 12 / 8 = 1.5.

Barcode module width

^BY sets the narrow bar width of 1D barcodes in whole dots. So the possible module widths depend on the resolution:

^BY8 dpmm12 dpmm24 dpmm
20.250 mm0.167 mm0.083 mm
30.375 mm0.250 mm0.125 mm
40.500 mm0.333 mm0.167 mm

For EAN-13 and UPC-A at the retail point of sale, GS1 specifies a nominal module width (X-dimension) of 0.330 mm and a permitted range of 0.264 mm to 0.660 mm. At 8 dpmm ^BY2 (0.250 mm) is below that range, ^BY3 (0.375 mm) is within it.

Related tools