How to create a QR code in ZPL
Learn how to generate a reliable QR code with Zebra Programming Language (ZPL), choose the right size and error correction, and test the printed result before production.

What a ZPL QR code contains
A QR code stores text in a two-dimensional matrix. In a label workflow that text is often a URL, a product identifier, a tracking value or contact details. ZPL sends the instructions to the printer; the printer creates the modules at print time.
The ^BQ command is the ZPL command for QR symbols. It defines the orientation, model and magnification, while ^FD supplies the data. Start with a short, realistic payload and keep a quiet zone of white space around the symbol.
The basic ^BQ syntax
A compact example is shown below. ^FO positions the symbol, ^BQN selects a QR code, 2 selects the common QR model and 6 is the magnification factor. The LA prefix tells the printer to use automatic error correction for the following data.
The ^FS terminator closes the field and ^XZ ends the label format. Keep each command together while debugging so you can distinguish a positioning problem from an invalid payload.
^XA
^FO60,60^BQN,2,6^FDLA,https://editorzpl.com^FS
^XZChoose size, DPI and error correction
QR modules are printed dots, so the same magnification produces different physical sizes at 203, 300 and 600 DPI. A value that scans on a desktop preview may be too small on the real label. Match the viewer DPI to the target printer and measure the printed symbol.
Leave a clear quiet zone on every side and avoid placing the symbol against a border or textured background. Higher error correction helps when labels may be scratched, but it also makes the symbol denser. Increase the symbol size before shrinking the quiet zone.
Prepare the data before encoding it
URLs, plain text and identifiers work well. For a URL, use the final HTTPS address and keep it short so the QR remains easy to scan. If a system requires Wi-Fi, vCard or another format, generate the exact payload required by that format and test it independently.
Do not paste unescaped control characters or an accidental line break into ^FD. Test accented characters and long values with the same firmware and code page as production. The QR generator can help you inspect the payload before you put it into a label template.
Open the QR generatorPreview and print a real sample
Paste the example into the ZPL viewer, select the physical label size and choose the printer DPI. The preview is useful for checking placement, rotation and overall density, but it cannot prove that a scanner will read the physical ink.
Print one sample on the final stock and scan it with at least two devices. Check the shortest and longest expected values, contrast, quiet zone, orientation and distance. If the symbol fails, increase magnification and review the data before changing several variables at once.
Common QR problems in ZPL
A QR that does not scan is usually too small, too dense, low contrast or cropped by the label edge. A missing quiet zone, a wrong rotation or a printer configured at a different DPI can have the same symptom. Verify the actual printed dimensions instead of judging only the browser preview.
If the printer reports an invalid command, check firmware support for ^BQ and confirm that the format starts with ^XA and ends with ^XZ. Keep a known-good short URL as a control sample, then add the production data once the geometry is confirmed.
Frequently asked questions
Which ZPL command creates a QR code?
Use ^BQ. It defines the QR symbol and works with ^FD for the encoded data.
What does ^BQN,2,6 mean?
N is the normal orientation, 2 selects QR model 2 and 6 is the magnification factor in printer dots.
Can a QR code contain a URL or plain text?
Yes. Put the payload after the LA prefix in ^FD, keep it concise and test the exact value that production will print.
Why does my ZPL QR code not scan?
Check physical size, quiet zone, contrast, DPI, rotation and data length. Print a sample on the target stock and test it with more than one scanner.
Related guides
Official references
References checked on 4 October 2026. AI-generated illustration of a generic thermal printer.
About the author
Eduard Diaz
Eduard Diaz is an IT technician (development) at S-IE, an official Zebra partner with more than 20 years providing identification and labelling services. He builds and maintains EditorZPL to make working with ZPL and Zebra label printers easier.
s-ie.cat