SVG vs G-code vs HPGL: File Formats for Pen Plotters Explained
Every pen plotter workflow eventually runs into three-letter file formats. Here's what SVG, G-code, and HPGL actually are, how they differ, and which one your machine speaks.
At some point in every plotter journey, you’ll bump into a file format you don’t recognize — your machine wants G-code, but you’ve got an SVG, or a forum post mentions HPGL and you have no idea what that is. Here’s what these three formats actually are, how they differ, and which one you need to know.
SVG: the design format
SVG (Scalable Vector Graphics) is an XML-based format that describes shapes as mathematical paths — lines, curves, circles — rather than pixels. It’s the native export format of virtually every design tool: Illustrator, Inkscape, Processing, p5.js, and every generative art library.
<path d="M10 10 L100 100" stroke="black" fill="none"/>
That’s a line from point (10,10) to (100,100). SVG describes what to draw, not how a machine should move to draw it. This is the key distinction — SVG is a design description, not a machine instruction set.
Who uses SVG directly: The AxiDraw and NextDraw Inkscape extension reads SVG and internally converts it to motor movements. Many GRBL plotter control programs (like the vpype gcode plugin’s source input) also start from SVG. If you design your art, you’re almost certainly working in SVG.
G-code: the machine instruction format
G-code is a much older format, originally developed for industrial CNC machines. Instead of describing shapes, it describes exact machine movements as a sequence of commands:
G0 X10 Y10
G1 X100 Y100 F1000
G0 means “move fast without drawing” (pen up), G1 means “move while drawing” (pen down) at a specified feed rate (F1000). Every line of G-code is a literal instruction to the machine’s motors.
Who uses G-code: Most GRBL-based plotters (the same firmware used in many laser engravers and small CNC machines) run on G-code. If your plotter’s controller board runs GRBL firmware, it very likely expects G-code, not raw SVG — your design software or a conversion tool (vpype’s gcode plugin, or a slicer-style tool) turns your SVG into G-code before sending it to the machine.
G-code files are larger and less human-readable than SVG because every tiny movement is an explicit line, rather than a compact curve description.
HPGL: the vintage plotter format
HPGL (Hewlett-Packard Graphics Language) predates both of the above — it was developed in the 1970s for HP’s original pen plotters, the machines that defined the category before CNC and desktop robotics existed.
PU10,10;PD100,100;
PU (pen up) and PD (pen down) followed by coordinates — conceptually similar to G-code’s pen-up/pen-down model, but with its own distinct syntax and command set (.plt or .hpgl file extensions).
Who uses HPGL: Mostly vintage and professional plotters — vinyl cutters, older large-format plotters, and some CNC/laser software still support HPGL as a legacy input option. Very few modern hobbyist desktop plotters use it natively, but you’ll occasionally encounter it if you’re restoring or using an older machine, or working with vinyl cutting software that shares heritage with plotting.
The practical differences
| SVG | G-code | HPGL | |
|---|---|---|---|
| What it describes | Shapes/paths | Machine movements | Pen up/down + coordinates |
| Era | Modern (2001+) | CNC-derived (1960s+) | Original plotter era (1970s) |
| Human readable | Yes (XML) | Somewhat | Somewhat |
| File size | Compact | Larger | Moderate |
| Used by | Design tools, AxiDraw/NextDraw | GRBL plotters, CNC | Legacy plotters, some vinyl cutters |
| Editable by hand | Yes, easily | Awkward | Awkward |
Converting between formats
The most common conversion is SVG → G-code, needed for GRBL-based machines. vpype handles this well with its gcode plugin:
vpype read design.svg gwrite --profile gcode_plotter output.gcode
Inkscape also has G-code export extensions (often via the “gcodetools” or laser/CNC-oriented extension packages) if you prefer a GUI workflow.
For HPGL, dedicated conversion tools exist but are less commonly needed today — most modern hobbyist software has moved on from HPGL as an input format, though some software (particularly vinyl cutting tools) still exports it.
What this means for your workflow
If you own an AxiDraw or NextDraw: you’ll work almost entirely in SVG. The Inkscape extension handles the SVG-to-motion translation internally — you never see G-code.
If you own a GRBL-based plotter (many budget and DIY machines): you’ll design in SVG, then convert to G-code using vpype or an Inkscape extension before sending the file to your machine’s control software (Universal Gcode Sender, Lightburn, etc.).
If you’re restoring or using a vintage plotter: you may need HPGL, and your options for generating it are more limited — check your specific machine’s community for recommended tools.
For nearly everyone starting out, the practical takeaway is simple: learn SVG first. It’s what you’ll design in regardless of which machine you own, and the conversion to whatever your specific hardware needs is usually a single automated step.
Frequently asked questions
What file format do pen plotters use?
It depends on the machine. AxiDraw/NextDraw-family plotters and most GRBL machines accept SVG directly (translated internally to motor commands by the driving software). Many GRBL and CNC-style machines are controlled with G-code. Older professional plotters use HPGL. Most modern hobbyist plotters work from SVG.
Can I convert between SVG, G-code, and HPGL?
Yes — tools like vpype (SVG to G-code via the gcode plugin), Inkscape (with G-code or HPGL export extensions), and various online converters handle these conversions. The path geometry translates directly; what changes is the command syntax describing how to move between points.
Which format should a beginner learn?
SVG. It's the format nearly every design tool exports natively (Illustrator, Inkscape, Processing, p5.js), it's human-readable, and most modern plotter software (the AxiDraw extension, most GRBL senders) accepts it directly or converts it automatically. You rarely need to touch G-code or HPGL by hand as a beginner.
Gear mentioned in this post
Antoine Beyeler vpype (Free)
4.9 (480)The command-line Swiss-army knife for pen plotter SVGs — optimizes, reorders, merges, crops and prepares vector files for cleaner, faster plots.
Best for: Everyone — mandatory step between generative art and plotting
Inkscape Project Inkscape (Free)
4.7 (2,100)The free, open-source vector editor that doubles as the native design and machine-control interface for AxiDraw and NextDraw plotters.
Best for: Design and machine control in one free application
Evil Mad Scientist AxiDraw V3/A3
4.9 (312)The pen plotter that serious plotter artists upgrade to — precise, quiet, and compatible with nearly every pen and surface you'd want to draw on.
Best for: Artists ready to invest in the best
Two Trees GRBL Drawing & Writing Robot Kit
4.2 (142)A budget DIY drawing and writing robot kit on GRBL — heavy on assembly and tuning, light on price, and a genuinely good way to learn how plotters work.
Best for: Tinkerers who want to learn by building and tuning