Paste or choose the file.Quotes, escaped quotes and Excel's UTF-8 marker are handled.
FREE TOOL / NO SIGNUP / RUNS IN YOUR BROWSER
CSV to ZPL. One label per row.
Paste a spreadsheet and get Zebra label code back, with text and a Code 128 barcode, sized in dots for your printer. Your file never leaves the browser.
more rows in this file. The free converter writes the first 3 labels. LabelInn prints the whole file from a visual design, straight to your Zebra, TSC or Toshiba printer — no driver, no ZPL to maintain.
Print all rows with LabelInn →Your file is read and converted in your browser. Nothing is sent to LabelInn or anyone else.
THE WHOLE PATH
From CSV row to label to printer
What the tool wrote for the sample above, and a script that sends it.
The converter writes one ZPL label per row. These are the first three rows of the sample CSV and the labels the tool wrote for them at 50 x 25 mm, 203 dpi, drawn here by the same layout interpreter as the ZPL viewer. Text uses a stand-in font; barcode modules are exact.
| sku | name | price |
|---|---|---|
| A-1001 | Steel bracket | 4.90 |
| A-1002 | Wall anchor 8mm | 0.35 |
| A-1003 | Hinge 60mm | 2.10 |
| A-1004 | Cable tie 200mm | 0.08 |
| A-1005 | Corner brace | 1.75 |
Rows 4 and 5 are in the CSV, but the free converter stops at three labels.
To print, send the ZPL to the printer as raw bytes. This script reads the template from box 03, fills it for every row of your CSV with the same escaping the tool uses (_, ^ and ~ become hex), and writes the result to the printer’s port 9100.
- Run here against a local listener: 5 labels, 714 bytes arrived.
- The first three labels are byte-identical to the tool’s output.
- Not run on a physical Zebra. The printer must be on your network; a USB printer has no port 9100.
import csv, re, socket
# The template from box 03 of the converter above, saved as template.zpl
template = open("template.zpl", encoding="utf-8").read().strip()
def value(v): # the same escaping the converter uses
return v.replace("_", "_5F").replace("^", "_5E").replace("~", "_7E")
with open("products.csv", newline="", encoding="utf-8-sig") as f:
rows = list(csv.DictReader(f))
zpl = "\n".join(
re.sub(r"\{\{([^}]+)\}\}", lambda m: value(row[m.group(1).strip()]), template)
for row in rows
)
with socket.create_connection(("192.168.1.50", 9100), timeout=5) as s:
s.sendall(zpl.encode("utf-8"))
print(len(rows), "labels,", len(zpl.encode("utf-8")), "bytes sent")$ python csv-to-printer.py
5 labels, 714 bytes sent
listener: 714 bytes, first 3 hex 5e5841 (^XA), last 3 hex 5e585a (^XZ)
labels received: 5
first 3 identical to the tool output: TrueOther ways to deliver the file, with the commands: send ZPL to a Zebra printer. From a server or a USB printer: the Zebra printer API.
01 / HOW IT WORKS
From spreadsheet to label code
Comma, semicolon and tab separated files are detected automatically.
Set size and resolution.The template is laid out in printer dots: 50 × 25 mm at 203 dpi is 400 × 200.
Edit the template.Every {{column}} is replaced with that row's value.
Copy and send.Check it in the ZPL inspector, then send it to the printer.
02 / SAFE OUTPUT
What the template does
^CI28switches the printer to UTF-8, and every value is written with^FHhex escapes, so a^or~in your data cannot end a field or start a command.^PWand^LLset print width and label length in dots, so the label does not depend on whatever the printer was last set to.- The barcode is Code 128 with the human-readable line underneath.
03 / BEYOND THREE ROWS
When a converter stops being enough
Generating ZPL is the easy part. Keeping it working is not: the layout lives in a text template, a TSC printer needs TSPL instead, and someone still has to send the file and check it printed. In LabelInn the CSV columns bind to a label you design visually, every row prints, and the same design runs on Zebra, TSC, Toshiba and Epson printers. See printing labels from CSV and, to stop handling files by hand, hot folder printing.
THE PROBLEM, THEN THE FIX
Your CSV is ready, but the printer wants a label
You should not have to hand-write printer code for every row.
The problemA spreadsheet of data and a printer that only understands its own language.
1Point the label at your dataUpload an Excel or CSV file, or fetch from a database.
2Pick a column for each fieldChoose the column from the field data-source dropdown. The mapping is saved with the design.
3Check the real rowsThe sheet and its header row are shown before anything prints.
4Preview, then printCheck the real label, choose the printer and the number of copies, and print.
The fixDesign the label, map the columns, print. LabelInn produces the printer language for you.Get LabelInn free
WORKED EXAMPLE
The sample CSV, converted and rendered
The converter was run on the 8-product sample file at 60 x 40 mm, 203 dpi. This is the ZPL it wrote for row 1, and how an independent ZPL renderer draws it.
^XA
^CI28
^PW480
^LL320
^FO20,20^A0N,25,25^FH^FDCrème brûlée mix 250 g^FS
^FO20,49^A0N,25,25^FH^FD4.90^FS
^FO20,78^A0N,25,25^FH^FD5901234123457^FS
^FO20,107^A0N,25,25^FH^FDL2610-A^FS
^FO20,136^A0N,25,25^FH^FD2027-03-31^FS
^FO20,188^BY2^BCN,92,Y,N,N^FH^FD00417^FS
^XZ
^CI28. The dash spacing is how Labelary draws that font, not a property of your printer.Things worth noticing in the output: ^PW480 and ^LL320 are 60 mm and 40 mm at 203 dpi; every value sits in ^FH^FD...^FS, so a ^ or ~ in your data is hex-escaped and cannot start a command; the barcode encodes the first column (SKU) and the other columns are printed as text lines. If you want a different layout, edit the template in the tool: {{Product}} style placeholders are replaced per row.
BEFORE YOU SEND IT
What a converter cannot know
- It cannot check that your printer has a font with the characters you used.
^CI28switches to UTF-8, but the glyph must exist in the printer font. - It writes dots for the size you typed. If the printer is set to another label length, set
^LLto match or calibrate the printer first. - Long text is not shrunk or wrapped. A product name wider than the label runs off the edge; the sample row 3 ("Oat bar, honey (6 pack)") fits at 25 dots on 60 mm, a longer name would not.
- It does not talk to the printer. Send the file with the commands on how to send ZPL to a Zebra printer, or check it first in the ZPL viewer.
QUESTIONS / FAQ
Frequently asked questions
How do I convert a CSV file to ZPL?
Paste the CSV or choose the file, set the label size and printer resolution, and the converter writes one ZPL label per row using a template with a {{column}} placeholder for each column. Edit the template to change the layout.
Is my CSV uploaded anywhere?
No. The file is read and converted in your browser.
Why does the converter only produce three labels?
The free converter shows the first three rows so you can check the layout. LabelInn prints the whole file, binds columns to a visual design, and sends it to the printer without a driver.
Will special characters print correctly?
The template sets UTF-8 (^CI28) and writes values with ^FH hex escapes, so characters such as ^ and ~ in your data cannot break the label. Printing accented or non-Latin text also needs a printer font that contains those characters.
How do I convert a CSV to ZPL without installing anything?
Paste the CSV or choose the file in the tool on this page, set the label size and dpi, and copy or download the ZPL. The first three rows are free in the browser; the whole file prints from LabelInn.
Which CSV formats does the converter accept?
Comma, semicolon or tab separated text, with or without a header row, quoted fields, and a UTF-8 byte order mark. The same rules LabelInn uses when it imports a CSV.
KEEP GOING
Related
PRINT EVERY ROW
Connect the CSV to a design instead of a template
The converter is free. Printing a whole file from a visual design is where the plans start.
In LabelInn the columns of a CSV or Excel file bind to a label you design visually. Every row prints, with its own copy count, on a Zebra, TSC, Toshiba or Epson printer, with no ZPL to maintain. The video shows the three ways in: a file, a Google Sheet or a database.
- Free: bind a file and print up to 3 runs of 10 rows to try it.
- Starter: Excel and CSV data binding for every run.
- Pro: also database sources, watched folders and the production API.
Video: connect Excel, CSV, Google Sheets and databases to labels.
FREE
$0
- Design and print labels by hand, with no label limit
- This converter: first 3 labels in the browser, free forever
- Try CSV or Excel binding: 3 runs of up to 10 rows
STARTER
$7.99 / month
- Everything in Free
- Excel and CSV data binding for every run, all rows
- Workflows and automations
PRO
$24.90 / month
- Everything in Starter
- Database sources, watched folder, webhooks
- The production API: 2,000 calls a day
A signed-in Free user can start a 14-day trial by hand from the dashboard banner or the app’s paywall (no card): it unlocks Excel and CSV binding, bulk barcodes and the production API. It does not start by itself at signup. Yearly billing is ten months for twelve ($79.90 Starter, $249.00 Pro). All plans and limits: pricing.
NEXT STEP / LABELINN
Print every row, not just three.
CSV and Excel columns bound to a visual design · Zebra, TSC, Toshiba, Epson — no driver · Free plan, no card