# Bakery label template in ZPL (cookies, bread)

Source: https://openzpl.com/label-templates/bakery/ (updated 2026-11-01)

A bakery label in ZPL — for cookies, bread or cakes — fits the product name, an ingredients line, allergens, a best-before date and a price onto a small square label. Copy the 2 × 2 in template below and change the fields.

A layout, not legal advice. Ingredient and allergen wording is set by your local food law; check what must appear and how allergens are shown.

## What goes on a bakery label

- The product name large at the top.
- An ingredients line, wrapped to fit with a field block (^FB), and an allergen line.
- Net weight and price, a best-before date and a short lot code.
- Size: a small square like 2 × 2 in suits a cookie bag or a cake box; bigger products use 4 × 2 in.

## 2 × 2 in bakery template

Name, a wrapped ingredients line, allergens, weight, price, best-before and a lot code, laid out for 406 × 406 dots:

```zpl
^XA
^CI28
^PW406
^LL406
^FO20,20^A0N,38,38^FDChocolate Chip^FS
^FO20,62^A0N,38,38^FDCookies^FS
^FO20,112^A0N,22,22^FB366,3,2,L^FDIngredients: wheat flour, butter, sugar, chocolate (cocoa, milk), eggs, salt.^FS
^FO20,210^A0N,24,24^FDContains: WHEAT, MILK, EGG^FS
^FO20,250^A0N,22,22^FDNet 200 g^FS
^FO250,246^A0N,40,40^FD$4.50^FS
^FO20,296^GB366,2,2^FS
^FO20,312^A0N,22,22^FDBEST BEFORE 15/11/2026^FS
^BY2,2,50
^FO20,344^BCN,50,N,N,N^FDBK200CC^FS
^FO250,344^A0N,22,22^FDLOT BK-0926^FS
^XZ
```

The ingredients use ^FB366,3,2,L — a 366-dot block, up to three lines — so a long list wraps instead of running off the label. Shorten the list or add lines if it overflows.

## Render it from your code

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

Every template on this page renders through the same API. Send the ZPL as the request body and get a PNG or PDF back; see the API docs and ZPL to PDF.

**How do I wrap a long ingredients list in ZPL?** Use a field block, ^FB<width>,<max lines>,<line gap>,L, before the ^FD. The text then wraps inside the width across several lines instead of being cut at the label edge. See ^FB.

**Does a cookie or bakery label need a barcode?** Only if it is sold through a till that scans one — then add EAN-13 or UPC-A. A small Code 128 of your own product code, as in the template, is enough for internal use.
