Skip to content
PrinterArchive

Tools

ESC/P (Epson Standard Code for Printers)

ESC/P (Epson Standard Code for Printers) is a stream-based printer control language developed by Seiko Epson, in which ordinary character data is interspersed with escape sequences — control strings beginning with the ASCII ESC character (decimal 27) — that instruct a printer how to format, position, and render output. It originated on Epson dot-matrix impact printers, was extended as the backward-compatible ESC/P 2, and continues in the raster-oriented ESC/P-R inkjet variant and the ESC/POS receipt-printer variant. Unlike PostScript, ESC/P is a device-facing control language rather than a device-independent, programmable page-description language.

By PrinterArchive EditorialEdited by PrinterArchive Editorial

History

ESC/P — an initialism for Epson Standard Code for Printers — grew up alongside Seiko Epson's dot-matrix printer line during the 1980s. Epson's MX-80, released in October 1980, is commonly cited as the progenitor of the ESC/P escape-sequence approach, and the technique spread through Epson's later FX (9-pin) and LQ (24-pin, "letter quality") dot-matrix families. It became a de facto control language that competing manufacturers partially emulated; Epson has documented that NEC and other makers offered modified ESC/P emulation.

The branded name "Epson Standard Code for Printers" was codified and marketed after 1980, so the MX-80 is best understood as the early ESC/P-era device rather than a printer that shipped under the "ESC/P" brand. As Epson moved from 9-pin to 24-pin mechanisms and then to inkjet technology, the language was extended into a family of related command sets:

  • ESC/P — the original dot-matrix command set.
  • ESC/P 2 — a backward-compatible superset adding built-in scalable (vector) fonts and enhanced graphics.
  • ESC/P-R — a simplified, raster-centric language for modern Epson inkjet printers, driven from host-side drivers.
  • ESC/POS — a variant tailored to point-of-sale receipt and thermal printers.
  • Region-specific variants such as ESC/P J84 (Japanese) that add double-byte character support.

Epson published an ESC/P Reference Manual dated December 1997 documenting ESC/P and ESC/P 2 commands, with a later edition dated June 2004. These are documentation dates and should not be read as the introduction dates of the languages themselves; the introduction year of ESC/P 2 is not firmly established in the primary Epson documents and is best treated as early 1990s at the era level.

What problem it solved

In the early PC era there was no universal way for application software to control printer formatting — bold, italic, pitch (characters per inch), line spacing, graphics, and paper handling. ESC/P provided a compact, well-documented command vocabulary so that word processors, spreadsheets, and other DOS-era software could produce formatted output on Epson and Epson-compatible printers by embedding short escape sequences directly in the print stream.

Because so many applications shipped Epson drivers (alongside IBM Proprinter drivers), ESC/P compatibility became a practical baseline for the impact-printer market, easing interoperability between software and hardware from many vendors.

How it works

The host sends a byte stream that mixes printable characters with control codes and escape sequences:

  • Single control codes — for example CR (carriage return), LF (line feed), FF (form feed), and HT (horizontal tab).
  • Escape sequences — an ESC byte (decimal 27, hex 1B) followed by a command character and optional parameters.

Representative escape sequences from Epson's command references include:

  • ESC @ — initialize the printer, canceling all current settings.
  • ESC E — turn bold on; ESC F — turn bold off.
  • ESC 3 n — set line spacing (for example, in units of n/216 inch on 9-pin printers; the unit can differ by printer type).
  • ESC $ — move to an absolute horizontal print position (a Print Position command taking a two-byte parameter).

Epson groups the commands into functional categories including general operation, paper feeding, page format, print-position motion, font selection, font enhancement, character handling (character tables, international character sets, and downloadable user-defined characters), bit-image and raster graphics, and bar-code printing. Parameters are typically single bytes (n) or multi-byte values (n1 n2) following the command letter. The printer behaves as a state machine: each escape sequence changes an internal setting that persists until it is changed or the printer is reset with ESC @.

ESC/P 2 keeps this model while adding commands for built-in scalable fonts and richer graphics. Epson's anti-banding interleaving technique, MicroWeave, is associated with this era of raster output. ESC/P-R shifts most of the intelligence to the host: the driver rasterizes the page and sends raster data plus a smaller set of job and media commands, which suits photo-quality inkjet printing.

Where it sits in the print/document pipeline

ESC/P is the device-facing language at the end of the print pipeline. The general flow is: application → operating system and driver → (command generation or rasterization) → ESC/P byte stream → printer firmware → marking engine.

In the DOS era, applications often emitted ESC/P commands directly. In modern software stacks, a printer driver or a CUPS filter converts rendered page data into the specific ESC/P, ESC/P 2, or ESC/P-R dialect that the target printer understands.

Relationship to printers

ESC/P is tightly coupled to Epson hardware generations. The documented Epson impact line spans 9-pin mechanisms (the MX and FX families) and 24-pin mechanisms (the LQ family), and these support different command subsets; Epson's reference material flags differences between 9-pin and 24-pin commands and among individual printer models. "ESC/P" is therefore a family of related interfaces rather than a single fixed one.

Many non-Epson impact printers historically offered an Epson ESC/P emulation mode. Today, Epson impact/dot-matrix printers continue to support ESC/P, modern Epson inkjets use ESC/P-R, and receipt and thermal printers widely use ESC/POS.

Relationship to operating systems

  • DOS and early Windows — applications and drivers emitted ESC/P directly, and "Epson FX/LQ" and "IBM Proprinter" were near-universal driver choices.
  • Modern Windows — Epson ships driver software that generates the appropriate ESC/P variant for the target model.
  • Linux and Unix — Epson distributes the Epson Inkjet Printer Driver (ESC/P-R) for Linux, which its own documentation describes as "a filter program used with the Common UNIX Printing System (CUPS)" for high-quality printing on Epson color inkjet printers, and which "can only be used with printers that support the Epson ESC/P-R language." It plugs in as a CUPS filter (typically alongside Ghostscript for rasterization) and is packaged as RPM and DEB. OpenPrinting distributes the same driver family as epson-escpr.
  • macOS — Epson provides model-specific drivers over the CUPS-based printing system.

Relationship to PDF / PostScript / drivers

ESC/P is a peer or alternative to other printer control languages, not a document-interchange format like PDF.

  • PostScript and PCL were the classic office and laser control languages, while ESC/P occupied the dot-matrix and consumer-inkjet space. Unlike PostScript, ESC/P is not a general-purpose programmable language and does not describe device-independent pages.
  • PDF and PostScript documents are not sent to an ESC/P printer directly. A driver or CUPS filter first renders or rasterizes them, then emits ESC/P — or, for ESC/P-R, raster data together with control commands.
  • IBM PPDS (Personal Printer Data Stream) / IBM Proprinter is a closely related, contemporaneous escape-sequence language. Epson and IBM control-code sets are frequently cross-referenced, and printers often emulated both; IBM has published a combined list of IBM PPDS and Epson ESC/P control codes and escape sequences.

Modern use

  • Dot-matrix and impact printers remain in use for multipart forms, invoices, and logistics documents; current Epson impact printers still speak ESC/P and ESC/P 2.
  • Inkjet printing on modern Epson devices uses ESC/P-R, driven through operating-system drivers and CUPS filters.
  • Receipt and point-of-sale thermal printers heavily use the ESC/POS command set, a distinct ESC/P descendant maintained for point-of-sale hardware.

Advantages

  • Compact and low-overhead, well suited to serial- and parallel-connected impact printers.
  • Extensively documented by Epson through a public reference manual, which eased driver development.
  • Backward compatible: ESC/P 2 extends ESC/P without breaking older command usage.
  • Broad historical support and emulation, which made it a practical interoperability baseline for the impact-printer market.

Limitations

  • Device- and model-dependent: command support differs between 9-pin and 24-pin printers and across models, so "ESC/P" is a family of interfaces rather than one fixed standard.
  • Not device-independent: it is a control language for specific printer hardware, not a portable document format.
  • Not programmable in the PostScript sense: it offers no general computation, so complex page layout must be resolved on the host.
  • Classic ESC/P text and bit-image graphics are limited compared with modern raster and photo pipelines, which is why ESC/P-R moved rasterization to the host.
  • ESC/P 2, ESC/P-R, ESC/POS, and ESC/P J84 — Epson variants of the ESC/P family.
  • IBM PPDS / Proprinter — a related contemporaneous escape-sequence language, frequently cross-emulated with ESC/P.
  • PCL (Hewlett-Packard) and PostScript (Adobe) — competing printer languages in the laser and office segment.
  • CUPS and Ghostscript — the Unix and Linux printing infrastructure through which ESC/P-R drivers operate.

Timeline

  1. October 1980

    Epson MX-80 dot-matrix printer released; commonly cited as the progenitor of the ESC/P escape-sequence approach. The branded "ESC/P" name was codified later.

  2. Mid-1980s

    Epson FX (9-pin) and LQ (24-pin, "letter quality") families spread ESC/P as a de facto impact-printer control language; competitors offered ESC/P emulation. (era-level)

  3. Early 1990s

    ESC/P 2 introduced as a backward-compatible superset adding built-in scalable fonts and enhanced graphics. (era-level; exact year not established in primary Epson sources)

  4. December 1997

    EPSON ESC/P Reference Manual published, documenting ESC/P and ESC/P 2 commands.

  5. 2000s

    ESC/P-R adopted for modern Epson inkjet printers; Epson distributes an ESC/P-R CUPS filter driver for Linux. (era-level)

  6. June 2004

    A later edition of the EPSON ESC/P Reference Manual (NPD1013-00) published.

Frequently asked questions

What does ESC/P stand for?
ESC/P stands for Epson Standard Code for Printers. It is a stream-based printer control language in which escape sequences — control strings beginning with the ASCII ESC character (decimal 27) — are embedded among ordinary character data to control formatting, positioning, and graphics.
How is ESC/P different from PostScript?
ESC/P is a device-facing control language for specific Epson printer hardware, while PostScript is a device-independent, programmable page-description language. ESC/P offers no general computation and does not describe portable pages, so complex layout must be resolved on the host before ESC/P is emitted.
What are ESC/P 2, ESC/P-R, and ESC/POS?
They are members of the ESC/P family. ESC/P 2 is a backward-compatible superset adding built-in scalable fonts and enhanced graphics; ESC/P-R is a raster-centric language for modern Epson inkjet printers driven from host-side drivers; and ESC/POS is a variant tailored to point-of-sale receipt and thermal printers.
Is ESC/P still used today?
Yes. Current Epson impact/dot-matrix printers still support ESC/P and ESC/P 2, modern Epson inkjets use ESC/P-R (via operating-system drivers and CUPS filters), and point-of-sale receipt printers widely use the ESC/POS command set.
How does ESC/P work on Linux?
Epson distributes the Epson Inkjet Printer Driver (ESC/P-R) for Linux, described in its own documentation as a filter program used with the Common UNIX Printing System (CUPS). It plugs in as a CUPS filter, typically alongside Ghostscript, and is packaged as RPM and DEB; OpenPrinting distributes the same family as epson-escpr.

Source transparency (8 sources)

These references support claims made in this entry. The archive uses verified institutional and public-domain sources only; see Source policy.

Sources consulted (8)

Continue in the archive

Related reading