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

ParameterMeaningTypical
aOrientation: N (normal) onlyN
bModel: 1 = original, 2 = enhanced (recommended)2
cMagnification (1–10, module size in dots)2–4
dError correction: H (≈30 %), Q (≈25 %), M (≈15 %), L (≈7 %)M
eMask value (0–7)7

Data modes

The ^FD payload starts with a prefix of error correction level and input mode, followed by a comma:

PrefixMeaningUse for
MA,error correction M, automatic inputURLs, mixed content
HA,error correction H, automatic inputsmall or heavily worn labels
MM, + modemanual input: N = numeric, A = alphanumeric, B = byte, K = Kanjiexplicit 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:

MagnificationModule size @203 dpi~24 chars (URL)
20.25 mm≈ 12 mm
30.38 mm≈ 18 mm
40.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, ^MD darkness 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.