Barcodes
QR Codes in ZPL
QR codes are rendered natively with the ^BQ command. No external library needed – the printer computes the matrix.
QR codes are rendered natively with the ^BQ command. No external library needed – the printer computes the matrix.
Basic QR code
^XA
^FO100,100^BQN,2,8^FDMA,https://zplcloud.com^FS
^XZ
^BQ parameters: ^BQa,b,c,d,e
| Parameter | Meaning | Typical |
|---|---|---|
| a | Orientation: N (normal) only | N |
| b | Model: 1 = original, 2 = enhanced (recommended) | 2 |
| c | Magnification (1–10, module size in dots) | 2–4 |
| d | Error correction: H (≈30 %), Q (≈25 %), M (≈15 %), L (≈7 %) | M |
| e | Mask value (0–7) | 7 |
Data modes
The ^FD payload starts with a prefix of error correction level and input mode, followed by a comma:
| Prefix | Meaning | Use for |
|---|---|---|
MA, | error correction M, automatic input | URLs, mixed content |
HA, | error correction H, automatic input | small or heavily worn labels |
MM, + mode | manual input: N = numeric, A = alphanumeric, B = byte, K = Kanji | explicit encoding |
^FDMA,https://zplcloud.com^FS ; automatic
^FDQM,N4006381333931^FS ; error correction Q, manual numeric
Size guidance
The physical size depends on magnification and content length:
| Magnification | Module size @203 dpi | ~24 chars (URL) |
|---|---|---|
| 2 | 0.25 mm | ≈ 12 mm |
| 3 | 0.38 mm | ≈ 18 mm |
| 4 | 0.50 mm | ≈ 24 mm |
Rule of thumb: keep at least 4 modules of quiet zone on all sides; the printer must be able to print a clean solid square (clean printhead, sufficient darkness).
Tips
- QR needs good contrast: black modules on white media,
^MDdarkness high enough. - Always test with a phone – a QR that "looks fine" may still not scan if the error-correction level is too low for the print quality.
- For very small labels choose the highest error correction (H) to survive dust and defects.