โ† Open Viewer
GCodex โ€บ G-Code Guide โ€บ G0 Command
G0

G0 โ€” Rapid Positioning

Category: Motion  ยท  Applies to: CNC Mill, CNC Lathe, 3D Printer, Laser Cutter, GRBL  ยท  Updated: May 2026

What is G0?

G0 commands the machine to move to a target position at maximum speed. It is a non-cutting travel move โ€” never use G0 while the spindle or extruder is active over a workpiece.

Syntax

G0 [X] [Y] [Z] [A] [F]

Parameters

ParameterDescription
XTarget X-axis coordinate (mm or inches)
YTarget Y-axis coordinate
ZTarget Z-axis coordinate
ATarget A rotary axis (degrees) โ€” 4/5-axis only
FFeed rate override for this move (optional, usually ignored in rapid)

Examples

G0 X100 Y50
โ†‘ Rapid move to X=100, Y=50 (Z unchanged)
G0 Z5
โ†‘ Lift to safe height of 5mm (retract before travel)
G0 X0 Y0 Z50
โ†‘ Rapid to machine origin at safe Z height

Important Notes

  • G0 moves at the machine's maximum configured speed โ€” typically much faster than G1 feed moves.
  • On most controllers G0 is modal โ€” stays active until G1, G2, or G3 overrides it.
  • All axes move simultaneously, reaching the target together (coordinated motion).
  • In 3D printing G-Code, G0 represents travel moves between extrusion paths.
  • Never use G0 to plunge into a workpiece โ€” always use G1 with a controlled feed rate.

Common Mistakes

  • โŒ Using G0 to enter the cut โ€” rapid plunges break tools and damage workpieces.
  • โŒ Not retracting Z before a G0 lateral move โ€” tool drags across the work surface.
  • โŒ Assuming G0 follows a straight path โ€” on some machines, non-cutting moves are interpolated differently.

Frequently Asked Questions

Q: What is the difference between G0 and G1?
G0 is rapid positioning at maximum machine speed โ€” used for travel moves only. G1 is linear interpolation at a controlled feed rate โ€” used for cutting or extrusion moves. G0 prioritizes speed; G1 prioritizes precision and controlled material engagement.
Q: Does G0 move in a straight line?
G0 typically moves all programmed axes simultaneously, which produces a straight line in 3D space. However, the path is not guaranteed to be perfectly linear on all controllers โ€” never assume G0 takes a specific path when near the workpiece.
Q: What speed does G0 use?
G0 uses the machine's maximum configured rapid speed โ€” set in the controller's parameter file or in Marlin's MAX_FEEDRATE settings. You cannot reliably slow G0 with an F word on most machines.