What is the HPGL file format?
.hpgl files contain graphical information for a plotter or Hewlett-Packard printer. They are files in HP-GL - Hewlett-Packard Graphics Language - a vector command language first introduced in 1977 with the HP 9872A pen plotter. Since then it has undergone modifications: the more capable HP-GL/2 standard was developed in the 1990s, adding scalable fonts, polylines, and RTL raster extensions, and is still widely supported by HP devices and compatible cutters.
What does an .hpgl file look like?
The HP-GL command stream consists of two-letter mnemonic codes and optional parameters, depending on their type. Commands can be divided into groups:
- vector:
PD- Pen Down,PU- Pen Up,PA- Plot Absolute - characters:
SS- Select standard character set,CA- Designate alternative character set - lines:
SP- Select pen,VA- Adaptive velocity - digitize:
DP- Digitize point,OD- Output digitized point and pen status - axes:
XT- X axis tick,YT- Y axis tick - settings:
DF- Set default values,OE- Output error,IN- Initialize
The end of each command is marked by a semicolon. Parameters can have an integer or decimal value, or the form of a character (char).
Device compatibility
Some specific records in HP-GL may be related to a particular device model, so not every file is compatible with every plotter. .hpgl files are plain ASCII text, making them human-readable; their contents can be viewed in any text editor. The HP-GL language succeeds AGL (A Graphics Language), used by HP minicomputers for plotter handling.
The same HP-GL language appears under several interchangeable extensions: .plt, .hpg, .hgl, .gl2, and .prn. For modern interchange, .hpgl files are often converted to SVG or DXF. HP-GL/2 is a strict superset of the original HP-GL, and today the format remains in wide use with vinyl cutters, laser cutters, and pen-cutter machines from Roland, Graphtec, and similar manufacturers.
Security & safety
RISK: LOWHP-GL .hpgl files are plain-text command streams and are not executable, posing negligible direct risk. Practical pitfalls: a .hpgl from a CAD PostScript/PCL driver may not be true HP-GL - no security issue but the viewer will show nothing useful. Avoid download portals bundling adware under the guise of 'free HPGL viewers'; use the reputable tools above or browser-based converters. Do not upload confidential engineering drawings to unknown online services.
Format details
in a nutshell- HP LaserJet PCL plot file (misnamed) - Some CAD print drivers write PCL data to a .hpgl file - content is PCL, not HP-GL; check the first bytes.
Programs that open HPGL files
Technical details
deep spec| Encoding | Plain text, ASCII (7-bit); human-readable in any text editor |
| Command syntax | Two-letter mnemonic codes (e.g. PD, PU, SP, PA) followed by optional parameters; each command terminated by a semicolon |
| File signature | No fixed binary magic number; files typically begin with IN; (Initialize) or a two-letter HP-GL mnemonic; HP-GL/2 streams may start with ESC%-12345X (PJL UEL prefix) |
| MIME type | application/vnd.hp-HPGL (IANA-registered) |
| Colour model | Pen-based; colour specified by pen number via SP (Select Pen) command, not by bit depth |
| Scalability | Vector; scales to any output size without quality loss; bounded only by plotter/page setup, not pixels |
| Interchangeable extensions | .plt, .hpg, .hgl, .gl2, .prn - all store the same HP-GL command language |
| Versions | HP-GL (original, late 1970s) and HP-GL/2 (1990s strict superset, adds polylines, scalable fonts, RTL raster extensions) |
| Typical size | A few KB to several MB, scaling with drawing complexity rather than image area |
| Device compatibility | Some commands are model-specific; not all files are compatible with all plotters or cutters |
| Current use | Widely used by vinyl cutters, laser cutters, and pen-cutter machines (Roland, Graphtec, Silhouette, Cricut) |
| Released | HP-GL: late 1970s (HP 9872A plotter, 1977); HP-GL/2: 1990s |
| Latest version | HP-GL/2 with RTL extensions; language effectively frozen |
| Open standard | Yes · royalty-free |
| Specification | en.wikipedia.org |
HPGL conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about HPGL files.