G-code generators
Generate CNC programs for surfacing, rectangular and circular pockets, drill patterns with pecking, and profile cut-outs with tabs — plus 3D-printer first-layer, retraction, and e-steps calibration programs — with a live preview.
Added · updated 28 October 2026
Works with
- G-code viewer and simulator CNC and 3D printingOpen in viewer previews the program line by line
- G-code sender CNC and 3D printingOpen in sender loads the program to stream to the machine
- X-Carve setup and GRBL settings CNC and 3D printingits Open in G-code generator fills the surfacing job with the machine's work area, bit, feed and speed
How to use it
Pick an operation, fill in the dimensions, and copy or download the program. Everything is in the chosen units (mm or inch — the program uses G21 or G20 to match). Z = 0 is the top of the stock; cuts go negative. The preview is a top view (darker blue is deeper; red dashes are rapids).
-
Surfacing runs a raster along X or Y, or an inward offset spiral, overhanging the edges by the overhang × tool radius so the corners are cleaned.
-
Rectangular pocket clears with offset rings from the centre outward after a ramped entry; inside corners keep the tool radius. Circular pocket enters with a helix at the centre and steps outward in full circles.
-
Drill pattern: a grid (serpentine order) or bolt circle. GRBL has no canned cycles, so pecks are expanded into moves; tick canned cycles for LinuxCNC/Mach to get G81/G83.
-
Profile cut-out: outside, inside, or on the line of a rectangle or circle, with tabs left standing on the passes deeper than the tab height.
-
Printer programs are Marlin G-code with heat-up and homing. First-layer squares sit at the corners and centre; the retraction towers step the retraction distance every band (the comments say which); the e-steps routine extrudes exactly 100 mm.
Always check a generated program in a simulator (try the G-code viewer) and with an air cut before cutting material.
Sharing
Share link copies a URL that opens this tool exactly as you have it set up. It carries the operation and all of its parameters. Opening a link replaces your own saved settings for the tool; a Restore my settings button brings them back. To write a link by hand, use op, units, dialect — for example /tools/gcode-gen/?op=surfacing&units=inch&dialect=grbl.
Feedback is a gift. Something to improve, a feature to add, or a bug? Tell me.
Runs entirely in your browser; nothing you type leaves this page.