Categories About Us Contact Us Become a Member

What Is an HPGL File? Plotter Instructions, Written in Plain Text

HPGL is a language, and your file holds commands written in it. Jump to your question below, or work through it in order.

By Neeraj Singh ~24 min Updated Sep 2026 Checked against HP's own PCL guide
Short answer

An HPGL file holds drawing instructions for a plotter. Hewlett-Packard named the language in 1977, and every line in your file orders the machine to lift its pen, drop it or move somewhere.

It is plain text. Open it in Notepad and you can read every instruction, which settles most of what people arrive here asking.

1 What is an HPGL file? Hewlett-Packard Graphics Language, and where it came from

HPGL stands for Hewlett-Packard Graphics Language, and it was originally developed by Hewlett-Packard to drive its own pen plotters. HP began marketing its two-letter graphics language under that name in 1977, alongside the 9872A, its first multi-pen plotter. That machine cost $4,200, held four pens and capped them so they would not dry out between jobs.

The language spread far past HP. Wikipedia puts it plainly: HP-GL was introduced with the 9872 in 1977 and became a standard for almost all plotters. Plotters built between 1980 and 2000 very likely understood these commands, whoever made them.

One detail explains almost everything people find strange about these files. HPGL was never designed to sit on a disk. It was orders streaming down an interface cable to the plotter, which drew while it listened. Saving those orders came later, and the language never gained any of the things real file formats have.

HPGL is text from end to end, based on two-letter commands. No header, no index, no checksum and no magic number. HPGL files start on their first command and end when the commands run out. That is why nothing identifies it automatically, and also why there is very little in it to break.

HPGL file format at a glance

HPGL file format at a glance
HPGL file extension
.hpgl, .hpg, .hgl, and most often .plt
Stands for
Hewlett-Packard Graphics Language
Developed by
Hewlett-Packard
Named in
1977, with the HP 9872A plotter
Kind
Command language, not an image
Encoding
Plain ASCII text
Signature
None. No magic number at all
Common first line
IN;, meaning initialize
Plotter unit
0.025 mm, 1,016 to the inch
Media type
application/vnd.hp-HPGL, registered with IANA
PRONOM
x-fmt/83 and x-fmt/293
Current version
HP-GL/2, inside PCL 5 since 1990

What an HPGL file is not

Not an image file One large directory calls these printer instruction files and then files them under vector image files. No picture is stored anywhere in one. Orders are, and something has to carry them out.
Not corrupted by a virus The older version of this page blamed viruses, corruption and broken registry entries. None of those explains it. See section 3.
Not locked to HP hardware HP invented it and everybody copied it. Plotters from other makers advertised HPGL support for twenty years, and PLT plotter files off those machines hold the same commands.
Not always named .hpgl Most land on disk as .plt instead, because the program that wrote one chose the name and nothing in the language has an opinion. See section 7.

Commands are two letters, then numbers, then a semicolon. PA5000,1000; orders the pen to one point. Follow enough of them in order and the drawing appears, though it is never in the file.

2 HPGL is a language, not a picture The one idea that makes everything else obvious

Think about a recipe. It lists what to do and in what order, and it contains no food. HPGL files work the same way, and the viewer does the cooking. When you open one and see text, nothing is wrong. Text is all there ever was.

Every instruction follows one shape. Two letters name the command, and HP calls those two letters its mnemonic. Numbers give it parameters, commas act as the separator between them and the semicolon is the terminator that ends it. PA means plot absolute, so PA5000,1000; sends the pen to a point 5,000 units across and 1,000 units up.

How one HPGL command is put together. The command PA5000,1000 breaks into four parts: the two letters PA name the command, which means plot absolute; 5000 is the first parameter; a comma separates the parameters; 1000 is the second parameter; and a semicolon ends the command. Below it, the three parts of a plot file in order: setup commands, then drawing commands, then the commands that end the job.
Two letters, some numbers, a semicolon. Thousands of times over.

How an HPGL command is built

Four moves cover most of any HPGL file. PU lifts the pen, PD drops it, PA moves to fixed coordinates measured from the origin and PR moves by an offset from wherever the pen already sits. Lift, move, drop, move. Lines get drawn on the moves made with the pen down.

The HPGL commands worth knowing, grouped the way HP groups them.
GroupCommandWhat it orders
Set upINInitialize. Almost always the first thing in the file
DFGo back to default settings
Area and scaleIPPlace the scaling points P1 and P2
SCLay your own coordinate system over them
IWSet a window, and clip anything outside it
Pen and movementPUPen up
PDPen down
PAPlot absolute, to a fixed point
PRPlot relative, by an offset
ShapesCIDraw circles of the radius given
AADraw arcs around a center point
PM, FP, EPBuild a polygon, fill it, outline it
AppearanceSPSelect pens by number
LTSet line types, dotted or dashed
PWSet pen width in millimeters. HP-GL/2 only
PCSet pen colors. HP-GL/2 only
TextLBDraw labels, meaning text on the page
SISet character size
FinishPGAdvance the page

HP sorts these into five groups: Character, Vector, Polygon, Line and Fill Attribute, plus Configuration and Status. The names come from HP's own PCL guide, and they are worth knowing because viewer software often reports errors by group.

In the file

Orders. Lift the pen. Move here. Drop it. Draw circles of this radius. Select pen 3. Advance the page.

Not in the file

Pictures. No pixels, no preview, no thumbnail and no page size. Something has to execute the orders before anything appears.

This is the same idea behind EPS artwork files and PostScript files. Adobe's language and HP's both describe pages as programs that devices run. PostScript won the printing world and HPGL won the plotter, and the two of them spent the 1990s inside the same machines.

No operating system ships an HPGL viewer. Windows never has and macOS never has, so double-clicking one does nothing. That is the expected result, not a fault. Install a free viewer or convert the file. The file itself is almost certainly fine.

3 Why your HPGL file will not open A missing viewer, not a damaged file

People land here after double-clicking an archived HPGL file and getting nothing back from Windows. The instinct is that something inside went bad. Almost never. Microsoft has never shipped anything that reads HPGL, so there is nothing for the double-click to hand an HPGL file to.

The older version of this page listed four reasons Windows cannot open an HPGL file. Three of them are wrong and the fourth is right for the wrong reason. They are worth walking through, because those same four sentences appear on dozens of file-help pages.

It is not a virus, not the registry and not damage. No viewer is installed, and that is the entire story.

Four HPGL reasons that are not the reason

“A virus is interfering with the file” Malware does not single out HPGL files. If your machine were infected, plot files would be the least of it.
“The file is broken and corrupted” Possible but rare, and you can settle it in thirty seconds by opening the file in any text editor. See section 6.
“Registry entries are invalid or corrupt” No registry entry exists to break, because Windows never associated the extension with anything in the first place.
“No correct default application” True, and it is the entire answer. Nothing on a clean machine opens HPGL. Section 4 lists what to install.

What the HPGL symptom is telling you

Common HPGL symptoms and where the fault actually sits.
What you seeWhat it usually meansStart with
Double-click does nothingNothing on the machine reads HPGLFree viewers, or hp2xx
Windows offers the StoreThe extension has no associationIgnore it and install a viewer
It opens as readable textWorking exactly as intendedNothing. That is HPGL
Drawing appears, wrong sizeScaling points were guessedSee section 9
Drawing appears, half of it missingClip windows, or truncationOpen it in Notepad and look at the end
Circles come out as nothingYour importer skips the CI commandUse hp2xx, not Inkscape
Blocks of random letters insideThe PE command, encoded on purposeNothing. See section 8
Printer spits out pages of textHPGL went to a printer that speaks PostScriptConvert to PDF instead

That last row is in the media type registration. When HP registered application/vnd.hp-HPGL it filed a security note. That note reads: delivery of this format to a printer which is not capable of parsing the format may result in poor printer behavior. Pages of stray commands is what poor printer behavior looks like.

Two free answers cover almost everybody. Text editors tell you what is in the file. hp2xx turns it into something you can look at. Neither costs anything and neither needs a plotter.

4 What opens an HPGL file Free tools first, because the free ones are the good ones

Programs that open HPGL files split into two camps. Some show you the drawing, and some show you the commands behind it. Most guides answer this with twenty product names, half of them discontinued and most of them paid. The honest list is short.

Free software that opens HPGL files

Free software that opens or converts HPGL files, and what every one is good for.
SoftwareRuns onWhy choose it
Any text editorEverywhereStart here. Notepad, TextEdit or VS Code shows you every command in an HPGL file
hp2xxWindows, Mac, LinuxThe workhorse. GNU software that converts HPGL into SVG, PDF, DXF, EPS, PNG and more
ideaMK HPGL ViewerWindowsOpens HPGL, HP-GL/2 and PLT files and exports PNG, JPG, GIF, TIFF and BMP
InkscapeWindows, Mac, LinuxImports the line work for editing. It skips circles and arcs, so check the result
ImageMagickWindows, Mac, LinuxHandles HPGL through a helper, which is useful inside a script

Inkscape earns its warning. Its HPGL importer does not understand the CI circle command, and arcs and polygons give it the same trouble. That gap is an open issue on Inkscape's own tracker. Floor plans full of straight walls import beautifully, and schematics full of circles come in with holes.

Paid viewer and CAD software

Commercial software that reads HPGL, and when paying is worth it.
SoftwarePlatformWhen it earns the money
ViewCompanionWindowsBatch conversion of large plot archives, with markup and measurement
CADSoftTools ABViewerWindowsViewing HPGL beside DWG and DXF from the same window
CorelDRAW Graphics SuiteWindows, MacEditing the drawing as artwork. See CDR files
Canvas X ProWindowsTechnical illustration, where the plot is the starting point
Lemkesoft CADintoshMacOne of very few Mac tools that still reads plotter files
vhf interservice CenonMac, LinuxCAM work, where the plot drives cutting machines

One file, once? Open it in Notepad to confirm it is really HPGL, then run hp2xx to get your PDF. Nothing needs installing beyond that, and nothing needs paying for.

The software lists on the big directories have rotted. One of them was last updated in December 2012 and still recommends CorelDRAW Graphics Suite X6, Corel PaintShop Pro X5 and ACD Systems Canvas 14. Another lists SwiftView first, marked as verified, years after it was discontinued.

The older version of this page copied one of those lists and broke it. It named vhf interservice Cenon as “VHF interservice canon”, and told readers to select CorelDRAW Graphics Suite X8 or PaintShop Pro X9 from the Open with menu.

One command converts HPGL files to PDF, SVG or DXF. hp2xx -m pdf drawing.plt is the entire job, it is free and it runs on every desktop operating system.

5 Converting HPGL to PDF, SVG or DXF One free tool covers almost every destination

Converting is usually the right move, because HPGL files that only three programs can read are poor places to keep drawings. Where yours should go depends on what happens next. Send someone a PDF file. Put it on a website as SVG. Hand it back to CAD software as DXF.

The hp2xx command that converts an HPGL file

hp2xx -m pdf drawing.plt

The -m flag selects the output mode. Change three letters and the destination changes with it. GNU describes it this way: it reads HPGL ASCII source files, interprets them and converts them into either another vector-oriented format or one of several rasterfile formats.

Which output format to convert HPGL into

Where an HPGL file should go, and the hp2xx mode that gets it there.
You wantConvert toMode
Send it to somebodyPDF-m pdf
Put it on the webSVG-m svg
Open it in CAD softwareDXF-m dxf
Drop it into a documentEPS-m eps
Pictures for a reportPNG-m png
Archive mastersTIFF-m tiff
Drive CNC machinesG-code-m nc

SVG and DXF keep the drawing as lines, so it stays sharp at any size and stays editable. PNG and TIFF flatten it into pixels at one fixed size. For technical drawings, choose vector destinations unless somebody specifically asked for pixels.

Converting a folder of plotter files

1 Open one file in Notepad first. Confirm it starts with IN; or another two-letter command. Some files named .plt hold something else entirely.
2 Convert that one file and look at it. Check the drawing is complete and the proportions are right before you process hundreds.
3 Watch for multi-page files. hp2xx writes one output file per page, and the -P option limits it to a page range.
4 Loop over the folder. One line in a shell or batch file handles an entire archive, and nothing has to be watched while it runs.
5 Keep the originals. Converted drawings are copies of what somebody once plotted. The HPGL file is the record.
hp2xx -m svg -f floorplan.svg floorplan.plt
hp2xx -m pdf -P 1:3 drawing-set.plt

Online converters will do this too, and they get a copy of your drawing. For sample files that hardly matters. For your client's site plan or your production part it matters a great deal, and hp2xx runs on your own machine in less time than the upload takes.

Open the file in Notepad. You will see short commands, one after another, starting with something like IN;. Reading them settles whether the HPGL file is complete faster than any repair tool.

6 How to read an HPGL file yourself Thirty seconds in a text editor answers most questions

This is the trick nobody on the first page of results tells you to try, and it is the single most useful thing on this HPGL page. HPGL files are plain text. Right-click yours, open it with Notepad on Windows or TextEdit on macOS, then look.

The three parts of an HPGL file

Every HPGL file runs in the same three stages. Initialization sets the machine up and chooses a pen. Plot data does the drawing, and it is nearly all of the file. Termination parks the pen and ends the job.

A short HPGL file read from top to bottom. IN starts the job and IP places the scaling points. SP1 selects pen 1. PU lifts the pen and moves it, PD drops it and traces a box, and CI draws a circle. SS and DT set up text before LB draws the words. The last line lifts the pen, sends it home and puts it away.
Every line is an order. Follow them and the drawing appears.

A real HPGL file, line by line

Here is what a short one looks like, with the meaning of every line beside it. A typical HPGL file follows the same pattern, with thousands more coordinate lines in the middle.

A complete HPGL file, and what every command orders the plotter to do.
LineWhat it orders
IN;Initialize. Clear everything and start a job
IP;Put the scaling points P1 and P2 back where they started
SP1;Select pen 1
PU0,0;Lift the pen and move to the origin
PD100,0,100,100,0,100,0,0;Drop the pen and trace four corners, drawing a box
PU50,50;Lift again and move to the middle
CI25;Draw the circle, radius 25, around that point
SS;Select the standard character set
DT*,1;Mark the asterisk as the end of labels, and do not draw it
PU20,80;Lift and move to where the text should start
LBHello World*;Draw the words Hello World
PU;PA0,0;SP;Lift, go home, put the pen away. The job is over

Telling a complete file from a truncated one

Scroll to the bottom. Finished HPGL files end on a complete command, terminated by a semicolon. Most park the pen with something like PU;PA0,0;SP; or advance the page with PG1;. One that stops halfway through a coordinate was cut off, and where it stops is where the transfer or the save failed.

That is as close to file repair as HPGL gets, and it is also as much as it needs. With no index and no checksum, truncated HPGL files still convert. You simply get the part of the drawing that arrived.

Complete

Ends on a semicolon. Often PU;PA0,0;SP; or PG1;. Every command in the file is complete.

Cut off

Ends mid-number. Something like PD4820,31 with no semicolon and nothing after it.

One thing in Notepad will look like damage and is not. Blocks of dense random letters after the characters PE are the Polyline Encode command doing its job. HP-GL/2 packs coordinates into base 64 or base 32 so the file travels faster, and that part is genuinely not meant for human eyes. Section 8 covers it.

Your HPGL file is probably named .plt. HPGL never defined a file extension, because when it was written there was no file. Whichever program saved the plot chose the name, and they all chose differently.

7 Why HPGL files are named .plt, .hpg and half a dozen other things Nothing in the language ever named the file

People search for HPGL and then cannot find an HPGL file anywhere on the disk. The reason is that the extension came from outside. Nothing in the language names a specific one.

HP named a language in 1977 for commands traveling down an interface cable to a plotter that was drawing as they arrived. Saving those commands was somebody else's idea years later, and every program that did it made up its own name.

File extensions that hold HPGL, and where every one tends to come from.
ExtensionUsually written by
.pltThe commonly used one. AutoCAD and most CAD applications, plotting to a file
.hpglTools that name the file after the language
.hpgOlder DOS-era software, squeezed into three characters
.hglAnother three-character abbreviation of the same thing
.hp, .hp1, .hp2Sample sets and older plotting utilities
.gl2Files that specifically hold HP-GL/2
.prn, .splCaptured print jobs and spool files, which may hold anything

A PLT file is usually HPGL, and not always

This is the honest answer, and one vendor page is the only result on the first page of Google that gives it. PLT is a file name. HPGL is a language. They are not the same thing.

Most files named .plt contain HPGL, and some contain something else entirely, so open yours and look at the first line before assuming anything.

The reverse trap catches people too. A file named .prn or .spl is a captured print job, and a captured print job might hold HPGL, PostScript or raw printer data. Only the first few characters tell you which.

Landed here with a .plt file? Our PLT file format page covers the extension itself and what else can hide behind it.

This is also why no tool can identify these files reliably. The file utility on Linux and Mac names thousands of formats from their opening bytes, and it could not name HPGL until December 2022. The developer who wrote that patch put the problem in one line: the Hewlett-Packard Graphics have no unique magic pattern. Section 11 has the rest.

HP-GL/2 arrived in 1990 with pen width, color, filled polygons and a packed coordinate form. It then went into PCL 5, which is why laser printers have understood plotter commands for thirty-five years.

8 HPGL against HP-GL/2 The second version stopped being about pens

The original language assumed a carousel of physical pens. You selected pen 3 and pen 3 came down. Line weight meant whichever nib was in the holder, and color meant whichever ink somebody loaded that morning.

Inkjet and laser machines had no pens, so HP-GL/2 stopped pretending. PW sets a line width in millimeters. PC sets a color directly. NP sets the number of pens in the imaginary carousel. Filled polygons arrived, which a pen plotter could only ever fake by scribbling.

What changed between HPGL and HP-GL/2.
HPGLHP-GL/2
Arrived19771990
Built forPen plottersInkjet and laser printers
Line widthWhichever pen is loadedSet in millimeters with PW
ColorWhichever pen is loadedSet directly with PC
Filled shapesScribbled by handReal polygon fill
CoordinatesPlain numbersPlain numbers, or packed with PE
Readable in NotepadAlwaysMostly, apart from PE blocks
Lives insideIts own filePCL 5, on every HP laser printer
The dates that matter for HPGL. Hewlett-Packard named the language in 1977 with the 9872A plotter. HP-GL/2 arrived in 1990 with pen width, color and filled polygons. PCL 5 shipped in March 1990 on the HP LaserJet III and carried HP-GL/2 inside it, which is why office printers still understand plotter commands today.
Named for a four-pen carousel, still running inside office printers.

How HP-GL/2 got into every laser printer

PCL 5 shipped in March 1990 on the HP LaserJet III, and it brought the HPGL language with it. HP's own developer documentation says PCL 5 incorporates HP-GL/2 functionality that allows the printing of HP-GL/2 vector graphics files. In HP's manuals the chapter covering it is titled vector graphics.

A printer switches into HP-GL/2 with the escape sequence Esc%#B, draws, then switches back with Esc%#A.

That decision kept the language alive long after the last pen plotter was sold. A drawing language designed for a four-pen carousel in 1977 is still sitting in the firmware of office printers, and almost nobody using one has heard of it.

The PE command, and why part of your file looks like noise

HP-GL/2 added PE, the Polyline Encoded command. HP's description is that it combines a sequence of PA, PR, PU, PD and SP commands into a coded format, which reduces file size and transmission time. Coordinates go into base 64 or base 32 and travel as ordinary characters.

The encoding is simple enough to describe and useless to read. A positive number is doubled. A negative number has its sign dropped, gets doubled and gains one. The result converts to base 64 and travels least significant digit first.

So a PE block is a wall of letters, and it is the one part of an HPGL file a person cannot read.

What you can read

Everything else. Setup, pen changes, labels, circles, page commands and every plain coordinate in the file.

What you cannot

A PE block. Packed coordinates in base 64. Not damage, not encryption, just compression for a slow cable.

HP RTL rides in the same stream. Raster Transfer Language carries actual pixels, so a modern HPGL file can hold vector commands and a raster image together, mixed with PCL.

That mixture is why some converters handle one file perfectly and choke on the next. It is also why a few HPGL files carry no escape sequence to announce the switch.

The numbers in the file are plotter units of 0.025 mm, and the file usually carries no paper size at all. The scaling points decide how those numbers land, and different software guesses differently.

9 Why your HPGL plot comes out the wrong size The most common complaint, and it is built into the format

An HPGL drawing opens, everything looks right, then it prints at half the size it should. Or it fills four sheets. Or the right-hand third is missing. This is the commonest HPGL problem there is, and nothing is broken when it happens.

What a plotter unit measures. One plotter unit is 0.025 millimeters, so 40 units make a millimeter and 1,016 units make an inch. An A4 sheet is about 11,880 units along its long edge. The scaling points P1 and P2 mark opposite corners of the drawing area, and where they sit decides how large the finished plot comes out.
Nothing in the file says what size the paper is.

Plotter units, and what the numbers actually mean

Every coordinate in an HPGL file is counted in plotter units. HP's own wording is that one plotter unit equals 0.025 mm or 0.00098 inches. That works out at 40 units per millimeter and 1,016 units per inch, so PA1016,0; moves the pen exactly one inch across.

Plotter units in an HPGL file, in the sizes people actually work in.
DistancePlotter units
1 plotter unit0.025 mm, or 0.00098 inch
1 millimeter40
1 inch1,016
An A4 sheet, long edgeAbout 11,880
An A0 sheet, long edgeAbout 47,600

P1 and P2, the two points that set the scale

Two points called P1 and P2 mark opposite corners of an HPGL drawing area. The IP command places them and the SC command lays your own coordinate system across them, so the file can count in user units of any size you choose. Where those two points sit decides whether the same file plots small or wall-sized.

When a file gives neither, the numbers stay raw plotter units and the viewer decides. When a file sets them for a sheet you no longer have, the viewer maps them onto whatever it does have. Both roads lead to a plot that is too small or too big, and neither means the file is damaged.

Fix it in the viewer, never in the file. Every HPGL viewer has a scale or fit-to-page setting, and that is the right place to solve this. Editing coordinates in a text editor to make a drawing bigger throws away the only accurate record of what was plotted.

Missing edges usually come from IW, which sets a clip window. Anything outside it is clipped on purpose. Search the file for IW and you will find the numbers that decided what got cut.

Inside PCL the same job is done by the picture frame. HP defines it as the destination rectangle on the logical page into which the HP-GL/2 graphic is placed. Same problem, different name: something outside the drawing has to decide how big it is, because the drawing itself never says.

Pen plotters are gone and the language is not. AutoCAD still ships an HP-GL/2 driver, cutting machines take it directly and every PCL 5 printer can carry out its commands.

10 Where HPGL is still used today Four places, and most people never see any of them

The HPGL language, written for a four-pen carousel in 1977, should be dead. It is not. HP made it the way printers talk about lines, and nothing since has bothered to replace that.

Four places HPGL commands still turn up

Inside every PCL 5 printer PCL 5 has carried HP-GL/2 since March 1990. An office laser printer switches into plotter mode, executes the drawing commands and switches back, many times a page.
AutoCAD, still today Autodesk ships a nonsystem HP-GL/2 driver that, in its own words, supports a variety of HP-GL/2 pen plotters and ink jet plotters. It also writes the HPGL files people find later.
Cutting plotters and vinyl cutters A blade follows the same pen-up and pen-down orders a pen would. Sign shops, vinyl cutters and craft machines take HPGL directly. Large-format printers do too.
Engineering and architecture archives Twenty years of drawings were plotted to file and never converted, especially in architecture, engineering and construction. Those folders are why most people arrive at this page.

Should you convert your plot files?

Nothing is coming to take these files away. The hp2xx converter will read one for as long as somebody compiles it, and the commands inside are simple enough that a new reader could be written in a weekend. The risk is not the format. The risk is that nobody in your building remembers what the drawings are.

Convert anything you need to send to another person, anything going into a modern CAD package and anything that is the only surviving copy of something built. Leave the rest where it is. An HPGL file costs almost nothing to store, and it stays the most accurate record of what was on that sheet.

Working with CAD exchange formats? IGS files and STP files move geometry between design packages, and STL files carry it to a 3D printer.

HPGL and PostScript spent the 1990s in the same machines. Adobe's language described type and shapes for printers while HP's described lines for plotters, and plenty of hardware understood both. Adobe's side of that split produced the PostScript page language and the EPS file format. HP's side produced plot files.

Registered, documented and impossible to detect. HP-GL has an official media type at IANA and a published reference book, and still no magic number, which is a combination almost nothing else manages.

11 HPGL format and structure The record, for anybody who needs to cite it

Nothing here helps you open an HPGL drawing. It is on record for two reasons. HP documented this language properly, which is rare among the formats on this site. And the identification story is genuinely unusual.

HPGL specification and registration

Where the HPGL format is written down, and how systems are meant to name it.
ItemValue
Media typeapplication/vnd.hp-HPGL, registered with IANA
Registered byHewlett-Packard, through its Customer Service Center
Published specificationThe HP-GL/2 and HP RTL Reference Guide, Addison-Wesley
ISBN cited in the registration0-201-63325-6
Transfer encodingBinary, because lines can run very long
PRONOM, plotter filesx-fmt/83, Hewlett Packard Vector Graphic Plotter File
PRONOM, HPGLx-fmt/293, Hewlett Packard Graphics
SignatureNone

That registration is worth a moment. Most of the formats covered on this site have no official media type at all, and their tools fall back on an invented one. HP filed a real registration, and it is still the correct answer when software asks what an HPGL file is.

Why no tool can identify an HPGL file by hand

The file utility names thousands of formats by reading their opening bytes. Until December 2022 it had nothing for the format, and reported real HPGL files as plain text or as data. A contributor fixed that, and put the reason in one sentence: the Hewlett-Packard Graphics have no unique magic pattern.

The patch guesses instead. It watches for IN; or SP or PS at the very start of a file. For HP-GL/2 it looks for the escape sequence that switches a printer into graphics mode. Real samples in that same thread open with IN;PU;SP1;PU0,0;PD0,90;, DF;IN;LT;PU1000,1000;, NP8; and PA4000,3000;. No two agree.

What HPGL has

A registered media type, a published book and thirty-five years of software. It is better documented than most formats that came after it.

What it never had

A magic number, a header or a version field. No HPGL file existed to put them in when the language was written.

The older version of this page was set to noindex. It carried noindex,nofollow in its head, the only guide on FileFix that did, which meant search engines were told to skip it for years. That is fixed here along with everything else.

Frequently asked questions about HPGL files

What is an HPGL file?
An HPGL file holds Hewlett-Packard Graphics Language, a set of drawing instructions for a plotter. Every line tells the machine to lift a pen, drop it or move it somewhere. The file is a to-do list, not a picture.
Can I open an HPGL file in Notepad?
Yes, and it is the fastest thing to try. HPGL is plain text. You will see short commands like IN; and PU100,200; one after another. If the text stops mid-command, the file was cut off during a save or a transfer.
What opens an HPGL file for free?
hp2xx converts one to SVG, PDF, DXF or PNG and costs nothing. ideaMK HPGL Viewer opens HPGL and PLT on Windows. Inkscape imports the line work, though it skips circles and arcs. Any text editor reads the commands.
Why will my HPGL file not open?
Because no operating system ships a viewer for it. Windows and macOS have never had one. The file is almost certainly fine, and a double-click finding nothing is the expected result, not a sign of damage.
Is my HPGL file corrupt?
Open it in a text editor and look. There is no header, no index and no checksum in an HPGL file, so there is very little to break. A truncated file shows you exactly where it stops, usually in the middle of a coordinate.
What does HPGL stand for?
Hewlett-Packard Graphics Language. HP named it in 1977 alongside the 9872A, its first multi-pen plotter. The language went on to run almost every plotter made, whoever built it.
Why is my plot the wrong size?
Because the numbers in the file are plotter units of 0.025 mm, and the file usually carries no paper size at all. The scaling points P1 and P2 decide how those numbers land on paper, and a viewer that guesses differently gives you a different result.
What is the difference between HPGL and HPGL/2?
HP-GL/2 arrived in 1990 and added pen width, pen color, filled polygons and an encoded form that packs coordinates into fewer characters. It went into PCL 5, so laser printers have understood it ever since.
Is a PLT file the same as an HPGL file?
Usually, though not always. PLT is only a file name, and most programs that write one put HPGL inside it. Some put something else entirely, so open the file and look at the first line before assuming.
How do I convert HPGL to PDF?
Run hp2xx with the PDF mode: hp2xx -m pdf drawing.plt. It is free and it runs on Windows, Mac and Linux. It also writes SVG, DXF, EPS and PNG. A viewer with an export button does the same job with fewer options.
Does an HPGL file have a magic number?
No, and that is unusual. The file utility names thousands of formats from their first bytes. It could not identify HPGL until December 2022, and it now guesses from whichever command happens to come first.
Are HPGL files still used?
Yes, in narrow places. AutoCAD still ships an HP-GL/2 driver. Cutting plotters and vinyl cutters take HPGL directly, and engineering archives are full of plot files nobody has converted yet.

Still stuck with an HPGL file?

Two moves settle most of what is left. Try them in order.

Is it really HPGL?

Open it in Notepad. Two-letter commands ending in semicolons means yes. See section 6.

Need to see it?

Run hp2xx -m pdf on it. Free, quick and it works on every desktop system. Section 5 has the rest.

Holding a file with a different name? Our PLT file format guide covers the extension most plot files actually use.

Comparing page languages? PS files and EPS files describe a page the same way, and a drawing usually ends up in the PDF document format.

Working in a drawing program instead? the CDR file format comes from CorelDRAW and AI files come from Adobe Illustrator, and both export plotter output.

Need a picture rather than lines? PCX files and TGA files store pixels, which is the opposite of what a plot file does.

Stuck on your computer rather than your file? Our Windows fixes and macOS guides cover the system side.

New to all of this? What a file format is covers the ground underneath, and our file format guides list the rest.

Found something here that does not match your own file? Send us the first line of it and we will check it against HP's documentation.

Was this page helpful? Thanks for your feedback!