コンテンツに移動

2 × 1 in labels in ZPL

A 2 × 1 inch label (50.8 × 25.4 mm) is 406 × 203 dots at 203 dpi and 609 × 304 dots at 300 dpi. Use ^PW406 and ^LL203 on a 203 dpi printer, and the size 2x1 in the API path.

2026-10-20 に更新されました · Renders made with the OpenZPL engine

Open in the viewer

2 × 1 in at each print density

PrinterdpmmExact dpi^PW^LLdpi the API usesAPI image (px)
152 dpi6152.4304152152304 × 152
203 dpi8203.2406203203406 × 203
300 dpi12304.8609304304608 × 304
600 dpi24609.612196096091218 × 609

^PW and ^LL are the size in millimetres times the dots per millimetre, rounded down, because they take whole dots. The printer names round the density: a "300 dpi" printer prints 12 dots per millimetre, which is 304.8 dpi. The API sizes its image the way Labelary does: inches times a whole number of dots per inch (152, 203, 304 or 609), rounded down. That is why the image can be a dot or two smaller than ^PW and ^LL. Try other sizes with the label size calculator.

Starter template

2 × 1 in is a small label for SKUs, bins and retail items. There is space for a code, a short description and a short barcode:

2 by 1 inch SKU label with a code, a short description and a Code 128 barcode
2 × 1 in label at 203 dpi (8 dpmm) · 406 × 203 px · Open in the viewer
^XA
^CI28
^PW406
^LL203
^FO20,15^A0N,30,30^FDTLR46500^FS
^FO20,50^A0N,22,22^FDThermal rolls 4x6^FS
^BY2,3,70
^FO20,85^BCN,70,Y,N,N^FDTLR46500^FS
^XZ

On a label this small the barcode sets the limit. A Code 128 at ^BY2 takes about 22 dots per character in subset B, so long data won't fit; keep it short or use a Data Matrix, which packs more data in a square. Leave a clear margin on both sides of the bars; see quiet zone.

Coordinates in ZPL are dots, so a layout made for one density prints at another size on a different printer. See 203 vs 300 dpi before sending the same ZPL to both.

curl https://api.openzpl.com/v1/printers/8dpmm/labels/2x1/0/ \
  --data-binary @label.zpl > label.png

質問

What are ^PW and ^LL for a 2x1 label?

^PW406 and ^LL203 at 203 dpi; ^PW609 and ^LL304 at 300 dpi.

Which density is better for 2x1 labels?

300 dpi draws small text and narrow bars more cleanly; 203 dpi works if text stays above about 20 dots and barcodes use a module width of 2 or more.

Sources