G00 and G01: Rapid and Linear Moves

G00 and G01 are the two most common lines in any CNC program. G00 moves the tool quickly when it's clear of the material; G01 cuts in a straight line at the feed rate.

G00 and G01 move the tool in a straight line from where it is to the position in the X, Y and Z words. The difference is speed and purpose:

  • G00 (rapid) moves at the machine's maximum speed. It's for getting the tool into position when it's clear of the material: up to a safe height, over to the start of a cut, back down to just above the part.
  • G01 (linear feed) moves at the feed rate in the F word. It's for cutting.

Both are modal: once a G00 or G01 is active, it stays active until another motion code (G00, G01, G02 or G03) replaces it. A line with only coordinates repeats the last one.

G00 vs G01

G00 G01
Speed Machine's rapid rate Feed rate from F
Path Straight line on GRBL and LinuxCNC; can be a dog-leg on some Fanuc-style controls Always a straight line
Use it for Positioning in clear air Cutting
Feed rate needed No Yes, before the first G01

On some Fanuc-style controls, each axis in a G00 move travels at its own maximum rate, so a diagonal rapid can finish one axis before the other and take a bent path. Don't count on a rapid move going in a straight line past a clamp.

A safe rapid pattern

Most crashes happen on rapid moves, because the tool is moving at full speed. A safe habit:

  1. Rapid Z up first, to a height that clears clamps and the part.
  2. Rapid in X and Y to the start of the next cut.
  3. Rapid Z down to a clearance height a few millimetres above the material.
  4. Feed into the material with G01.

Never rapid sideways below the top of the stock, and never rapid down into material that hasn't been cut yet.

Example: cut a rectangle

The tool rapids to Z10, over to X0 Y0 and down to Z2. It then feeds down to Z-1 at 200 mm/min, cuts the rectangle at 600 mm/min, and rapids back up.

(G00 and G01 example: cut a 40 x 30 mm rectangle 1 mm deep)
G21 G17 G90 G54
T1 M6 (6 mm flat end mill)
S12000 M3
(G00: rapid to a safe height, then over the start corner)
G0 Z10
G0 X0 Y0
G0 Z2
(G01: feed down into the material, then around the rectangle)
G1 Z-1 F200
G1 X40 F600
Y30
X0
Y0
(G00: rapid back up to clear the part)
G0 Z10
M5
M30
Open this example in CutViewer

Open it in CutViewer to compare the rapid moves with the cutting moves, and see the cutting and rapid distances in the Job panel.

Line by line:

  • G0 Z10 and G0 X0 Y0 move up first, then across, following the safe pattern above.
  • G1 Z-1 F200 plunges at a slower feed rate than the side cuts.
  • G1 X40 F600 sets a new feed rate for the profile. F is modal too, so the next three lines use 600 mm/min.
  • Y30, X0 and Y0 have no G-code. G01 is still active, so they're cutting moves.

How CutViewer shows G00 and G01

CutViewer draws rapid and cutting moves separately and totals the cutting and rapid distance in the Job panel. The run-time estimate uses your feed rates for cutting moves and assumes 5,000 mm/min for rapids. The pre-flight checks flag a G01 with no feed rate, cutting with the spindle off, a rapid sideways move below Z0, and a rapid plunge below Z0 into uncut material.

Frequently Asked Questions

What is the difference between G00 and G01?

G00 is a rapid move at the machine's maximum speed, used to position the tool when it's clear of the material. G01 is a straight cutting move at the feed rate set by F. Use G00 to get to a cut and G01 to make it.

Are G0 and G00 the same?

Yes. The leading zero is optional, so G0 and G00, or G1 and G01, mean the same thing on every common control.

Does G00 use the F feed rate?

No. G00 always moves at the machine's rapid rate, which you can only slow down with the rapid override on the control. F applies to G01, G02 and G03.

Do I need to repeat G01 on every line?

No. G00 and G01 are modal, so they stay active until another motion code replaces them. A line with only X, Y or Z words repeats the last motion code.

What happens if a G01 has no feed rate?

Most controls stop with an alarm, for example GRBL's "undefined feed rate" error, because they don't know how fast to move. Set F on the first G01 or earlier in the program.

Check your own program before you cut: open it in CutViewer to see the toolpath in 3D, the run time and any problems.

Open CutViewer