Skip to content

How to print ZPL from a .txt file

Marketplaces and shipping platforms often deliver labels as ZPL code inside a .txt file. You have three reliable ways to print it: convert to PDF and print anywhere, send the raw ZPL to a thermal printer over the network, or pass it through a generic printer driver. Pick based on the printer you have.

Option 1: Convert to PDF (works with any printer)

Section titled “Option 1: Convert to PDF (works with any printer)”

Best when you don’t have a thermal printer, or just want the simplest path:

  1. Open the .txt file in a text editor and copy everything (it starts with ^XA).
  2. Paste it into the free ZPL to PDF converter and download the PDF.
  3. Print the PDF at 100% scale (“actual size”) — on a thermal printer with 4×6 in stock, or on a regular printer and trim.

Printing at reduced scale can make barcodes too small to scan — always use actual size.

Option 2: Send raw ZPL over the network (thermal printers)

Section titled “Option 2: Send raw ZPL over the network (thermal printers)”

Most ZPL-capable thermal printers accept raw print jobs on TCP port 9100:

Terminal window
# macOS / Linux
cat label.txt | nc 192.168.1.50 9100
Terminal window
# Windows PowerShell
Get-Content label.txt -Raw | ForEach-Object {
$client = New-Object Net.Sockets.TcpClient("192.168.1.50", 9100)
$writer = New-Object IO.StreamWriter($client.GetStream())
$writer.Write($_); $writer.Flush(); $writer.Close(); $client.Close()
}

Replace 192.168.1.50 with your printer’s IP (printable from most printers’ feed-button menu).

Option 3: Generic / text-only driver (Windows + USB)

Section titled “Option 3: Generic / text-only driver (Windows + USB)”

For a USB-connected thermal printer on Windows, install the printer with the built-in Generic / Text Only driver, then print the .txt file to it — the driver passes the ZPL through untouched instead of rasterizing it.

Not sure the file is intact? Paste it into the ZPL viewer before printing — it renders exactly what will come out of the printer.