Free guide to ZPL barcodes. 10 symbologies, copy-paste examples, ^BY configuration and use cases for shipping, retail and pharma. No signup.
Try our free ZPL tools right now
Free, runs in your browser — Instant results
ZPL supports over 30 barcode types between 1D (linear) and 2D (two-dimensional). Each type has its own command and specific parameters. The ^BY command is essential: place it BEFORE the barcode command to define module width (bar thickness), the wide-to-narrow ratio, and default height. This guide covers the 10 most widely used types in logistics, retail, manufacturing and pharmaceuticals — with copy-ready examples optimized for shipping platforms like Amazon, eBay, Shopify, FedEx and UPS, and compatible with printers from Brother, DYMO, Rollo and Zebra.
The most widely used barcode in global logistics and shipping. Encodes all 128 ASCII characters (numbers, upper and lowercase letters, symbols). Has 3 automatic subtypes: A (uppercase + control), B (upper + lowercase) and C (numeric only, more compact). The printer selects the optimal subtype automatically.
^XA ^FO50,50^BY2 ^BCN,100,Y,N,N ^FD123ABC456^FS ^XZ
2D code that stores up to 4,296 alphanumeric characters or 7,089 digits. Supports error correction (levels H, Q, M, L) that lets the code be read even if partially damaged. The ^FD payload starts with two characters: the first is the error-correction level (H/Q/M/L) and the second is the input mode (A = automatic, M = manual segments). For most production use cases use HA, (high recovery + automatic encoding).
^XA ^FO50,50 ^BQN,2,5 ^FDHA,https://zplpdf.com^FS ^XZ
Global standard for consumer products in retail. Used throughout Europe, Asia, Latin America and international markets. Requires exactly 12 data digits (the 13th check digit is calculated automatically). The first digits identify the country of origin (000-019 = USA/Canada, 400-440 = Germany, 500-509 = UK).
^XA ^FO50,50^BY2 ^BEN,100,Y,N ^FD012345678901^FS ^XZ
The primary standard for consumer products in the United States and Canada. Required by major retailers like Amazon, Walmart, Target and Costco. Requires exactly 11 data digits (the 12th check digit is calculated automatically). The North American equivalent of EAN-13 — scanners at US retailers are tuned for this format.
^XA ^FO50,50^BY2 ^BUN,100,Y,N ^FD12345678901^FS ^XZ
One of the oldest and most widely adopted barcodes in industry. Encodes only uppercase letters (A-Z), numbers (0-9) and 7 special symbols (-, ., space, $, /, +, %). Self-checking (no mandatory checksum required). Lower density than Code 128 but compatible with virtually every scanner on the market.
^XA ^FO50,50^BY2 ^B3N,N,100,Y,N ^FDABC-123^FS ^XZ
Extremely compact 2D code capable of storing up to 2,335 alphanumeric characters in a very small area. Has built-in Reed-Solomon error correction (tolerates up to 30% damage). The quality parameter (0-200) controls the level of redundancy. Ideal for direct part marking (DPM) on metal, plastic and glass surfaces.
^XA ^FO50,50 ^BXN,5,200 ^FDSN:ABC123456^FS ^XZ
High-capacity stacked 2D code that stores up to 1,850 alphanumeric characters or 2,710 digits. Supports 9 security levels (error correction). Can encode text, numbers and binary data. The legal standard for identity documents in many countries and widely used by airlines.
^XA ^FO50,50 ^B7N,5,2,3,10,N ^FDExtensive data here^FS ^XZ
Compact 2D code that does NOT require a quiet zone (white border) around it, making it ideal for very tight spaces. Stores up to 3,832 digits or 3,067 characters. Supports configurable error correction. Magnification controls the symbol size. Commonly used in transit ticketing systems worldwide.
^XA ^FO50,50 ^BON,5,N ^FDCompact Aztec data^FS ^XZ
A variant of Code 128 that uses GS1 Application Identifiers (AI) to encode structured information such as expiration dates, lot numbers, weight and serial numbers. Activated by using the FNC1 character (>8) at the start of the data field. Mandatory in supply chains that follow the GS1 standard — required by major retailers like Walmart, Target and Amazon vendor programs.
^XA ^FO50,50^BY2 ^BCN,100,Y,N,N ^FD>801034531200000111719112510ABC123^FS ^XZ
1D barcode that encodes only numeric digits in pairs (always an even number of digits). Very compact for pure numeric data. Each pair of digits is encoded by interleaving bars and spaces, reducing the space required. If you have an odd number of digits, prepend a leading zero. Widely used for carton-level shipping labels (ITF-14).
^XA ^FO50,50^BY2 ^B2N,100,Y,N ^FD1234567890^FS ^XZ
ZPL draws the barcode, but the digits must be valid (GS1 check digit included). Generate the correct code, then paste it into your ZPL:
Visualize and verify your ZPL barcodes with our free tools before printing.