EPS File Documentation


Summary

An EPS (Encapsulated PostScript) file is a vector graphic — usually a logo, illustration or print artwork — written as a self-contained program in Adobe’s PostScript page-description language. Adobe introduced it in 1987 as a graphic designed to be embedded inside a larger document, its size declared by a required %%BoundingBox comment. Its MIME type is application/postscript. Because an EPS can carry executable PostScript, Microsoft disabled EPS insertion in Office in 2017, so it is now largely a legacy format superseded by PDF and SVG.

Technical details

FeatureValue
Full nameEncapsulated PostScript
File extension.eps
MIME typeapplication/postscript
Format typePostScript-based vector graphics (may embed raster + preview)
Based onAdobe PostScript page-description language
DeveloperAdobe Systems
Introduced1987
SpecificationAdobe EPSF Format Specification (document 5002)
Open standardPartial — PostScript is documented but Adobe-owned
EncodingASCII PostScript text; or binary “DOS EPS” with a preview
ASCII header%!PS-Adobe-3.0 EPSF-3.0
Magic number (ASCII form)25 21 50 53 (%!PS)
Magic number (binary DOS EPS)C5 D0 D3 C6
Required comment%%BoundingBox: llx lly urx ury (artwork extent, in points)
Preview optionsTIFF or WMF (binary form); EPSI (interchange form)
Trailer%%EOF
Renderer neededA PostScript interpreter (e.g. Ghostscript)
Office supportRemoved from Microsoft Office in April 2017 (CVE-2017-0261)
Related extensions.ps, .ai, .pdf, .svg, .epsf
Specification URLadobe.com/…/5002.EPSF_Spec.pdf
File signature (magic bytes)
25 21 50 53 (%!PS) · C5 D0 D3 C6 (DOS EPS)

Offset 0. A plain-text EPS begins with the ASCII string %!PS-Adobe- (hex 25 21 50 53), the standard start of a PostScript program. A binary “DOS EPS” (EPSF) instead begins with the four bytes C5 D0 D3 C6, a fixed 30-byte header that stores the byte offset and length of the embedded PostScript section plus an optional TIFF or WMF screen preview, so a layout program can show a thumbnail without running the PostScript. Either way, a valid EPS must contain a %%BoundingBox: comment declaring the artwork’s extent.

What is an EPS file?

EPS stands for Encapsulated PostScript. Adobe Systems introduced it in 1987 as a self-contained subset of PostScript, the page-description language that drove the first generation of laser printers and imagesetters. The word encapsulated is precise: an EPS is a single graphic packaged so it can be placed inside another document — a page in QuarkXPress or InDesign, an ad, a print job — rather than printed as a standalone page. A mandatory bounding-box declaration tells the host document exactly how much space the artwork occupies.

An EPS is not a passive image file the way a PNG is. It is a program. The bytes inside are PostScript operators — instructions like “move to this point, draw a curve, fill with this colour” — that a PostScript interpreter executes to produce the picture. That design is what made EPS the dominant exchange format for logos and print artwork for two decades, and it is also the reason the format needs special handling for both rendering and security, both covered below.

The PostScript body: a stack program that draws

PostScript is a stack-based language, and an EPS body is a short PostScript program written in it. Operands are pushed onto an operand stack, and operators consume them. Coordinates are in points (1/72 inch), with the origin at the bottom-left and the y-axis pointing up. A fragment that draws a filled triangle looks like this:

newpath              % start a new path
100 100 moveto       % push x=100 y=100, move the current point there
200 100 lineto       % line to (200,100)
150 200 lineto       % line to (150,200)
closepath            % close back to the start
0 0 1 setrgbcolor    % set fill colour to blue (r=0 g=0 b=1)
fill                 % fill the path
showpage             % emit the page

Everything is postfix: 100 100 moveto means “push 100, push 100, then call moveto”. Paths are built from straight segments (lineto) and cubic Bézier curves (curveto), then painted with fill or stroke. Because the geometry is described mathematically rather than as pixels, the artwork is resolution-independent: it renders sharp at any size, which is why EPS became the standard for scalable logos. An EPS may also define and embed font outlines, and it can include raster images through operators such as image, so a single file can mix vector paths with an embedded bitmap.

One rule distinguishes EPS from a plain .ps file. A standalone PostScript page may call operators that change global state or eject multiple pages; an encapsulated graphic is forbidden from doing so, because it must behave predictably when dropped into a host document. It should call showpage in a way the host can neutralise, must not permanently alter the graphics state it inherits, and must confine itself to the region its bounding box declares.

DSC comments and the required BoundingBox

An EPS carries structured metadata in Document Structuring Convention (DSC) comments — lines that begin with %% or %!. To PostScript these are ordinary comments and are ignored during rendering, but to layout software they are the machine-readable contract about the file. The first line is the identifier:

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 200 150
%%HiResBoundingBox: 0 0 200.00 150.00
%%Creator: Adobe Illustrator
%%Title: logo.eps
%%CreationDate: 2026-07-20
%%EndComments
... PostScript program body ...
%%EOF

The %!PS-Adobe-3.0 EPSF-3.0 first line declares both the PostScript level and that this is an EPSF (encapsulated) file. The single most important line is %%BoundingBox: llx lly urx ury: four integers giving the lower-left and upper-right corners of the artwork in points. This is what “encapsulates” the graphic — the host document reads the bounding box to know the image’s exact size and where to clip it, without executing a line of PostScript. An optional %%HiResBoundingBox supplies floating-point precision. A missing or wrong bounding box is the classic cause of an EPS that imports with wrong margins or clipped edges. The file ends with the %%EOF trailer.

The binary DOS EPS header and screen preview

Pure PostScript has no thumbnail, so a layout program would have to run the interpreter just to show a preview. To avoid that, Adobe defined a binary wrapper — the “DOS EPS” or EPSF-with-preview form — that prepends a fixed 30-byte header pointing at the file’s sections. The header always begins with the four magic bytes C5 D0 D3 C6:

Offset  Size  Field
  0      4    Magic number  C5 D0 D3 C6
  4      4    Offset of the PostScript section (little-endian)
  8      4    Length of the PostScript section
 12      4    Offset of a WMF preview (0 if none)
 16      4    Length of the WMF preview
 20      4    Offset of a TIFF preview (0 if none)
 24      4    Length of the TIFF preview
 28      2    Checksum of the header (or FFFF)

Only one preview type is used at a time: a Windows Metafile (WMF) or a TIFF bitmap. A layout application reads the header, jumps to the preview offset, and displays that low-resolution image on screen while sending the real PostScript to the printer. The multi-byte offsets and lengths here are little-endian, a DOS/Windows convention — note this differs from the PostScript body itself, which is plain text. A third variant, EPSI (EPS Interchange), embeds an ASCII hex preview instead so the whole file stays 7-bit clean for transfer over text-only channels.

Why EPS needs a PostScript interpreter

Because an EPS must be executed, an application cannot display it without a PostScript engine. On the free desktop that engine is almost always Ghostscript. Inkscape and GIMP do not interpret PostScript themselves; they hand the file to Ghostscript, which rasterises or converts it, and only then can they show or import it — which is why both require Ghostscript to be installed (and on Windows, on the PATH) before they will open an EPS. This execution model is also why converting EPS to PDF is clean and near-lossless: PDF is built on the same PostScript imaging model, so Ghostscript essentially runs the program once and records the resulting drawing operations into the PDF. The same relationship links EPS to Adobe Illustrator’s .ai, which is itself a PostScript/PDF-based format.

Executable PostScript and the 2017 Office block

EPS is unusual among image formats because it contains executable code, and a PostScript interpreter is a full language runtime. That combination has been exploited. In 2017 attackers used malicious EPS files to achieve remote code execution through flaws in the interpreter that Office used, tracked as CVE-2017-0261 and CVE-2017-0262. In response, Microsoft disabled EPS image insertion across all versions of Office in April 2017, which is why Word and PowerPoint refuse EPS today and users are told to convert to PNG, SVG or PDF first. Treat an EPS from an unknown sender like any active content: open it only in a current, patched vector application, keep Ghostscript updated, and do not try to re-enable EPS support in Office. A plain logo EPS from a trusted source is fine; the risk is the interpreter, not ordinary artwork.

Frequently asked questions

Is EPS a vector or a raster format?

Primarily vector. An EPS stores artwork as PostScript path and drawing operators, so it scales to any size without losing sharpness. It can embed a raster image inside those operators, and the binary DOS EPS form carries a low-resolution TIFF or WMF preview, but the artwork itself is resolution-independent vector data.

Why do Inkscape and GIMP need Ghostscript to open an EPS?

Because neither interprets PostScript on its own. An EPS is a PostScript program that must be executed to produce the picture, and Ghostscript is the interpreter that does it. Once Ghostscript is installed and on the system PATH, those applications can render and import EPS files.

What is the %%BoundingBox line for?

It declares the artwork’s exact extent in points as four numbers (lower-left and upper-right corners). That is what lets an EPS be encapsulated: a host document reads the bounding box to size and clip the graphic without executing any PostScript. A missing or incorrect bounding box causes the image to import with wrong margins or clipped edges.

References