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 viewer2 × 1 in at each print density
| Printer | dpmm | Exact dpi | ^PW | ^LL | dpi the API uses | API image (px) |
|---|---|---|---|---|---|---|
| 152 dpi | 6 | 152.4 | 304 | 152 | 152 | 304 × 152 |
| 203 dpi | 8 | 203.2 | 406 | 203 | 203 | 406 × 203 |
| 300 dpi | 12 | 304.8 | 609 | 304 | 304 | 608 × 304 |
| 600 dpi | 24 | 609.6 | 1219 | 609 | 609 | 1218 × 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:

^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.