ZPL Viewer

Paste ZPL code or open a .zpl file to see each Zebra label as it will print, at 152 to 600 dpi, and save it as a PNG or PDF, without sending the ZPL anywhere.

How to view a ZPL file

  1. Paste or open the ZPL

    Paste ZPL code into the ZPL box, press Open file, or drop a .zpl, .txt, .prn or .lbl file anywhere on the page. You can open several files at once. The box starts with a sample shipping label, Samples holds it and two more labels to try, and Clear empties the box.

  2. Match the printer

    Under Print density, choose the printer the label is for: 6 dpmm (152 dpi), 8 dpmm (203 dpi), 12 dpmm (300 dpi) or 24 dpmm (600 dpi). Under Label size, choose the label stock, such as 4 × 6 in.

  3. Check the label

    The Label preview is drawn again a moment after you stop typing. The line under it gives the number of labels and their size in dots, any command the viewer did not draw, and the number of copies the ZPL asks for.

  4. Save it

    Press Download PNG for the label in view, Download PDF for every label at its real size, Download all PNGs (ZIP), or Copy picture. In Chrome, Edge and other Chromium browsers on a computer, Print sends the labels to the browser's print dialog.

What a ZPL file holds, and how to print one with or without a Zebra printer: What is a ZPL file?

Print density: 152, 203, 300 or 600 dpi

ZPL places everything in printer dots, not in inches. Zebra printheads print 6, 8, 12 or 24 dots per millimeter (dpmm), which Zebra's programming guide converts as 152.4, 203.2, 304.8 and 609.6 dots per inch; Zebra's own tables name them 203, 300 and 600 dpi printheads. So the same ZPL prints at a different size on another printer. Zebra's guide gives the example of a line 100 dots long: half an inch on a 200 dpi printer, a third of an inch on a 300 dpi one.

Choose the density of the printer the label was written for. The viewer starts at 8 dpmm (203 dpi) and remembers your choice on this device. If you do not know your printer's density, Zebra's guide says it is listed on the printer's configuration label.

Label size, and the size set in the ZPL

Under Label size, pick the stock the label prints on: 4 × 6 in, 4 × 4 in, 4 × 3 in, 4 × 2 in, 3 × 2 in, 2.25 × 1.25 in, 2 × 1 in or 100 × 150 mm, or Custom with a width and height in inches or millimeters. The preview draws the whole stock with its edge, so you can see whether every field fits on it. A 4 × 6 in label at 8 dpmm is 813 × 1220 dots here: 101.6 by 152.4 mm times 8 dots, rounded up to whole dots. Rotate 90° turns the finished label, and the PNG and PDF with it.

Many labels set their own size: ^PW sets the print width in dots and ^LL the label length. When the first label in the ZPL has both, a button under the preview offers to use them. For a label with ^PW812 and ^LL406 at 8 dpmm it reads Use the size in the ZPL (812 × 406 dots: 4 × 2 in at 8 dpmm). A label written for a 203 dpi printer looks smaller at 300 dpi and leaves space at the right and bottom, as it would on a 300 dpi printer.

Several labels in one file, and copies

A ZPL file can hold many labels. Each one starts with ^XA and ends with ^XZ, and the preview draws them in order, each headed "Label 2 of 5" and so on. For a file with more than 50 labels, the preview draws the first 50 and says so ("Showing the first 50 of 120 labels."), and the PDF and the ZIP hold every label.

The labels drawn at one time may hold up to 80 million dots in all. On 4 × 6 in stock that is 143 labels at 6 dpmm, 80 at 8 dpmm, 35 at 12 dpmm and 8 at 24 dpmm. Past that, the PDF and the ZIP are not made, and at 12 or 24 dpmm the preview is not drawn either: the message "This input is too large. Use up to 5 MB of ZPL and a smaller label or batch." appears instead.

^PQ tells the printer how many copies of a label to print. The viewer draws the label once, and the line under the preview says "Prints 3 copies". A label whose copies differ, such as one that counts up a serial number with ^SN, is drawn once for each copy.

ZPL to PNG: save the label as a picture

Download PNG saves the label in view as a black-and-white PNG with one pixel for each printer dot. The file records the print density, so programs that read it know its size in inches. If you choose Smooth (for the screen) under Edges instead of Whole dots (as printed), the PNG has gray edges.

Download all PNGs (ZIP) saves every label as its own PNG in one ZIP file, named label-01.png, label-02.png and so on. Copy picture puts the label in view on your clipboard, to paste into an email or a document; if your browser does not allow that, a message says to download the PNG instead.

What the viewer draws

The viewer draws text in font 0 and the bitmap fonts A to H, in all four directions or wrapped in blocks; boxes, circles, ellipses and diagonal lines; pictures sent with ^GF, ~DG or ~DY; reverse printing and stored formats; and barcodes including Code 128, Code 39, EAN-13, UPC-A, QR codes, Data Matrix, PDF417, MaxiCode and GS1 DataBar.

Commands that set up the printer rather than the label, such as print speed and darkness, change nothing in the picture. The line under the preview lists them, and any command the viewer does not know, as not drawn, with how many times each appears: for example "Not drawn: ^HH (1), ^MM (1)". What the viewer does not draw has the details.

A ZPL viewer, not a virtual printer

The viewer shows what a label will look like. It does not act as a printer on your network, so a program cannot send print jobs to it. If the program can save its label as a file, open that file here. If it shows the ZPL on screen, copy the code and paste it into the box.

Base64 ZPL

If you have a label as base64 text (a block of letters, digits, plus signs and slashes with no ^ in it), paste it into the box or open it as a file. When the text decodes to ZPL that contains ^XA, the viewer decodes it and the line under the preview says "Decoded the label from base64."

Your ZPL stays on your device

Shipping and product labels carry names, addresses and order numbers. Many online ZPL viewers draw a label by sending its code to a server: Labelary's online viewer, for example, draws labels through its web API at api.labelary.com, so the ZPL you type into it is sent to that server. This viewer draws the label in your browser, on your own device, and once the page has loaded it works with no internet connection.

You can check this yourself. Open your browser's developer tools and watch the Network tab while you type a label or open a file: no request carries the ZPL, the text of a field, a barcode's data or the file name. The only requests to another server are visit counts for Google Analytics. There is no session recording on this site. How to check that nothing is sent has the steps.

Frequently asked questions

Is this ZPL viewer free?

Yes. There is no charge, no account and no watermark on the PNG or PDF.

How do I view a ZPL file?

Open it on this page with Open file, drop it on the page, or paste its text into the ZPL box. Then set the print density and label size of the printer it is for, and the label appears in the preview.

How can I view ZPL without a Zebra printer?

Use this page. It draws the label from the same ZPL the printer would receive, at the density you choose, and saves it as a PNG or PDF. Nothing is installed and no printer is needed.

Is my ZPL uploaded or saved?

No. The label is drawn in your browser and the ZPL never leaves your device. Nothing you type or open is stored either, so copy your changes before you close the page. The site counts visits with Google Analytics, which never receives your ZPL, your file names or anything in a label, and it has no session recording.

Does it work on a Mac?

Yes. The viewer runs in the browser, so it works on a Mac as on Windows, with nothing to install. Its page tests pass in Chrome, Firefox and WebKit, the engine of Safari. To print a label from a Mac, see printing ZPL on a Mac.

Why is my label cut off or too small?

The print density or the label size does not match the printer the ZPL was written for. ZPL places everything in dots, so a label made for 300 dpi is too large at 203 dpi, and one made for 203 dpi is too small at 300 dpi. Try the other densities, and use the size in the ZPL when the viewer offers it.

Can I edit the label here?

Yes. The ZPL box is a text editor: change a value and the label is drawn again a moment after you stop typing. The ZPL examples explain the common commands, and ZPL fonts the font sizes.

Will the label look exactly like my printed label?

Positions, sizes, lines, pictures and barcode bars follow Zebra's programming guide. Zebra's fonts are licensed, so open fonts with the same character widths stand in for them: text takes the same space as on the printer, but the letters look slightly different. How it works describes how the pictures were checked and what the viewer draws differently.

Which files can it open?

Files ending in .zpl, .txt, .prn or .lbl, in UTF-8 or Windows-1252 text, and ZPL pasted as text or as base64. A file with no label in it gets the message "No label found. Start a label with ^XA." and a file with another ending gets "Choose a .zpl, .txt, .prn, or .lbl file."