Export Formats5 min read

G-Code for Laser Engraving: What You Need to Know

G-Code is the universal language of CNC machines. Most GRBL-based laser engravers accept G-Code directly — and Pathhaus's G-Code export generates machine-ready files without going through LightBurn or any other intermediate software.

G-Code basics for laser work

Laser G-Code uses a subset of CNC G-Code. The key commands are: G0 (rapid move, laser off), G1 (linear move, laser on), G2/G3 (arc moves), M3 (laser on), M5 (laser off), S (spindle/laser power, 0–1000 on GRBL). A simple laser line looks like: G1 X50 Y30 F3000 S500. This moves to X50,Y30 at 3000mm/min with 50% laser power. Pathhaus generates all of this from your font composition, including the M3/M5 on-off commands at each stroke start and end.

Machine profiles in Pathhaus

Pathhaus's G-Code export includes machine profiles for common GRBL machines: Sculpfun S30, Atomstack X20 Pro, xTool D1, and generic GRBL machines. Each profile sets the feed rate, power range (S0–S1000), coordinate units (mm), and firmware-specific commands. Select your machine from the dropdown and adjust speed and power to match your material. The generated G-Code is ready to send via LaserGRBL, LightBurn (in G-Code mode), or any G-Code sender.

When to use G-Code export

G-Code export is most useful when: you want to bypass machine software entirely and send files directly via a G-Code sender; you're integrating Pathhaus into a production workflow via the API; or you need precise control over laser parameters that some machine software abstracts away. For one-off desktop engraving, SVG+LightBurn is typically easier. For automated batch production, G-Code export via the Pathhaus API is the most efficient pipeline.

Coordinate systems and units

All Pathhaus G-Code exports use millimeter units (G21) and absolute coordinates (G90). The origin (0,0) is the bottom-left corner of the design bounding box, matching most GRBL machine home positions. If your machine homes to a different position, you'll need to add a G92 offset command or jog to your work origin before running the file. The G-Code export settings in Pathhaus Studio let you set a custom origin offset if needed.

Try it in Pathhaus Studio

Free to start — optimize and export your first font file in under 5 minutes.

Related guides