Before you can cut arcs, tap holes, or execute complex macros, you must understand the two most basic commands in CNC programming. G00 and G01 dictate how the machine moves in straight lines, but they are used for entirely different purposes.
1. What Are They?
These two codes switch the machine between its non-cutting "travel" mode and its active "cutting" mode.
G00 (G0)
Rapid Positioning. The machine moves axes at their absolute maximum speed. Used only when cutting air to get into position or retract away from the part.
G01 (G1)
Linear Interpolation. The machine moves in a straight line at a strictly controlled speed (Feed Rate). Used whenever the tool is engaged in material.
2. G00: The Need for Speed (And Caution)
The G00 command ignores any programmed feed rate. It tells the machine's servo motors to move to the specified coordinates as fast as physically possible. Depending on the machine, this can be anywhere from 500 to 2,000+ inches per minute (IPM).
G00 X2.0 Y2.0
(Drop the tool rapidly to 0.1 inches above the part)
G00 Z0.1
The "Dogleg" Rapid Danger
On many CNC machines, a G00 command moving two axes simultaneously does not move in a straight line. The machine drives both axes at max speed. Because the X and Y distances are usually different, one axis arrives at its destination first. The resulting path looks like a bent leg (a "dogleg"). This unpredictable path is the #1 cause of tools crashing into clamps or fixtures!
3. G01: Linear Interpolation & The 'F' Word
When you use G01, you are commanding the machine to move from Point A to Point B in a perfectly straight line, no matter what. However, a G01 command is useless without the F (Feed Rate) parameter.
The F-value tells the machine how fast to travel along that straight line. If you program a G01 without previously defining an F-value, the machine will throw an error and refuse to move.
G00 Z0.1
(Plunge into the material at 15 inches per minute)
G01 Z-0.5 F15.0
(Cut a straight line to X5.0 at 30 inches per minute)
G01 X5.0 F30.0
Modal Commands
G00 and G01 are Modal. This means once you turn one on, it stays active until you call the other one. You don't need to write G01 on every single line if you are making multiple straight-line cutting passes.
Visualize Your G-Code
Want to see the difference between rapid moves and feed moves? Copy the code snippets above and paste them into our interactive G-Code Viewer to instantly see the toolpath drawn on your screen. (Rapid moves typically show up as dashed lines!)
Open G-Code ViewerConclusion
Every complex toolpath generated by advanced CAM software ultimately boils down to thousands of tiny G00 and G01 movements. Remember: use G00 to quickly move through the air, and use G01 (with a carefully calculated Feed Rate) to cut the material. Always verify your rapid paths to avoid the dreaded dogleg crash!