zpl.tools

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 ignored

Quick Start Commands

The most essential commands to get started with ZPL:

Command Categories

Format Control (8 commands)

Commands for controlling label format structure and storage.

CommandNamePurpose
^XAStart FormatBegins label
^XZEnd FormatEnds label
^XBSuppress BackfeedPrevents media backfeed
^DFDownload FormatStores format in memory
^EFErase FormatDeletes stored format
^XFRecall FormatRetrieves stored format
^JZJob IDIdentifies print job
^ZZEnd JobTerminates print job

Field Commands (15 commands)

Commands for defining text fields, positioning, and formatting.

CommandNamePurpose
^FOField OriginSets field position
^FDField DataSpecifies text content
^FSField SeparatorEnds field definition
^FTField TypesetSets typeset text position
^FBField BlockCreates text block with wrapping
^FHField HexEnables hex value interpretation
^FNField NumberCreates numbered field for variables
^FVField VariableAssigns variable data
^FAField AllocatePre-allocates memory
^FPField ParameterSets special font parameters
^FRField Reverse PrintInverts field colors
^FWField OrientationRotates/mirrors field
^FXCommentAdds non-printing comment

Font & Text Commands (14 commands)

Commands for font selection, text formatting, and font downloads.

CommandNamePurpose
^AScalable/Bitmapped FontSelects font and size
^A@Use Font NameSelects font by filename
^CFChange Default FontSets default font
^CIChange International FontSelects character set
^CWFont IdentifierCreates font alias
~DBDownload Bitmap FontStores bitmap font
~DSDownload Scalable FontStores scalable font
~DTDownload TrueType FontStores TrueType font
~DUDownload Unicode FontStores Unicode/Kanji font
~DEDownload Encoding TableStores character encoding
^KLChange LanguageSelects language for display
^KPSet PasswordProtects font resources
^SCSelect Character SetChooses character encoding
^SESet External FontUses external font resources

Bar Code Commands (25 commands)

Commands for creating 1D and 2D barcodes.

CommandNamePurpose
^B1UPC-E6-digit UPC format
^B2UPC-A12-digit UPC format
^B3Code 39Alphanumeric barcode
^B4Code 49Multi-row barcode
^B9Code 9347-character barcode
^BACodabarCurrency/numeric barcode
^BCCode 128Alphanumeric barcode
^BDEAN-88-digit EAN barcode
^BEEAN-1313-digit EAN barcode
^BFEAN-1414-digit EAN barcode
^BGEAN-128Code 128 with special format
^BIStandard 2of5Numeric interleaved 2-of-5
^BJInterleaved 2of5Numeric interleaved barcode
^BKLOGMARSMilitary barcode
^BLMSINumeric barcode
^BMCode 11Numeric barcode
^BPPostNetUS Postal barcode
^BQQR Code2D QR code
^BRPDF4172D variable length barcode
^BSAztec2D Aztec barcode
^BTPlanetUS Postal Planet barcode
^BUISBT128Blood bank barcode
^BVTriopticTrioptic code barcode
^BWMaxiCode2D MaxiCode barcode
^BXData Matrix2D matrix barcode
^BYChange Bar WidthSets barcode size

Graphics Commands (11 commands)

Commands for drawing shapes and managing graphics.

CommandNamePurpose
~DGDownload GraphicStores custom image in memory
^XGRecall GraphicRetrieves stored graphics
^EGErase GraphicDeletes stored graphics
^GBGraphic BoxDraws rectangles/lines
^GCGraphic CircleDraws circles
^GDGraphic Diagonal LineDraws diagonal lines
^GEGraphic EllipseDraws ellipses
^GFGraphic FieldPrints ASCII hex bitmap
^GSGraphic SymbolPrints shapes from fonts
^HGHost GraphicDownloads graphics from host
~DNDownload Binary GraphicStores binary graphic data

Label Formatting Commands (12 commands)

Commands for controlling label dimensions, orientation, and positioning.

CommandNamePurpose
^LHLabel HomeSets reference point
^LLLabel LengthSets label height
^LRLabel ReverseReverses label orientation
^LSLabel ShiftShifts label position
^LTLabel TopSets top position
^MMPrint ModeSets print/tear-off mode
^MNMedia Tracking ModeSets media sensing
^MTMedia TypeSelects media type
^MFMedia FeedControls feed mode
^MLMedia Link ValueSets label gap
^PMPitch ModeSets print mode
^POPrint OriginSets print position

Commands for controlling print behavior, quantity, and speed.

CommandNamePurpose
^PQPrint QuantitySets number to print
^PRPrint RateSets print speed
^PWPrint WidthSets label width
^PFPrint FeedFeeds label after print
^PHPrint HeightSets print area height
^PPPrint PausePauses print operation
^SPSlew PointSets slew distance
~PSPrint StartInitiates printing
^JZJob IDIdentifies print job
^ZZEnd JobTerminates print job

Memory & Storage Commands (6 commands)

Commands for managing printer memory and storage.

CommandNamePurpose
^TOTransfer ObjectCopies data between devices
~HMHost Memory StatusReports memory usage
^JBInitialize Flash MemoryErases flash storage
~JBReset Battery DeadResets battery status
^HWHost Directory ListLists stored items
^WDPrint DirectoryPrints storage contents

Network Commands (7 commands)

Commands for network configuration and multi-printer operations.

CommandNamePurpose
~HIHost IdentificationIdentifies printer on network
~HSHost Status ReturnReports printer status
^HVHost VerificationVerifies host communication
^NINetwork ID NumberSets printer network ID
~NCNetwork ConnectInitiates network connection
~NRSet All TransparentSets all printers transparent
~NTSet Printer TransparentSets single printer transparent

Sensor & Calibration Commands (13 commands)

Commands for sensor configuration and printer calibration.

CommandNamePurpose
~HBBattery StatusReports battery level
~JCMedia CalibrationCalibrates media sensor
~JDEnable DiagnosticsEnables diagnostics mode
~JEDisable DiagnosticsDisables diagnostics mode
~JGGraphing CalibrationCalibrates sensor graphing
^JJAuxiliary PortConfigures auxiliary port
~JLSet Label LengthSets label length
^JMDots Per MillimeterSets print resolution
~JNHead Test FatalTests printhead (fatal)
~JOHead Test Non-FatalTests printhead (non-fatal)
^JTHead Test IntervalSets test interval
^JWRibbon TensionSets ribbon tension
^SRHead ResistanceSets printhead resistance

Control & Reset Commands (7 commands)

Commands for print job control and printer reset.

CommandNamePurpose
~JACancel AllCancels all formats
~JPPause & CancelPauses and cancels format
~JRPower On ResetPerforms soft reset
~JSBackfeed SequenceSets backfeed behavior
~JXCancel CurrentCancels current transmission
^DDDownload Direct BitmapPrints bitmap directly
~TATear-Off AdjustAdjusts tear position

Inquiry Commands (2 commands)

Commands for printer information and status.

CommandNamePurpose
~WCConfiguration LabelPrints printer config
^WDPrint DirectoryPrints storage directory

Serialization Commands (2 commands)

Commands for data serialization and variable fields.

CommandNamePurpose
^SNSerializationCreates data sequences
^SFSerialization FieldSets serialization parameters

Delimiter & Prefix Commands (3 commands)

Commands for changing command and parameter delimiters.

CommandNamePurpose
^CCChange CaratChanges ^ prefix
^CDChange DelimiterChanges , delimiter
~CCChange Carat (Tilde)Changes ^ prefix via tilde

System Configuration Commands (11 commands)

Commands for printer configuration and system settings.

CommandNamePurpose
^CVCode ValidationEnables code validation
^JUConfiguration UpdateUpdates printer config
^MUMode UnitsSets measurement units
^MPMode ProtectionProtects settings
^COCache OnEnables memory cache
~SDSet DarknessSets print darkness
^CTChange TildeChanges ~ prefix
^KLChange LanguageSelects language
^KPSet PasswordSets resource password
^SESet External FontUses external fonts
^FHField HexEnables hex interpretation

Image Commands (4 commands)

Commands for advanced image handling.

CommandNamePurpose
^IMImage MovePositions image
^ILImage LoadLoads image into memory
^ISImage SaveSaves format as graphic
^IDImage DeleteDeletes stored images

Encoding Commands (5 commands)

Commands for character encoding and special characters.

CommandNamePurpose
^CIChange International FontSelects character set
^CWFont IdentifierCreates font alias
^SCSelect Character SetChooses character encoding
^FHField HexEnables hex interpretation
^FPField ParameterSets font parameters

Complete Coverage Summary

Documentation Statistics

The table below counts documentation pages, not renderer support — see Renderer support for what renders today.

CategoryCommandsFilesStatus
Barcode2525✅ 100%
Font & Text1414✅ 100%
Field Commands1212✅ 100%
Graphics1111✅ 100%
Label Formatting1212✅ 100%
Print Control1010✅ 100%
Memory & Storage66✅ 100%
Network77✅ 100%
Sensor & Calibration1313✅ 100%
Control & Reset77✅ 100%
System Configuration1111✅ 100%
Inquiry22✅ 100%
Serialization22✅ 100%
Delimiter & Prefix33✅ 100%
Image44✅ 100%
Encoding55✅ 100%
TOTAL141151100%

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

  1. Start with ^XA (Start Format)
  2. Set label dimensions with ^LL and ^LH
  3. Position with ^FO
  4. Select font with ^A or ^CF
  5. Add text with ^FD and ^FS
  6. End with ^XZ (End Format)

Adding Barcodes

  • Code 128: ^BC
  • Code 39: ^B3
  • QR Code: ^BQ
  • Data Matrix: ^BX
  • Set size with ^BY

Working with Graphics

  • Store images: ~DG
  • Recall images: ^XG
  • Draw shapes: ^GB, ^GC
  • Direct bitmap: ^DD

Printer Control

  • Print quantity: ^PQ
  • Print speed: ^PR
  • Media type: ^MT
  • Print mode: ^MM

Troubleshooting & Setup

  • Configuration: ~WC (Print Configuration Label)
  • Memory status: ~HM
  • Reset printer: ~JR
  • Calibrate sensors: ~JC

Tips & Best Practices

  1. Always end with ^XZ - Every label format must end with this command
  2. Position before content - Use ^FO before ^FD and barcode commands
  3. Set fonts early - Use ^A or ^CF at the beginning to avoid repetition
  4. Test before production - Verify labels look correct before large print jobs
  5. Use comments - Add ^FX comments to document complex formats
  6. Consider reuse - Use ^DF to store frequently used formats
  7. Optimize for speed - Minimize command size for faster transmission
  8. Check memory - Use ~HM to verify available memory before large downloads
  9. Validate codes - Enable code validation with ^CV for quality assurance
  10. Document configuration - Print configuration labels with ~WC for reference