Table of Contents
- What Is ZPL?
- Why I Built a Visual Front End for a Text Language
- How ZPL Works: The Core Commands
- Using the Generator, Step by Step
- Three Real Label Examples
- Who Uses ZPL?
- Tips for Best Results
- Common Mistakes to Avoid
- Frequently Asked Questions
- Ready to Print?
What Is ZPL?
ZPL (Zebra Programming Language) is a small text-based language used to tell Zebra thermal printers what to print. Zebra Technologies created it, and it is the native command set for nearly every Zebra label printer ever sold, from the desktop GK420 to the industrial ZT411. Brother, TSC, Honeywell, and other thermal printer makers also support ZPL on most of their industrial models.
A ZPL file is just plain text. It looks like this:
^XA ^FO50,50^BY3,2.0,100^BCN,100,Y,N,N^FDABC-1234^FS ^FO50,200^A0N,40,40^FDHello World^FS ^XZ
Each line is one instruction. The printer reads them in order, lays out the label, and prints it. No drag-and-drop, no preview window, no graphic designer, just text the printer understands. That sounds old-fashioned, but it is exactly why ZPL is still everywhere: it is fast, predictable, tiny, and it works the same way on a 1995 printer and a 2025 one.
If you have ever shipped a box, scanned a wristband in a hospital, or checked a price tag at a store, the label was almost certainly printed with ZPL.
Why I Built a Visual Front End for a Text Language
Writing ZPL by hand is painful. You need the command names, the parameter order, the field origin coordinates, and the barcode type codes in your head at the same time. One wrong comma and the label prints blank, or the printer beeps and flashes an error.
So I built the free ZPL generator to write the code for you. You design the label visually and the tool outputs clean, well-formatted ZPL II that any Zebra printer accepts. It supports Code 128, EAN-13, UPC-A, Code 39, QR code, Data Matrix, and PDF417, and a live preview matches what the printer will output, dot for dot.
You can drag text, barcodes, lines, boxes, and images onto the canvas, export ZPL text plus PNG previews and a print-ready PDF, and pick common label sizes (4×6 inch, 4×4, 2×1, wristband, and more). Everything runs in the browser with no sign-up and no install. The output is compatible with Zebra ZT411, ZT230, GK420, ZD420, ZD621, and any printer that supports ZPL II.
How ZPL Works: The Core Commands
ZPL is built from commands that start with the caret (^) or tilde (~) character. The most important ones:
^XA: start of label format. Every label begins here.^XZ: end of label format. The printer only prints when it sees^XZ.^FO<x>,<y>: Field Origin. Sets the X and Y position (in dots) of the next element.^FD<data>: Field Data. The text or barcode value to print.^FS: Field Separator. Ends one field and starts the next.^A<font>N,<height>,<width>: Font.Nmeans normal orientation; height and width are in dots.^BY<width>,<ratio>,<height>: Barcode default. Sets module width, narrow-to-wide ratio, and bar height for the barcode that follows.^BCN,<height>,...: Code 128 barcode. Others use^BE(EAN-13),^BU(UPC-A),^BQ(QR code),^BX(Data Matrix).^GB<w>,<h>,<t>: Graphic Box. Draws a rectangle with a given thickness.
Take the four-line snippet at the start of this guide. Here is what each part does:
^XAstarts the label.^FO50,50moves to position X=50, Y=50 dots.^BY3,2.0,100sets barcode defaults: module width 3, ratio 2.0, height 100 dots.^BCN,100,Y,N,Ndraws a Code 128 barcode, normal orientation, height 100 dots, with human-readable text below (Y), no check digit printed above, no UCC check digit.^FDABC-1234is the data inside the barcode.^FSends the field.^FO50,200moves below the barcode.^A0N,40,40selects font 0 (the built-in scalable font), normal orientation, 40 dots tall and wide.^FDHello Worldis the text to print.^FSends the text field.^XZends the label and prints.
The whole label is 12 lines of text and the printer renders it in under a second. No PDF, no image file, no driver overhead, just the raw ZPL string sent over USB, network, or Bluetooth.
Using the Generator, Step by Step
- Open the tool: go to /zpl-generator/ in your browser. You see a blank label canvas and a components panel.
- Pick a label size: choose a common size (4×6 inch shipping label, 4×4, 2×1, wristband, and others) or set a custom width and height in millimeters or inches.
- Add a barcode: drag the Barcode component onto the canvas. Pick a symbology (Code 128 for shipping, EAN-13 for retail, QR code for marketing, Data Matrix for pharma). Type the data.
- Add text: drag a Text block and type your title, address, or human-readable copy. Set the font, size, and orientation.
- Add shapes: drag a Box or Line for borders and dividers, useful for SSCC-18 pallet labels with a "peel here" box.
- Add images: upload a logo (PNG, JPG, or BMP) and the tool converts it to ZPL graphic format automatically.
- Preview: click Render. The preview shows what the printer will output, dot for dot.
- Export ZPL: click Download ZPL and save the text file. Send it to the printer over USB, network (TCP 9100), or Bluetooth, and the label prints instantly.
- Save the template: the tool saves your design as a JSON file, so you can reopen it later and make variations without starting over.
Need 500 labels in one go? Bulk mode accepts a CSV file (one row per label) and merges each row into the template, producing 500 ZPL strings to send as a batch.
Three Real Label Examples
A 4×6 shipping label with Code 128
^XA ^FO50,50^BY3,2.0,100^BCN,100,Y,N,N^FD1234567890^FS ^FO50,200^A0N,40,40^FDShip To: John Smith^FS ^FO50,250^A0N,30,30^FD123 Main Street, Anytown, USA^FS ^XZ
This prints a 100-dot-tall Code 128 barcode at the top and two lines of address text below, sized for a standard 4×6 inch thermal label.
A 2×1 retail price tag with UPC-A
^XA ^FO20,30^A0N,30,30^FDT-Shirt - Blue, M^FS ^FO20,80^BY2,2.0,80^BUN,80,Y,Y,Y^FD012345678905^FS ^FO20,200^A0N,40,40^FD$14.99^FS ^XZ
Product name, UPC-A barcode, price. The ^BU command tells the printer to render the UPC-A symbology.
A wristband for patient ID with QR code
^XA ^FO30,30^A0N,30,30^FDPatient: J. Doe^FS ^FO30,80^A0N,25,25^FDMRN: 0042156^FS ^FO30,150^BQN,2,6^FDQA,P0042156^FS ^XZ
The ^BQ command renders a QR code, and the FDQA, prefix marks the field as alphanumeric mode. The wristband scans at the bedside and links the patient to the electronic medical record.
Three different labels, one small set of commands. That is the strength of ZPL: a single tool can output every kind of label a business needs.
Who Uses ZPL?
- Logistics: every major carrier (UPS, FedEx, DHL, USPS, regional LTL carriers) accepts ZPL shipping labels. The label on the box at your door was almost certainly a ZPL file sent to a thermal printer at the shipper's dock.
- Retail: shelf-edge price tags, markdown labels, and back-room bin labels, usually from Zebra desktop printers (ZD420, ZD621).
- Manufacturing: work-in-process, batch, and quality-control labels printed on demand at the factory floor.
- Healthcare: patient wristbands, specimen labels, and medication labels, typically on a Zebra HC100 or ZD420R.
- Warehousing: SSCC-18 pallet labels, bin labels, and put-away slips at 3PL operations.
- Apparel: care labels, hang tags, and size stickers.
- Food and beverage: ingredient, batch, and best-by labels on inline thermal printers at bottling lines and bakeries.
If a business prints more than a few dozen labels a day, the printer in the back room is almost certainly a Zebra running ZPL.
Tips for Best Results
- Print at the printer's native DPI. A 203 DPI printer (ZT230, GK420) wants 203-dot-per-inch measurements; a 300 DPI printer (ZT411, ZD621) wants 300. Mixing them up makes labels fuzzy. Our tool sets the right DPI when you pick a printer model.
- Always include
^XAand^XZ. Without them the printer treats the data as garbage. It starts on^XAand only ejects on^XZ. - Use
^PQ<n>for quantity. To print 50 copies, add^PQ50before^XZinstead of sending the same ZPL 50 times. - Leave a quiet zone. Barcodes need at least 10 dots of empty space on each side, and ZPL does not enforce it. Design it in.
- Test on the actual printer. A 4×6 label behaves differently from a 2×1. Print one test label before the batch of 500.
- Use
~PSfor a status request. Before a big run, send~PSover the network; the printer replies with status (ready, paused, label out) so you avoid pile-ups. - Keep font 0 for crisp text. Zebra's built-in scalable font prints cleaner than bitmap fonts on most printers. Use it unless you need a specific corporate typeface.
- Save your template. The same template can print 5,000 different shipping labels if you change only the
^FDvalues. Save it and re-merge for every batch.
Common Mistakes to Avoid
- Forgetting
^FS. Every field needs a Field Separator. Miss one and the printer merges two fields and prints nothing useful. - Wrong DPI. Designing at 300 DPI and printing on a 203 DPI printer makes everything oversized; the reverse makes labels tiny.
- Barcodes off the edge. A
^FOvalue that places the barcode past the label boundary clips it. Check the preview first. - Sending ZPL to a non-Zebra driver. If Windows prints ZPL through the standard text driver, nothing happens. Add the printer as a raw ZPL device (Generic / Text Only, or Zebra's official driver).
- Using lowercase commands. ZPL is case-sensitive:
^xadoes nothing,^XAworks. - Forgetting the
^FDdata. A barcode command without^FDprints an empty barcode that scans as nothing. - Image too large. Converting a 4-megapixel logo to ZPL graphic format produces a string that takes the printer 30 seconds to process. Resize logos to print size first.
- Not testing QR codes. A QR code that looks fine in preview may be too small to scan. The GS1 standard calls for at least 20×20 mm on packaging. Verify with a real phone before printing 5,000.
Frequently Asked Questions
What does ZPL stand for?
ZPL stands for Zebra Programming Language, the native text command set Zebra thermal printers use to render labels. ZPL II is the current version, supported by virtually every Zebra printer sold in the last 25 years.
Do I need to write code to use a Zebra printer?
No. With our ZPL generator, you design the label on a visual canvas and the tool writes the ZPL. Zebra's free ZebraDesigner software is another option. Hand-writing ZPL is only necessary for developers integrating printers into custom apps.
Can I send ZPL to a printer over the network?
Yes. Open a raw TCP connection to the printer on port 9100 and send the ZPL string. Most Zebra printers also accept ZPL over USB, Bluetooth, and serial connections, and the ZPL is identical regardless of connection type.
What is the difference between ZPL and ZPL II?
ZPL II is the modern version, supported on every printer Zebra has shipped for decades. It added a few commands and removed some obsolete ones. In practice, "ZPL" today means ZPL II.
Will ZPL work on non-Zebra printers?
Often yes. TSC, Honeywell, SATO, and Brother ship models that accept ZPL for compatibility, though label quality and command support vary by model. With a mixed fleet, test the ZPL on each model before deploying.
How do I preview ZPL without printing it?
Our ZPL generator has a built-in preview that renders the ZPL exactly as the printer would. Free online viewers like Labelary render ZPL in the browser too. Both catch layout mistakes before a print run.
Ready to Print?
You now know what ZPL is, how the core commands fit together, why it runs the thermal label world, and which mistakes waste labels. The next step is to design one and print it.
Open our ZPL generator, drag a barcode and some text onto the canvas, and download clean ZPL II code in seconds. To make SSCC-18 pallet labels and send them straight to a Zebra, pair it with our SSCC-18 generator. To encode GS1 Digital Link QR codes for retail packaging, visit our GS1 Digital Link tool. And to verify that a printed label meets ISO quality standards before you ship, run it through our barcode verifier.



