SVG to Gcode Converter
Turn the paths of an SVG into G-code with the width, feed rate and laser power you set, and read the time estimate before you download.
Free · runs in your browser · nothing is uploaded
Recent
Your last 10 settings, saved only in this browser. Nothing is uploaded.

How to use the SVG to G-code converter
- Click Choose SVG file, paste the markup into Or paste SVG code, or click Try a sample to see the tool work first.
- Set Width in mm (5 to 600, default 100). The SVG page (its viewBox) is resized to this width first; artwork with empty space around it comes out narrower, and the origin is the bottom-left corner of that page, not of the artwork.
- Set Feed rate in mm/min (100 to 12000, default 1000). This is the speed of the cutting moves.
- Pick Laser mode: M4 dynamic power (the default) or M3 constant power.
- Set Laser power (S) from 1 to 1000 (default 800).
- Leave Order strokes for the plotter ticked to shorten travel, or untick it to keep the order of your file.
- Read Cut length (mm), Travel (mm) and Drawing time (min) under the preview, and read every warning in the list.
- Click Download G-code. Download SVG gives you the resized drawing the G-code was made from.
Every change builds the G-code again, so change one setting at a time and watch the numbers move. Reset settings returns the defaults. Open the downloaded file in a text editor and check the first lines, which list the path count and the feed and power you chose, before you load it into your machine software. A quick look also shows whether the file is far longer than you expected.
How do I convert SVG to G-code?
The tool resizes your SVG to the width you set, flattens every curve into short straight segments and writes one travel move and a run of cutting moves for each path. The file starts with G21 (millimetres) and G90 (absolute positions). The origin is the bottom-left corner of the drawing, with Y pointing up.
Closed paths are closed back to their start point. Between paths the laser is switched off with M5, and the file ends with a return to X0 Y0, M5 and M2.
What do cut length, travel and time mean?
Cut length is the distance the head moves with the laser on. Travel is the distance it moves with the laser off, including the move to the first path and the return to X0 Y0. The time estimate adds cut length at your Feed rate to travel at 3000 mm/min. These numbers come from the tool on a 20 x 10 mm rectangle drawn in a 20 x 10 viewBox, feed 1000.
| Job width | Cut length | Travel | Estimated time |
|---|---|---|---|
| 20 mm | 60 mm | 0 mm | 0.1 min |
| 40 mm | 120 mm | 0 mm | 0.1 min |
| 100 mm | 300 mm | 0 mm | 0.3 min |
The cut length is the rectangle’s perimeter (2 x 20 + 2 x 10 = 60 mm at 20 mm wide), and it scales with the width. Travel is 0 because the path starts at the origin and the head ends there.
How does path ordering change the travel?
With Order strokes for the plotter ticked, inner shapes are cut before the shapes around them, and the remaining paths follow in nearest-neighbour order. Closed paths may start at any vertex and open paths may be reversed. Unticked, paths keep the order of your file. The example below is the same rectangle with a 10 x 5 mm rectangle inside it, feed 1000.
| Job width | Cut length | Travel, ordered | Travel, file order |
|---|---|---|---|
| 20 mm | 90 mm | 11 mm | 25 mm |
| 40 mm | 180 mm | 22 mm | 49 mm |
| 100 mm | 450 mm | 56 mm | 123 mm |
Cutting inner shapes first matters on a real job: the piece is still held by its outer edge while the holes are cut. The cut length does not change with the order, only the travel and the time.
Which settings should I start with?
The defaults are Feed rate 1000 mm/min and Laser power (S) 800. They are the tool’s starting values, not recommendations for any material, so run a test on scrap and adjust. M4 only behaves as described when GRBL laser mode is on ($32=1); without it, use M3 and check how your machine handles the S value.
Answers to common questions
Which file formats can I upload?
SVG only. The tool resizes the drawing to your width and gives you two downloads, G-code and SVG. For a DXF, export the design as SVG from your design program first.
What happens to my uploaded file?
It stays on your device. The conversion runs in your browser and the page makes no upload request. The engine loads the first time you use the tool.
Which machines can run the G-code?
The output is GRBL style. It was checked by parsing the file back and recomputing length, travel and bounding box, but it has not been run on a real machine. Compare the commands with your controller’s documentation and test on scrap.
Can I use it for laser cutting?
Yes. Choose M4 or M3 under Laser mode, then set the power and feed. Start with a low power on scrap.
Is this the same as CAM?
No. Each path becomes a travel move and a cut move. There are no pockets, tabs, depth passes or tool paths offset from the line, so milling work needs a CAM program.
What SVG features are not converted?
Text, images, masks and filters are skipped, and the warning list names them. Convert text to outlines in your design program before you upload. Clip paths and some CSS selectors also raise warnings.
Does it compensate for the laser kerf?
No. The tool does not apply a tool diameter or kerf offset, so the G-code follows the centre of each line. Set any offset in your machine software or in your drawing.
Related tools
- SVG for Laser Cutting: use it to turn an image into a cut-ready SVG before you make G-code.
- Image to Gcode: use it when your source is a picture to engrave, not a vector drawing.
- Laser Engraving Image Converter: use it to dither a photo into a 1-bit file for engraving.
- Stipple Image Generator: use it to make a stipple drawing from a picture.
- Resize SVG: use it when you only need the SVG set to an exact size in mm.
- SVG Simplifier: use it to reduce the points in a complex SVG before converting.
- Laser Prep Tools: use it to see every laser tool on this site.
- Convert Image to Cut File: use it when you start from a raster image.