File formats · Converter
SVG to G-code for GRBL lasers
Turn an SVG into ready-to-run G-code for a GRBL laser: cut and score lines at their own power and speed, fills engraved with hatching, dynamic power for diode lasers and air assist on and off.
Who this is for
Many diode lasers run on GRBL controllers and accept G-code directly through a sender such as LaserGRBL or LightBurn’s GRBL mode, or from a USB stick or SD card on machines that support it. If your machine uses a proprietary program instead (xTool Creative Space, Glowforge), export SVG rather than G-code.
How to convert
- Open Import & Nest and drop in your SVG. The File Doctor checks for open shapes, double lines and wrong sizes.
- Choose Convert parts only, or nest the parts onto your sheet first.
- In the export dialog choose G-code (or the GRBL laser preset) and set cut, score and engrave power and speed.
- Set Max S to match your controller, choose dynamic power and air assist, and export the .gcode file.
What the G-code contains
| Setting | What it does |
|---|---|
| Units and positioning | G21 (millimetres) and G90 (absolute coordinates) at the start |
| Cut, score, engrave | Each operation gets its own power (%) and speed (mm/min) |
| Fill engraving | Filled shapes are hatched with parallel lines; the default spacing is 0.1 mm |
| Dynamic power (M4) | Power scales with speed so corners don’t overburn; recommended for diode lasers. M3 (constant power) is available too |
| Max S value | The S number for 100% power; default 1000, which matches GRBL’s usual setting |
| Air assist | M8 on at the start and M9 off at the end, if your controller switches air |
| Passes and travel speed | Repeat cuts and set how fast the head moves between shapes |
Check Max S first. If your controller’s maximum spindle value ($30 in GRBL) is 255 or 10000 rather than 1000, set Max S to match or the power percentages will be wrong. Run a small test before a full job.
Finding the power and speed
Every material and machine is different. The laser test card generator makes G-code that runs each cell of a power × speed grid at its own real settings, which is the fastest way to find the numbers to type into the converter. Starting values for Sculpfun, Atomstack and other diode lasers are on the laser settings pages.
Safety
G-code runs exactly what it says. Frame the job first, check the material is in focus, keep the area clear, wear goggles rated for your laser’s wavelength on an open-frame machine, and never leave a running laser unattended.
Other routes to G-code
Designs made in the app don’t need converting: every studio’s export dialog has G-code and the GRBL laser preset built in, and Photo Engrave writes raster G-code for photos. For CNC routers, the CNC router preset writes G-code with bit compensation. For the differences between formats, see laser file formats.
LaserGRBL, LightBurn, xTool Creative Space, Glowforge, Sculpfun and Atomstack are trademarks of their respective owners. Laser Generator Studio is independent and not affiliated with them.