Barcodes
QR Codes in ZPL
QR codes are rendered natively with the `^BQ` command. No external library needed -
QR Codes in ZPL
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^FDMM,https://zplcloud.com^FS
^XZ
^BQ parameters: ^BQa,b,c,d,e
| Param | Meaning | Typical |
|---|---|---|
| ------- | --------- | --------- |
| a | orientation: N (normal), R (90°), I (180°), B (270°) | N |
| b | model: 1 = QR model 1, 2 = QR model 2 | 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, blank = printer choice) | (blank) |
Data modes
The ^FD payload starts with a two-character mode:
| Mode | Meaning | Use for |
|---|---|---|
| ------ | --------- | --------- |
MM | auto / binary | URLs, mixed content |
QA | alphanumeric | uppercase letters + digits + a few symbols |
QN | numeric | digits only |
^FDQA,HELLO123^FS ; alphanumeric
^FDQN,4006381333931^FS ; 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, correct 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 prefer the highest error correction (H) to survive dust/defects.