ZPLToolkit

^BQ

QR Code Bar CodePreview: partial

Draws a QR code. The data field takes a mode prefix that is easy to get wrong and is a frequent source of unreadable symbols.

Syntax

^BQa,b,c,d,e

Parameters

ParameterDescription and accepted valuesIf omitted
aField orientation. QR accepts normal only.N — the only orientation QR acceptsN
bQR model. Model 2 is the current standard.1 or 2 — the QR model2
cMagnification — the size of one module, in dots.1 to 10 — dots per moduleChosen by the printer
dError-correction level.H 30%, Q 25%, M 15%, L 7% recoveryQ
eMask pattern. Leave it at the default and let the encoder choose.0 to 7 — mask pattern7

How it works

^BQ produces a QR code. Unlike the linear barcodes, its size comes from the magnification factor rather than from a height in dots: each module is drawn as a square of that many dots, so magnification 6 on a 203 dpi printer gives a symbol around 20 mm across for short data.

The data in ^FD is not the raw payload. It begins with a two-character prefix — an error-correction level and an input mode, as in QA, — followed by a comma and the content. Omitting that prefix is the usual reason a QR code prints but encodes the wrong thing.

The error-correction level trades size for robustness: H recovers from 30% damage but produces the largest symbol, L recovers 7% and produces the smallest. For labels that will be handled or scuffed, M or Q is a reasonable middle ground.

Example

ZPL
^XA
^FO60,40^BQN,2,6^FDQA,https://zpltoolkit.com^FS
^XZ

Rendering…

A QR code at magnification 6, with the QA, prefix selecting automatic mode.
Open in the viewer

How the preview on this site handles it

Drawn with a real QR encoder, so the preview scans, and the data prefix is parsed. Magnification and error-correction level are honoured. The model, mask and orientation parameters are not applied.

Common mistakes

  • Omitting the mode prefix in ^FD. 'hello' and 'QA,hello' produce different symbols.
  • Magnification 1 or 2 on a 203 dpi printer. The modules are too small for most phone cameras.
  • Choosing H for a long URL. The symbol grows quickly and may not fit the space you allowed.

See also