ZPL Pallet Label Generator
Lays out a 4 x 6 in pallet label in ZPL II from a ship-to address, PO number, carton count, SKU list, and Pallet
Everything you enter is processed on your device. This tool loads a code library from cdnjs.cloudflare.com, which sees your IP address but never what you type.
Documentation
A ZPL pallet label generator turns the details that identify one shipping pallet (where it goes, who sent it, the purchase order it fills, what it holds, and where it falls in the load) into ZPL II commands for a Zebra-compatible thermal printer, and draws the result at one pixel per printer dot. On 4 x 6 in stock at 203 dpi that grid is 812 x 1218 dots, and every height, gap, and margin on the label is measured in those dots.
- Ship to: the receiving distribution center's name or number, its street address, and the department the order was written for, stacked as one address block under the heading.
- From: the shipper's name as it appears on the paperwork that travels with the load.
- PO#: the purchase order the pallet fills, set at 100 dots, about half an inch, so it reads from a forklift seat. Some retailers open the PO number with a short prefix that identifies the destination DC; the digits after it are the order's own number.
- Carton count and SKU list: how many cartons the pallet holds and which item numbers are on it, enough for a receiver to check the pallet against the order before it is broken down.
- Pallet # of total: the pallet's place in the load. A four-pallet shipment reads Pallet # 1 OF 4 through 4 OF 4, so a pallet left behind shows at the dock rather than at the next inventory count.
- Reference line: a shipment, load, or seal number that ties the pallet to its bill of lading.
Each line has a height in dots, and its row pitch is that height times the line spacing, rounded: at the default spacing of 1.2, a 42-dot address line advances 50 dots and the 100-dot PO line advances 120. Space above adds a fixed number of dots before a line, which is what separates the address block, the PO number, the carton count, the SKU list, and the pallet number into visual groups. Lines are centered across the usable width of 788 dots, the label less a 12-dot margin on each side, and the whole stack is centered top to bottom as one block.
Heights are counted in dots rather than inches, so the printer's density sets their physical size. At 300 dpi the same label becomes 1200 x 1800 dots and the 100-dot PO line prints a third of an inch tall instead of half an inch; raise the heights by about half when moving a layout from a 203 dpi printer to a 300 dpi one.
A line wider than 788 dots takes as many extra rows as it needs and no more, but the break points are chosen rather than taken first-fit. Every candidate break is priced. A break after a comma, after the street type of an address that opens with a house number (Avenue, Rd, Parkway, Blvd and the like), or ahead of a short code ending in a colon costs nothing. An ordinary break between two words costs two character heights, and a break that strands a code from the name it labels, or a two-letter state from its ZIP, costs four. Each row adds its width squared over the column width, a term that is smallest when the rows come out even, and the cheapest combination wins.
So 1250 Commerce Parkway Reno, NV 89502, too wide for one row at 42 dots, splits as 1250 Commerce Parkway over Reno, NV 89502, where a first-fit wrap would leave 89502 alone on the second row, and Westgate Distribution Center #204 RNO: RENO WEST splits ahead of RNO:. A SKU list breaks only at its commas, into rows of similar width. The rows reach the printer as forced \& breaks inside one ^FB block whose line count equals the row count, so the printer breaks where the preview does instead of reflowing by its own metrics.
When the stack is taller than the label less its top and bottom margins, 1194 dots on 4 x 6 in stock, or any single word or centered line is wider than 788 dots, every height and every space above is multiplied by one common scale. The scale is found by halving the interval between 40 and 100 percent eight times, which lands within about a quarter of a percent of the largest scale that fits, and Checks states the result. Text below 40 percent of its set height stops reading at pallet distances, so the scale goes no lower and the remaining overflow is reported in dots.
{#} is Step # plus the label's position in the run counted from zero, and {total} is the number of labels, so Step # 1 with 4 labels prints 1 OF 4 through 4 OF 4 as four ^XA blocks. An empty Step # or # of labels prints a run of spaces instead, eight by default and roughly 0.8 inch on the 76-dot pallet line, for a count written in marker once the truck is loaded.
A preset sheet of approved distribution centers keeps a ship-to address from being mistyped. Each row is one combination of address, department, and PO prefix, choosing a row fills the lines it settles, and the PO#: line checks only its leading digits against the sheet. A sheet written for carton labels loads as it is; a To: opening its addresses is dropped because the label already prints Ship to:.
In the default layout at 203 dpi, the PO line is 100 dots tall at spacing 1.2, so it advances 100 x 1.2 = 120 dots. The carton count line below it carries 44 dots of space above, so its top sits 120 + 44 = 164 dots below the top of the PO line. Suppose a 28-SKU list pushes the stack past 1194 dots and the search settles at 96 percent: the PO line prints at 100 x 0.96 = 96 dots and advances 96 x 1.2 = 115.2, rounded to 115, and its 44 dots of space above become 44 x 0.96 = 42.24, rounded to 42.
The same engine renders ZPL written elsewhere, so a carrier's 4 x 6 shipping label can be proofed beside the pallet label it travels with. It draws ^FO and ^FT positions, ^A and ^CF fonts, ^FB blocks, ^GB boxes, ASCII hex ^GF graphics, ^BC Code 128 with its check character, and ^BD MaxiCode encoded per ISO/IEC 16023, along with ^FH escapes, ^FV, ^FR, ^LR, ^LH, ^PW, ^LL, ^PQ, and ^POI. A file that states no ^PW or ^LL is sized to its marks and snapped to the nearest quarter inch. Z64 and B64 compressed graphics are not decoded and stay blank in the preview, and every other command the preview cannot draw is named in Checks rather than dropped. Each label exports as ZPL with one ^XA block per pallet, as EPL carrying the same rows, as a PNG at one pixel per dot, or as a PDF page at the label's physical size.
Pallet labels identify a load at the receiving dock, where freight is sorted by destination, purchase order, and count before anyone opens a carton. These scenarios show where a pallet label built in ZPL II earns its place, from a single replacement label to a spreadsheet-driven run for a full truck.
- Retail distribution center loads: A vendor shipping to a retailer's regional DCs keeps one sheet of approved ship-to rows. Choosing the DC fills its address, department, and PO prefix together, so the only typing per load is the PO run number, the carton count, and the SKUs, and Step # 1 with 6 labels numbers a six-pallet truck in one export.
- Mixed-SKU pallets: A pallet built from a dozen item numbers lists every one of them. The list breaks at its commas into even rows, and when those rows would push the pallet number off the bottom, every line shrinks by the same small share and Checks says how much.
- Replacing one damaged label: A label torn off pallet 3 of a 4-pallet load is reprinted alone by typing the total into the line, Pallet # {#} OF 4, with Step # 3 and 1 label, so the replacement matches its siblings.
- Loads counted at the dock: When the pallet count is not known until the truck is loaded, the numbers stay blank and print as write-in gaps wide enough for a marker.
- Different contents on every pallet: Replacing the carton count and SKU list with {cartons} and {skus} lets a spreadsheet with one row per pallet print each pallet's own contents in one bulk run, while the address, From line, and PO number stay the same across the load.
- Cartons and pallets from one sheet: The cartons inside the load carry their own 4 x 2 in labels, made with the ZPL Label Generator from the same preset sheet, so the carton labels and the pallet label that summarizes them name the same DC, department, and PO.
- Mixed printer fleets: A layout tuned on a 203 dpi printer previews at 300 dpi before the first label prints there, showing how much smaller each line comes out and which heights need raising.
- Carrier label beside the pallet label: A 4 x 6 shipping label exported by a carrier system opens in the same preview, with its Code 128 and MaxiCode symbols encoded for real, so both labels on a pallet are proofed before either is printed.
Print the first label of every new layout and read it the way a receiver will, from a few feet away. The preview stands in for Zebra font 0 with a bold sans-serif, so the rows break where the preview shows but the printed glyphs come out slightly narrower or wider than drawn; confirm no row is cut at either edge and that the address and SKU list read correctly. The preview and the PNG and PDF exports simulate thermal output and say nothing about print quality: printhead wear, darkness, ribbon, and label stock decide how the text and any barcode actually print. A label carrying a barcode needs a scan with a real scanner, and a trading partner that requires a graded barcode needs a verifier reporting an ISO/IEC 15416 or 15415 grade.
Inputs, outputs, and what the ZPL Pallet Label Generator computes
What the ZPL Pallet Label Generator asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.
Inputs
- Designer (text lines) / ZPL Code (open existing file) · default: Designer (text lines)
- Step # (numeric input) · minimum: 0
- # of pallet labels (numeric input) · minimum: 1
- Or paste ZPL here (placeholders inside the delimiters keep substituting as the code changes)
- Show per-line options (height, space above, align, bold, same row) · default: off
- Write-in blank (spaces) (numeric input) · default: 8 · range: 0 to 40
- Size preset · default: 4 x 6 in (pallet)
- Width (text input) · default: 4
- Height (text input) · default: 6
- Inches / Millimeters · default: Inches
- Print density · default: 203 dpi (8 dpmm)
- Grayscale (smooth preview) / Bitonal (pure black and white, thermal simulation) · default: Grayscale (smooth preview)
- Orientation · default: Normal
- Preview font · default: Helvetica (sans-serif, closest to Zebra CG Triumvirate)
- Line spacing (numeric input) · default: 1.2 · range: 1 to 4
- Center all lines vertically as one group · default: on
- Shrink text to fit the label · default: on
- Delimiter start (text input) · default: {
- Delimiter end (text input) · default: }
- Template name (text input)
- Saved templates
- Lock inputs to preset values · default: on
- Output · default: Single ZPL file (one ^XA block per label)
- ZPL each export receives, placeholders filled in
Controls
Generate · Reset · Export Templates (JSON) · Generate Bulk · Reset View · Copy Shown ZPL · Copy ZPL
Example
In the default layout at 203 dpi, the PO line is 100 dots tall at spacing 1.2, so it advances 100 x 1.2 = 120 dots.