How to Convert SVG to G-code for Laser Cutting (Complete Guide)
From SVG to cut-ready G-code: what the file must satisfy, which tool to use for your machine, the commands that matter, and the mistakes that ruin parts.
Updated 2026-07-22
Converting SVG to G-code looks like an isolated technical step, but in practice 90% of cutting problems do not come from the conversion — they come from the SVG. A badly prepared file produces perfectly valid G-code that cuts badly.
So this guide runs in that order: get the SVG right, then convert it, then verify it.
What laser G-code actually is
G-code is a list of movement instructions. The machine has no idea what you are cutting; it only receives "move to this coordinate", "turn the laser on at this power", "turn it off".
The instructions that show up in virtually every laser file:
G0— rapid move with the laser off (repositioning)G1— controlled move with the laser on (the cut)G21— units in millimetresG90— absolute coordinatesM3/M4— laser on;M4is dynamic mode, scaling power with speedM5— laser offS— power, typically 0–1000F— feed rate in mm/min
A typical opening looks like this:
G21 ; millimetres
G90 ; absolute coordinates
M4 ; laser in dynamic mode
G0 X10 Y10 ; move to start without cutting
G1 X50 Y10 S800 F600 ; cut to X50 at 80% power, 600 mm/min
M5 ; laser off
On M3 vs M4: with M3 power is constant, so at corners — where the machine decelerates — the material receives more energy per millimetre and scorches. M4 compensates by reducing power as it slows. For cutting, M4 almost always gives cleaner corners. For greyscale engraving, M3 is more predictable.
Preparing the SVG (this is where it is won or lost)
Before converting anything, the SVG has to satisfy the following.
Closed paths
A cut outline must be a closed path. If the path has a microscopic gap — extremely common after tracing an image — the part will not separate, and the gap is often invisible on screen. In Inkscape you can find them with Ctrl+Shift+X or by inspecting the end nodes.
Everything converted to paths
Text must be converted to paths (Ctrl+Shift+C in Inkscape). Otherwise the converter depends on the font being installed, and it frequently is not. The same goes for primitive shapes and anything carrying effects.
No duplicate paths
Tracing tends to leave two lines stacked on top of each other. The machine then cuts the same outline twice: double the time, and a scorched edge. It is the most expensive mistake and the hardest to spot on screen.
When designing parts that share an edge, it is also worth deliberately merging those edges so the machine cuts one shared line. Less time, less heat, better fit.
No fills
The laser follows lines; it does not fill areas. Anything you intend to cut needs a stroke and no fill. Fills will not break the conversion, but they make reviewing the file much harder.
Units and document size
Set the document to millimetres and check the real part size before exporting. An SVG authored at 72 DPI instead of 96 comes out 33% oversized, and you will not notice until the part is already cut.
Separate operations by colour or layer
The usual convention is one colour per operation: red for cutting, blue for scoring, black for engraving. Every serious converter lets you assign different power and speed per colour. Without that separation the whole file runs at a single setting.
Which tool to convert with
LightBurn
The de facto standard, and paid. It imports SVG directly, handles colour layers, has real toolpath preview and per-machine profiles. If you use a laser regularly, it is the option that will cost you the least time.
LaserGRBL
Free, Windows only. Very solid for image engraving and GRBL machines, but its SVG support is limited — it is built more for rasterising images than for following vectors. A good entry point if your work is mostly engraving.
Inkscape with an extension
Inkscape can export G-code through extensions such as the J Tech Photonics Laser Tool. It is free and it works, but setup is more manual and the preview is weaker. Fine for occasional jobs.
Online converters
Convenient for a one-off file with nothing to install. The trade-off is control: they usually will not let you set cut order, multiple passes or per-colour operations.
Verify before sending to the machine
This step saves material consistently and almost nobody does it.
1. Simulate the toolpath. LightBurn previews it; there are also online G-code viewers. Look for moves you did not expect and outlines traversed twice.
2. Check the bounds. No coordinate should fall outside the work area. A machine without limit switches will slam into the frame, lose steps, and every cut after that will be offset.
3. Review cut order. Interior contours — holes, windows — must be cut before the outer perimeter. Cut the perimeter first and the part comes loose, shifts, and the interior cuts land misaligned.
4. Run the frame. Almost all firmware can trace the bounding box with the laser off or at minimum power. Two seconds to confirm the part fits the stock and sits where you think it does.
5. Test on an offcut. Of the real material, not something similar.
Common failures
Part comes out double or a third of the size. DPI mismatch between design app and converter, or document units set to inches. Pin millimetres at both ends.
The machine cuts thin air. The G-code origin does not match the machine origin. Many controllers use bottom-left; some SVGs carry a top-left origin with an inverted Y axis. Nearly every converter has a flip-Y option.
Outlines cut twice. Duplicate paths in the SVG, as described above.
Corners are scorched. The machine decelerates through turns. Use M4 instead of M3, or lower acceleration in the firmware config.
Nothing moves but the laser fires. Either G90 is missing and the machine is reading coordinates as relative, or there is no initial F and the feed rate is zero.
The short path
All of the above assumes you are starting from a clean vector. If what you have is a photo or a PNG logo, there is a tracing step first — and that is where most open and duplicate paths get introduced.
MEZ Laser covers that stretch: upload the image, get clean closed paths ready to cut, without the manual tracing workflow.
For power and speed once you have the file, see the settings chart by material.