Back to GSM Code List

G00 and G0: rapid positioning in CNC

G0 and G00 specify the same rapid positioning function on controls that accept both forms. Use them to approach, retract or move between work areas without cutting. Speed depends on the machine and rapid override; F does not control the rapid move. Unlike G01, the path is not always a straight line, so check clearance above the part, clamps and vise before moving.

For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.

Family
Movement
Machine
Milling, Turning, Mill-turn
Risk
High
Example
G00 X0 Y0 Z5

G00 vs G01: rapid positioning or controlled feed

G0 / G00
Rapid positioning without cutting. F does not set its speed; the path depends on the control.
G01
Straight-line motion at feed F. Used for cutting or a positioning move that needs a controlled path.

Syntax by control

Fanuc (milling and turning)

G00 X30. Y20.

It takes no F: the speed is set by the builder for each axis. It is modal, so the following blocks that only carry coordinates also run in rapid until a G01, G02 or G03 shows up.

Haas

G00 X30. Y20.

Same syntax. Rapid traverse is scaled by the rapid override knob on the panel (5, 25, 50 and 100 percent), which is a separate control from the feed override: turning the feed override down does not slow a G00.

Siemens 840D / 828D

G0 X30 Y20

Siemens writes G0 with no padding zero and accepts RTLION / RTLIOF to force or drop linear interpolation of the rapid, that is, to decide whether the path is a straight line or each axis running free.

Heidenhain TNC (Klartext)

L X+30 Y+20 R0 FMAX

In Klartext there is no separate code for the rapid: it is an ordinary straight-line block with FMAX instead of a feedrate. That makes it more obvious that the path is a controlled straight line.

Address letters used with it

LetterWhat it setsUnit
X Y ZTarget coordinates of the move, absolute under G90 and incremental under G91. You can write one, two or all three axes in the same block.mm / in
A B CRotary axes, if the machine has them. In rapid they turn at their top speed, which is usually very high, and with the part mounted well off the center of rotation they sweep a lot of space.degrees
FNot used. If you write an F in the G00 block the control accepts it, but it does not change the rapid speed: it is only stored as the modal feedrate for the next G01.no effect in this block
G90 / G91They decide whether the coordinates are absolute positions or increments from where the tool is. An inherited G91 turns a positioning move into a jump.modal, no units

Worked example

Approach and retract of a 10 mm cutter over a part clamped in a vise, with two 25 mm tall clamps at the back of the table. What the example teaches is the safe order of rapid moves: first the coordinates in the plane with Z well up, then the drop in Z already over the working point, and the other way around on the way out.

O0100 (APROXIMACION Y RETIRADA CON G00)
( Program header. )
G21 G17 G40 G49 G80
( Millimeters, XY plane and a clean state: no offsets and no cycles active. )
G91 G28 Z0.
( Sends Z to the reference point in incremental before the tool change. )
T1 M06
( Loads the 10 mm cutter. )
G90 G54 G00 X30. Y20.
( First rapid: X and Y only, with Z still up at the reference point. Even if the path breaks into a dogleg, at that height there is nothing to hit. )
G43 H01 Z100. M03 S4000
( Applies the T1 length and drops in rapid to a safe Z that clears the clamps and the vise. Before this block the program Z is not the real Z of the tool tip. )
M08
( Coolant on. )
G00 Z2.
( Second rapid in Z, now over the working point with nothing in the way. Coming down to 2 mm off the face is the sensible limit: any lower leaves no margin if the stock comes oversize. )
G01 Z-5. F120
( From here on it cuts, and that is why the move becomes a G01 with a feedrate. )
G01 X95. F600
( Cutting pass along the part. )
G00 Z100.
( Retract: you come out in Z first. Moving in XY with the cutter still buried is the most expensive crash in the shop. )
G00 X30. Y20. M09
( With Z up, the traverse in the plane is safe. Coolant off. )
G91 G28 Z0. M05
( Z to the reference point and spindle stop. )
G90 M30
( Back to absolute and end of program. )
Open the simulator to check the example

Practical keys to using G00 in the workshop

Why G00 does not always move in a straight line

On plenty of controls the rapid is not a coordinated interpolation: every axis takes off at its own top speed and stops when it reaches its coordinate, so the real path is a diagonal that breaks the moment the shortest axis finishes. Fanuc decides it with a positioning type parameter and Siemens with RTLION / RTLIOF, and a lot of machines leave the factory in the non-linear mode. The practical consequence is serious: the simulator draws you a clean straight line between two points and the machine goes somewhere else. Never count on that straight line to clear an obstacle.

The safe order of rapid moves

The shop rule is simple and it does not fail: going in, X and Y first with Z high, and only then down in Z over the working point; coming out, Z first and then X and Y. The rapid drop stops 1 to 3 mm off the face and the rest is done with G01, because that margin is the only thing between you and an impact if the part sits higher than expected or the stock comes oversize. If the surface is irregular or there are clamps above the working plane, the safe plane goes above the highest thing on the table.

How fast it really goes and how you prove it

Rapid traverse is not programmed: the builder sets it and it is usually different on each axis, with typical values between 15 and 60 m/min. The rapid override on the panel scales it in steps (5, 25, 50 and 100 percent) and it is a different knob from the feed override, so turning the feed down does not slow a traverse. That is why the first run of a new program goes single block, with the rapid at 5 or 25 percent and a hand on the emergency stop. That extra minute is what separates a scare from a bent spindle.

Mistakes that cost you a part (or a tool)

  • Chaining X, Y and Z into a single G00 assuming the path is a straight line: the dogleg goes through somewhere you did not look and catches a clamp or the vise.
  • Dropping in rapid all the way to the cutting depth instead of stopping 2 or 3 mm off the face: if the stock comes oversize, the tool reaches the material at traverse speed.
  • Dragging a G91 in from an earlier block: G00 X50. stops being a position and becomes a 50 mm jump from wherever the tool is.
  • Traversing in XY with the tool still in the part, down a hole or inside a pocket.
  • Positioning in Z before applying G43: until that block the program coordinate does not belong to the tip of the tool that is actually in the spindle.
  • Proving out a new program with the rapid override at 100 percent and single block switched off.
  • Believing the feed override limits the rapid: on most machines they are two independent controls.

Frequently Asked Questions (FAQ)

Are G00 and G0 the same?

Yes. The control ignores leading zeros, so G0 and G00 are the same function. Writing it with two digits is only a readability convention, and it is the one almost every post processor uses; Siemens, on the other hand, always writes it as G0.

Does G00 move in a straight line between the two points?

It depends on the control and on a machine parameter. In the usual mode each axis runs at its own top speed and stops when it gets there, so the path is a broken diagonal. If you need a guaranteed straight line to clear something, program the move with G01 and a high feedrate, or check how your machine is set up.

How fast does a G00 go?

At the top speed of each axis, defined by the builder and not changeable from the program. It is usually different in Z than in X and Y, and the rapid override on the panel scales it in fixed steps. There is no way to program a slower rapid: if you want to control the speed, use G01 with an F.

Can I write an F in a G00 block?

You can, and the control does not complain, but it changes nothing in that block: the rapid still runs at its own speed. What does happen is that the F is stored as the modal feedrate and gets applied to the first G01 that comes along, which catches plenty of people out.

How can I avoid a collision during a G00 move?

Check the work offset, tool compensation and complete path. On a mill, retract to a height that clears the part and workholding before moving in XY. For a new program, follow the machine's verification procedure with single block and a reduced rapid override. A toolpath drawing does not prove clearance above clamps or the vise.

Related codes

Other codes in Movement

See the full list of G and M codes

Related tools