^FD Field Data

Provides the data content for a text or barcode field.

Supported in ZPL Preview

^FD supplies the data string for the current field. It must follow a ^FO and a font or barcode command, and must be terminated with ^FS. The content between ^FD and ^FS is what gets printed — either rendered as text through the selected font, or encoded into a barcode by the preceding barcode command.

For text fields, ^FD content is rendered literally in the font set by the most recent ^A or ^CF command. Special characters can be encoded using the hex escape sequence: the tilde followed by the hex code. For example, ~7E inserts a tilde, and ~26 inserts an ampersand. You can also use the caret-I sequence for specific encodings.

For barcode fields, the ^FD content is the data to encode — a tracking number, a product code, a URL, etc. The barcode command before ^FD (^BC, ^BQ, ^B3, etc.) determines the encoding format.

^FD is optional for graphic commands like ^GB and ^GC which don't take data strings. If you use ^FD with a graphic command, the content is typically ignored.

Variable fields use ^FN (Field Number) to create named slots — when printing, ^FD fills a named slot. This pattern is used in batch printing where the host application replaces ^FN-tagged fields with per-label values.

Syntax

^FDa

Parameters

ParameterTypeDefaultDescription
astringoptionalThe data to encode or display. For text fields: the string to print. For barcodes: the value to encode.

Examples

Text field with label data

Try in Viewer
^XA
^FO50,50^A0N,40,40^FDShip To: New York^FS
^FO50,105^A0N,28,28^FD123 Main St, NY 10001^FS
^XZ

Barcode field — FD provides the value to encode

Try in Viewer
^XA
^FO50,50^BY2,3,90^BCN,90,Y,N,N^FD4006381333931^FS
^XZ

Common Mistakes

  • !Omitting ^FD for text fields — the printer renders nothing (empty field).
  • !Including carriage returns or line feeds inside ^FD — these are control characters that break the field; use ^FB for multi-line text.
  • !Encoding invalid characters for the barcode type — e.g., lowercase letters in Code 39 without enabling extended mode.
^FD Field Data — ZPL Command Reference | Prynta Co | Prynta Co