Print & production
ZPL QR code command reference — ^BQ explained
In ZPL, ^BQ prints a QR code: ^BQa,b,c with a = orientation (N), b = model (default 2) and c = magnification 1–10 (dots per module). Error correction and input mode ride in the field data — ^FDQA,https://example.com^FS means EC level Q, automatic input. Magnification times printer dot size sets the module size.
The ^BQ command
^BQa,b,c
| Parameter | Meaning | Values | Default |
|---|---|---|---|
a |
Field orientation | N (normal) is the documented value |
N |
b |
Model | 1 (legacy), 2 |
2 — always use 2 |
c |
Magnification: printer dots per module | 1–10 | 1 at 150 dpi, 2 at 200 dpi, 3 at 300 dpi, 6 at 600 dpi |
Recent firmware documents two further optional parameters: d for error correction
(H, Q, M, L) and e for the mask value — but the portable, universally supported
way to set error correction is in the field data, below. Rotation is not done through a;
a QR code scans at any rotation, so rotate the label layout if you must, never the code.
Magnification is the whole sizing story: module size = magnification × dot size. On a
203 dpi head (0.125 mm dots), c=4 gives 0.5 mm modules — the minimum from the
4-dots-per-module rule — and c=6 gives a
comfortable 0.75 mm. On 300 dpi (0.085 mm), c=4 is 0.34 mm and c=6 is 0.51 mm.
Field data: error correction and input mode
The ^FD string starts with two switch characters before the payload:
^FD<error correction><input mode>,<data>^FS
- Error correction:
H(ultra-high, ~30%),Q(high, ~25%),M(standard, ~15%),L(high density, ~7%) — the same levels described in error correction levels explained. - Input mode:
A(automatic — the printer picks encoding; use this) orM(manual, where the data must then declare its own character mode:Nnumeric,Aalphanumeric,Bxxxxbyte with a 4-digit count,Kkanji).
So ^FDQA,https://useqr.app/m/42^FS encodes that URL at level Q with automatic input. The
same payload in manual byte mode is ^FDQM,B0022https://useqr.app/m/42^FS — the count
0022 is the exact byte length, which is why automatic mode is the sane default.
A complete working label
^XA
^PW406
^LL406
^FO60,60^BQN,2,6^FDQA,https://useqr.app/m/42^FS
^FO60,330^A0N,28,28^FDScan for the menu^FS
^XZ
At 203 dpi: magnification 6 → 0.75 mm modules; this 24-character payload at level Q is a
version 3 symbol (29 modules), so the code prints 21.75 mm wide plus a
quiet zone you must leave as empty label space — ^FO places the
symbol origin, and nothing else may sit within 4 modules (3 mm here) of it on any side.
Common mistakes
- Omitting the switch characters.
^FDhttps://…makes the printer readhtas the switches, corrupting or refusing the symbol. Conversely, sloppy generators emit payloads with a literalQA,prefix baked into the URL. Decode a printed label once and read exactly what is in it. - Magnification too small.
c=2at 203 dpi is a 0.25 mm module — half the reliable floor. If the label is too small forc=4, shorten the payload instead. - Sending a bitmap instead of ^BQ. Resampling softens module edges; firmware rendering is exact. See thermal printer QR codes.
- Trusting the preview. Emulators render
^BQslightly differently from real firmware. Verify the physical label: scan it and compare the payload, or automate it withPOST /api/v1/decodeas part of the workflow in Zebra and label printer settings. You can also sanity-check the intended payload itself in the validator.
FAQ
How do I print a QR code in ZPL?
Use ^BQ followed by the data in ^FD with two switch characters: ^BQN,2,6 then ^FDQA,yourdata^FS prints a model 2 code at magnification 6 with error correction Q and automatic input mode.
What does the magnification in ^BQ mean?
Printer dots per module, 1–10. Multiply by the dot size for physical module size: magnification 6 on a 203 dpi printer gives 0.75 mm modules. Keep it at 4 or above for reliable scanning.
What does QA mean in a ZPL QR code?
They are the field-data switches: Q selects error correction level Q and A selects automatic input mode. They precede the payload in ^FD and are consumed by the printer, not encoded.
Why does my ZPL QR code contain extra characters?
Either the switches were omitted, so the first payload characters were eaten as switches, or a generator baked a literal switch prefix into the data. Decode one printed label and inspect the exact payload.
Try it — free, no signup
Related
- Zebra and label printer settings for QR codes — Darkness, print speed, media calibration and stock choice for crisp QR codes on Zebra and similar label printers, plus a print-then-verify workflow.
- QR codes on thermal printers — dots, density and fading — Module sizing for 203 and 300 dpi thermal printers, why modules must be whole printer dots, and how long direct thermal prints actually last.
- What DPI should a QR code be printed at? — Print QR codes from vector artwork — SVG or PDF — and DPI becomes irrelevant, because the RIP renders exact edges at the device's native resolution. If…
- Pre-press checklist for QR codes — Eight checks before any print run: scan a physical proof from the real distance, verify size against the ten-to-one rule, confirm the four-module quiet…