G-code Export

Exporting G-code is the final step — it translates your toolpaths into machine-readable instructions.

How to Export

  1. File > Export G-code or use the toolbar export button
  2. Choose a file location and name (.nc extension)
  3. The G-code is written using the dialect configured in your machine settings

What the G-code Contains

The exported file includes:

  • Header — initialization commands, units (G21 for mm), coordinate mode
  • Spindle startM3 S{rpm} to start the spindle
  • ToolpathsG0 (rapid) and G1 (linear) / G2/G3 (arc) moves
  • Safe Z retractsG0 Z{safe} between operations
  • Spindle stopM5 at the end
  • Footer — return to safe position, program end (M30 for GRBL, M2 for LinuxCNC)

Pre-Export Checklist

Before exporting, verify:

  1. All operations have valid toolpaths (no errors in the tree)
  2. Toolpath validation passes (no overcuts)
  3. Stock dimensions match your actual material
  4. Tool assignments are correct
  5. Feed rates and speeds are appropriate for your material

G-code Dialects

The export format is determined by your machine's G-code dialect. See G-code Dialects for details on supported dialects and their differences.