Image to ZPL (^GFA) Converter
Convert a logo or image to a Zebra ZPL ^GFA graphic command, right in your browser. The image is converted to a 1-bit monochrome bitmap, packed into bytes, and emitted as the hex ^GFA field you paste straight into a ZPL label. Runs locally — nothing is uploaded.
How to convert an image to ZPL
Drop a logo or image onto the drop zone above (or click to browse). Pick the max width in dots for your label — 203 dpi is the standard Zebra desktop resolution — and drag the threshold slider until the black-and-white preview looks clean. The tool scales the image, converts it to a 1-bit monochrome bitmap, packs the pixels into bytes, and builds a ^GFA graphic command wrapped in a minimal ^XA…^XZ label. Click Copy or Download .zpl and send it to your printer.
What is ^GFA?
^GFA is the ZPL Graphic Field command — it draws a bitmap directly on a label. The syntax is:
^GFA,<totalBytes>,<totalBytes>,<bytesPerRow>,<hexData>
The A means the bitmap is sent as ASCII hexadecimal. The first number is the count of bytes actually transmitted, the second is the total number of bytes in the graphic, and the third is the number of bytes per row. The data is the bitmap itself: one bit per pixel, packed 8 pixels to a byte, most-significant-bit first, where a 1 bit prints black. Each row is padded out to a whole byte, so bytesPerRow = ceil(width / 8) and totalBytes = bytesPerRow × height. This tool computes all three numbers and the hex for you, and shows exactly what will print.
Why won't my base64 logo print?
A common mistake is trying to paste a data:image/png;base64,… data URI into a label. ZPL does not understand base64 data URIs. Graphics must be sent as a ^GFA field (hex or the compressed ACS format) or downloaded to the printer as a stored image — this tool converts a real image into that ^GFA field for you. Two other things matter: the graphic must be true monochrome (a color or grayscale logo has to be reduced to black and white with the threshold), and the width in dots has to match your label — get the bytes-per-row wrong and the image shears or turns to noise.
Print width and DPI
Label dimensions in ZPL are measured in dots, and dots = inches × dpi. Most Zebra desktop and industrial printers are 203 dpi, so a 2-inch-wide graphic is about 384–406 dots and a full 4-inch label is about 812 dots. Higher-resolution 300 dpi printers use proportionally more dots for the same physical size (2 inches ≈ 600 dots). Set the max width to no more than your label's printable width in dots; the tool preserves the aspect ratio and rounds the height.
Is this private?
Yes. The image is read and converted entirely in your browser on an HTML <canvas> — it is never uploaded to any server. You can confirm in DevTools → Network: converting fires no request. That makes it safe for confidential warehouse, logistics, and pharmaceutical label artwork.
Frequently asked questions
How do I convert an image or PNG to ZPL?
Drop the image onto the converter above. It scales the image to your chosen width in dots, converts it to a 1-bit monochrome bitmap using a luminance threshold, packs 8 pixels per byte, and emits ^GFA,<totalBytes>,<totalBytes>,<bytesPerRow>,<hexData> wrapped in a minimal ^XA…^XZ label you can send straight to a Zebra printer.
What is the ^GFA command?
^GFA is the ZPL Graphic Field command that draws a bitmap. Its parameters are ^GFA,a,b,c,data where a is the total bytes sent, b is the total bytes in the graphic, c is the bytes per row, and data is the bitmap. The A option means ASCII hex — two hex characters per byte, MSB first, one bit per pixel, 1 = black.
Why is my logo not printing or printing garbled?
ZPL graphics are 1-bit monochrome, so a color or grayscale logo must be reduced to pure black and white first — adjust the threshold until the preview is clean. Garbled or skewed output almost always means the bytes-per-row value is wrong: each row must be padded to a whole byte, so bytesPerRow = ceil(width / 8). This tool computes that for you.
What DPI/width should I use?
Dots = inches × dpi. Most Zebra printers are 203 dpi, so a 2-inch graphic is ~384–406 dots and a 4-inch label is ~812 dots. Set the max width to no more than your label width in dots; 300 dpi printers use proportionally more dots for the same physical size.
Does this upload my image?
No. Everything runs locally on a canvas in your browser — nothing is uploaded. You can verify in DevTools → Network that converting fires no request.
Need plain Base64 encode/decode?
The main base64.dev tool handles text, files, and URL-safe mode with auto-detect.
Open base64.dev →