ZPL Commands Reference
Documentation for all 141 Zebra Programming Language (ZPL) II commands, with renderer support status
ZPL Commands Reference
Complete documentation for all 141 ZPL II commands (firmware v26.8.0). Commands are organized by category for easy navigation and include syntax, parameters, examples, and usage guidelines.
📊 Documentation Status: ✅ 100% Complete (141/141 commands documented)
Documentation coverage is not the same thing as renderer support: every command is documented here, but the rendering engine implements the most-used subset — see Renderer support below for what actually renders today and how unsupported commands are reported.
Renderer support
The renderer behaves like a physical Zebra printer: it renders
best-effort and never fails a label because of a command it does not
implement. What is different is that it tells you — every skipped
command and silent fallback is reported as a
diagnostic, inline in the
online viewer and desktop app, and via the
X-Warnings header
on the API.
Rendering today (verified against the engine): label structure and
fields (^XA ^XZ ^FS ^FX ^FO ^FT ^FB ^FD ^FV ^FH
^FR ^FW), fonts and text (^A ^CF, ^CI partially), barcodes
(^BY ^BC Code 128 / GS1-128, ^B2 Interleaved 2-of-5, ^B3
Code 39, ^B7 PDF417, ^BQ QR Code, ^BX Data Matrix, ^BD
MaxiCode), graphics (^GB ^GF ~DG ^XG ^ID), and layout
(^LH ^PW ^CC ^CT).
Everything else falls into two buckets:
-
Recognized but not implemented — documented ZPL the engine knows it does not render (for example
^KL,^GC,^GD,^GE,^GS). These are skipped and reported:UNSUPPORTED_COMMAND: command "^KL" is valid ZPL but is not supported by this renderer yet; it was skipped -
Accepted without visual effect — commands the parser accepts (printer-configuration commands like
^PR,^MM,^MN, and less-common barcode types) that currently produce no output or fall back to rendering the field data as plain text. Reporting for this bucket is being expanded under the coverage process — if one of these commands matters to you, tell us.
Anything that is not ZPL at all (typos, wrong case) is reported as:
UNKNOWN_COMMAND: This ZPL command does not exist and was ignoredQuick Start Commands
The most essential commands to get started with ZPL:
- ^XA - Start Format - Begins a label format (required)
- ^XZ - End Format - Ends a label format (required)
- ^FO - Field Origin - Sets field position
- ^FD - Field Data - Specifies text content
- ^FS - Field Separator - Ends field definition
- ^A - Scalable Font - Selects font and size
Command Categories
Format Control (8 commands)
Commands for controlling label format structure and storage.
| Command | Name | Purpose |
|---|---|---|
| ^XA | Start Format | Begins label |
| ^XZ | End Format | Ends label |
| ^XB | Suppress Backfeed | Prevents media backfeed |
| ^DF | Download Format | Stores format in memory |
| ^EF | Erase Format | Deletes stored format |
| ^XF | Recall Format | Retrieves stored format |
| ^JZ | Job ID | Identifies print job |
| ^ZZ | End Job | Terminates print job |
Field Commands (15 commands)
Commands for defining text fields, positioning, and formatting.
| Command | Name | Purpose |
|---|---|---|
| ^FO | Field Origin | Sets field position |
| ^FD | Field Data | Specifies text content |
| ^FS | Field Separator | Ends field definition |
| ^FT | Field Typeset | Sets typeset text position |
| ^FB | Field Block | Creates text block with wrapping |
| ^FH | Field Hex | Enables hex value interpretation |
| ^FN | Field Number | Creates numbered field for variables |
| ^FV | Field Variable | Assigns variable data |
| ^FA | Field Allocate | Pre-allocates memory |
| ^FP | Field Parameter | Sets special font parameters |
| ^FR | Field Reverse Print | Inverts field colors |
| ^FW | Field Orientation | Rotates/mirrors field |
| ^FX | Comment | Adds non-printing comment |
Font & Text Commands (14 commands)
Commands for font selection, text formatting, and font downloads.
| Command | Name | Purpose |
|---|---|---|
| ^A | Scalable/Bitmapped Font | Selects font and size |
| ^A@ | Use Font Name | Selects font by filename |
| ^CF | Change Default Font | Sets default font |
| ^CI | Change International Font | Selects character set |
| ^CW | Font Identifier | Creates font alias |
| ~DB | Download Bitmap Font | Stores bitmap font |
| ~DS | Download Scalable Font | Stores scalable font |
| ~DT | Download TrueType Font | Stores TrueType font |
| ~DU | Download Unicode Font | Stores Unicode/Kanji font |
| ~DE | Download Encoding Table | Stores character encoding |
| ^KL | Change Language | Selects language for display |
| ^KP | Set Password | Protects font resources |
| ^SC | Select Character Set | Chooses character encoding |
| ^SE | Set External Font | Uses external font resources |
Bar Code Commands (25 commands)
Commands for creating 1D and 2D barcodes.
| Command | Name | Purpose |
|---|---|---|
| ^B1 | UPC-E | 6-digit UPC format |
| ^B2 | UPC-A | 12-digit UPC format |
| ^B3 | Code 39 | Alphanumeric barcode |
| ^B4 | Code 49 | Multi-row barcode |
| ^B9 | Code 93 | 47-character barcode |
| ^BA | Codabar | Currency/numeric barcode |
| ^BC | Code 128 | Alphanumeric barcode |
| ^BD | EAN-8 | 8-digit EAN barcode |
| ^BE | EAN-13 | 13-digit EAN barcode |
| ^BF | EAN-14 | 14-digit EAN barcode |
| ^BG | EAN-128 | Code 128 with special format |
| ^BI | Standard 2of5 | Numeric interleaved 2-of-5 |
| ^BJ | Interleaved 2of5 | Numeric interleaved barcode |
| ^BK | LOGMARS | Military barcode |
| ^BL | MSI | Numeric barcode |
| ^BM | Code 11 | Numeric barcode |
| ^BP | PostNet | US Postal barcode |
| ^BQ | QR Code | 2D QR code |
| ^BR | PDF417 | 2D variable length barcode |
| ^BS | Aztec | 2D Aztec barcode |
| ^BT | Planet | US Postal Planet barcode |
| ^BU | ISBT128 | Blood bank barcode |
| ^BV | Trioptic | Trioptic code barcode |
| ^BW | MaxiCode | 2D MaxiCode barcode |
| ^BX | Data Matrix | 2D matrix barcode |
| ^BY | Change Bar Width | Sets barcode size |
Graphics Commands (11 commands)
Commands for drawing shapes and managing graphics.
| Command | Name | Purpose |
|---|---|---|
| ~DG | Download Graphic | Stores custom image in memory |
| ^XG | Recall Graphic | Retrieves stored graphics |
| ^EG | Erase Graphic | Deletes stored graphics |
| ^GB | Graphic Box | Draws rectangles/lines |
| ^GC | Graphic Circle | Draws circles |
| ^GD | Graphic Diagonal Line | Draws diagonal lines |
| ^GE | Graphic Ellipse | Draws ellipses |
| ^GF | Graphic Field | Prints ASCII hex bitmap |
| ^GS | Graphic Symbol | Prints shapes from fonts |
| ^HG | Host Graphic | Downloads graphics from host |
| ~DN | Download Binary Graphic | Stores binary graphic data |
Label Formatting Commands (12 commands)
Commands for controlling label dimensions, orientation, and positioning.
| Command | Name | Purpose |
|---|---|---|
| ^LH | Label Home | Sets reference point |
| ^LL | Label Length | Sets label height |
| ^LR | Label Reverse | Reverses label orientation |
| ^LS | Label Shift | Shifts label position |
| ^LT | Label Top | Sets top position |
| ^MM | Print Mode | Sets print/tear-off mode |
| ^MN | Media Tracking Mode | Sets media sensing |
| ^MT | Media Type | Selects media type |
| ^MF | Media Feed | Controls feed mode |
| ^ML | Media Link Value | Sets label gap |
| ^PM | Pitch Mode | Sets print mode |
| ^PO | Print Origin | Sets print position |
Print Control Commands (10 commands)
Commands for controlling print behavior, quantity, and speed.
| Command | Name | Purpose |
|---|---|---|
| ^PQ | Print Quantity | Sets number to print |
| ^PR | Print Rate | Sets print speed |
| ^PW | Print Width | Sets label width |
| ^PF | Print Feed | Feeds label after print |
| ^PH | Print Height | Sets print area height |
| ^PP | Print Pause | Pauses print operation |
| ^SP | Slew Point | Sets slew distance |
| ~PS | Print Start | Initiates printing |
| ^JZ | Job ID | Identifies print job |
| ^ZZ | End Job | Terminates print job |
Memory & Storage Commands (6 commands)
Commands for managing printer memory and storage.
| Command | Name | Purpose |
|---|---|---|
| ^TO | Transfer Object | Copies data between devices |
| ~HM | Host Memory Status | Reports memory usage |
| ^JB | Initialize Flash Memory | Erases flash storage |
| ~JB | Reset Battery Dead | Resets battery status |
| ^HW | Host Directory List | Lists stored items |
| ^WD | Print Directory | Prints storage contents |
Network Commands (7 commands)
Commands for network configuration and multi-printer operations.
| Command | Name | Purpose |
|---|---|---|
| ~HI | Host Identification | Identifies printer on network |
| ~HS | Host Status Return | Reports printer status |
| ^HV | Host Verification | Verifies host communication |
| ^NI | Network ID Number | Sets printer network ID |
| ~NC | Network Connect | Initiates network connection |
| ~NR | Set All Transparent | Sets all printers transparent |
| ~NT | Set Printer Transparent | Sets single printer transparent |
Sensor & Calibration Commands (13 commands)
Commands for sensor configuration and printer calibration.
| Command | Name | Purpose |
|---|---|---|
| ~HB | Battery Status | Reports battery level |
| ~JC | Media Calibration | Calibrates media sensor |
| ~JD | Enable Diagnostics | Enables diagnostics mode |
| ~JE | Disable Diagnostics | Disables diagnostics mode |
| ~JG | Graphing Calibration | Calibrates sensor graphing |
| ^JJ | Auxiliary Port | Configures auxiliary port |
| ~JL | Set Label Length | Sets label length |
| ^JM | Dots Per Millimeter | Sets print resolution |
| ~JN | Head Test Fatal | Tests printhead (fatal) |
| ~JO | Head Test Non-Fatal | Tests printhead (non-fatal) |
| ^JT | Head Test Interval | Sets test interval |
| ^JW | Ribbon Tension | Sets ribbon tension |
| ^SR | Head Resistance | Sets printhead resistance |
Control & Reset Commands (7 commands)
Commands for print job control and printer reset.
| Command | Name | Purpose |
|---|---|---|
| ~JA | Cancel All | Cancels all formats |
| ~JP | Pause & Cancel | Pauses and cancels format |
| ~JR | Power On Reset | Performs soft reset |
| ~JS | Backfeed Sequence | Sets backfeed behavior |
| ~JX | Cancel Current | Cancels current transmission |
| ^DD | Download Direct Bitmap | Prints bitmap directly |
| ~TA | Tear-Off Adjust | Adjusts tear position |
Inquiry Commands (2 commands)
Commands for printer information and status.
| Command | Name | Purpose |
|---|---|---|
| ~WC | Configuration Label | Prints printer config |
| ^WD | Print Directory | Prints storage directory |
Serialization Commands (2 commands)
Commands for data serialization and variable fields.
| Command | Name | Purpose |
|---|---|---|
| ^SN | Serialization | Creates data sequences |
| ^SF | Serialization Field | Sets serialization parameters |
Delimiter & Prefix Commands (3 commands)
Commands for changing command and parameter delimiters.
| Command | Name | Purpose |
|---|---|---|
| ^CC | Change Carat | Changes ^ prefix |
| ^CD | Change Delimiter | Changes , delimiter |
| ~CC | Change Carat (Tilde) | Changes ^ prefix via tilde |
System Configuration Commands (11 commands)
Commands for printer configuration and system settings.
| Command | Name | Purpose |
|---|---|---|
| ^CV | Code Validation | Enables code validation |
| ^JU | Configuration Update | Updates printer config |
| ^MU | Mode Units | Sets measurement units |
| ^MP | Mode Protection | Protects settings |
| ^CO | Cache On | Enables memory cache |
| ~SD | Set Darkness | Sets print darkness |
| ^CT | Change Tilde | Changes ~ prefix |
| ^KL | Change Language | Selects language |
| ^KP | Set Password | Sets resource password |
| ^SE | Set External Font | Uses external fonts |
| ^FH | Field Hex | Enables hex interpretation |
Image Commands (4 commands)
Commands for advanced image handling.
| Command | Name | Purpose |
|---|---|---|
| ^IM | Image Move | Positions image |
| ^IL | Image Load | Loads image into memory |
| ^IS | Image Save | Saves format as graphic |
| ^ID | Image Delete | Deletes stored images |
Encoding Commands (5 commands)
Commands for character encoding and special characters.
| Command | Name | Purpose |
|---|---|---|
| ^CI | Change International Font | Selects character set |
| ^CW | Font Identifier | Creates font alias |
| ^SC | Select Character Set | Chooses character encoding |
| ^FH | Field Hex | Enables hex interpretation |
| ^FP | Field Parameter | Sets font parameters |
Complete Coverage Summary
Documentation Statistics
The table below counts documentation pages, not renderer support — see Renderer support for what renders today.
| Category | Commands | Files | Status |
|---|---|---|---|
| Barcode | 25 | 25 | ✅ 100% |
| Font & Text | 14 | 14 | ✅ 100% |
| Field Commands | 12 | 12 | ✅ 100% |
| Graphics | 11 | 11 | ✅ 100% |
| Label Formatting | 12 | 12 | ✅ 100% |
| Print Control | 10 | 10 | ✅ 100% |
| Memory & Storage | 6 | 6 | ✅ 100% |
| Network | 7 | 7 | ✅ 100% |
| Sensor & Calibration | 13 | 13 | ✅ 100% |
| Control & Reset | 7 | 7 | ✅ 100% |
| System Configuration | 11 | 11 | ✅ 100% |
| Inquiry | 2 | 2 | ✅ 100% |
| Serialization | 2 | 2 | ✅ 100% |
| Delimiter & Prefix | 3 | 3 | ✅ 100% |
| Image | 4 | 4 | ✅ 100% |
| Encoding | 5 | 5 | ✅ 100% |
| TOTAL | 141 | 151 | ✅ 100% |
Commands by Prefix
Carat Commands (^)
All commands beginning with the caret symbol ^:
- Format Control: ^XA, ^XZ, ^XB, ^DF, ^EF, ^XF
- Field: ^FO, ^FD, ^FS, ^FT, ^FB, ^FH, ^FN, ^FV, ^FA, ^FP, ^FR, ^FW, ^FX
- Font: ^A, ^A@, ^CF, ^CI, ^CW, ^KL, ^KP
- Barcode: ^B1-^B4, ^B9, ^BA, ^BC-^BX, ^BY
- Graphics: ^XG, ^EG, ^GB-^GS, ^HG, ^DD, ^IM, ^IL, ^IS, ^ID
- Label Formatting: ^LH, ^LL, ^LR, ^LS, ^LT, ^MM, ^MN, ^MT, ^MF, ^ML, ^PM, ^PO
- Print Control: ^PQ, ^PR, ^PW, ^PF, ^PH, ^PP, ^SP, ^JZ, ^ZZ
- Memory: ^TO, ^JB, ^HW, ^WD
- Network: ^HV, ^NI
- Sensor: ^JJ, ^JM, ^JT, ^JW, ^SR
- Control: ^DD
- System: ^CV, ^JU, ^MU, ^MP, ^CO, ^CT
- Encoding: ^SC, ^SE, ^CI, ^CW, ^FH, ^FP
- Total: 100+ carat commands
Tilde Commands (~)
All commands beginning with the tilde symbol ~:
- Fonts: ~DB, ~DS, ~DT, ~DU, ~DE
- Graphics: ~DG, ~DN
- Memory: ~HM, ~JB
- Network: ~HI, ~HS, ~NC, ~NR, ~NT
- Sensor: ~HB, ~JC, ~JD, ~JE, ~JG, ~JL, ~JN, ~JO
- Control: ~JA, ~JP, ~JR, ~JS, ~JX, ~TA
- Inquiry: ~WC
- Print Control: ~PS
- System: ~SD
- Total: 40+ tilde commands
Common Command Patterns
Basic Label Structure
^XA ^FO50,50 # Position at (50,50) ^ADN,50,50 # Font: Arial, ^FDHello World^FS ^XZ
With Barcodes
^XA ^FO50,50 ^BCN,100,Y,N,N # Code 128 barcode ^FD123456789^FS ^FO50,200 ^ADN,40,40 ^FDProduct Code^FS ^XZ
With Multiple Fields
^XA ^LH0,0 # Label home ^LL812 # Label height ^FO50,50 ^ADN,50,50 ^FDField 1^FS ^FO50,150 ^ADN,40,40 ^FDField 2^FS ^XZ
Parameter Notation
Throughout ZPL documentation:
- Required parameters must be specified
- Optional parameters can be omitted
- Comma delimiters separate parameters
- Trailing commas can be omitted if using defaults
Orientation Values
For fields and bar codes:
- N = Normal (0°)
- R = Rotated 90° clockwise
- I = Inverted 180°
- B = Read from bottom up (270°)
Device Designations
When specifying storage locations:
- R: = RAM (volatile memory)
- E: = Permanent storage (EPROM, Flash)
- B: = Optional memory (Flash card)
- A: = All memory devices
Quick Access by Use Case
Building a Label
- Start with ^XA (Start Format)
- Set label dimensions with ^LL and ^LH
- Position with ^FO
- Select font with ^A or ^CF
- Add text with ^FD and ^FS
- End with ^XZ (End Format)
Adding Barcodes
Working with Graphics
Printer Control
Troubleshooting & Setup
- Configuration: ~WC (Print Configuration Label)
- Memory status: ~HM
- Reset printer: ~JR
- Calibrate sensors: ~JC
Tips & Best Practices
- Always end with ^XZ - Every label format must end with this command
- Position before content - Use ^FO before ^FD and barcode commands
- Set fonts early - Use ^A or ^CF at the beginning to avoid repetition
- Test before production - Verify labels look correct before large print jobs
- Use comments - Add ^FX comments to document complex formats
- Consider reuse - Use ^DF to store frequently used formats
- Optimize for speed - Minimize command size for faster transmission
- Check memory - Use ~HM to verify available memory before large downloads
- Validate codes - Enable code validation with ^CV for quality assurance
- Document configuration - Print configuration labels with ~WC for reference