G90 and G91 decide what the numbers after X, Y and Z mean. In G90 (absolute), a coordinate is a position measured from part zero, the active work offset such as G54. In G91 (incremental), it is a distance to move from where the tool is now. Both are modal and stay on until the other replaces them. Use G90 for almost all programming, because every line can be read on its own and checked against the drawing. Use G91 for repeated patterns, reusable subprograms and a few special moves, and switch back to G90 straight afterwards.

Think of giving directions: "go to 123 Main Street" is absolute; "walk three blocks north from where you are" is incremental. The machine follows either one exactly, so it matters which one you meant.

1. The Core Concept

G90: Absolute Positioning

In G90 mode, every coordinate is measured from one fixed point: part zero (G54 or whichever work offset is active). It doesn't matter where the tool is now; it goes to the exact coordinates you give.

G91: Incremental Positioning

In G91 mode, coordinates are distances measured from the tool's current position. Part zero still exists, but the numbers in each block only say how far, and which way, to move from here.

Only the axes you name in a block move. In G90, X3.0 moves X to 3.0 and leaves Y and Z where they are. In G91, X3.0 moves X 3.0 in the plus direction, and X0 means "don't move X at all". G90 is the default at power-on on most mills, but never rely on that: put it in the safe start line of every program, for example G17 G20 G40 G49 G80 G90. Work offsets themselves are explained in the work coordinates guide.

2. A Tale of Two Squares

To see the difference, here is a simple 2" x 2"50mm x 50mm square programmed both ways. The tool starts at the bottom-left corner of the part (X0, Y0).

Method A: Using G90 (Absolute)
G90 G01 X0.0 Y0.0 F20.0 (Start at origin)
Y2.0Y50.0 (Move up to Y=2.0)
X2.0X50.0 (Move right to X=2.0, Y stays at 2.0)
Y0.0 (Move down to Y=0.0, X stays at 2.0)
X0.0 (Move left back to origin)
Method B: Using G91 (Incremental)
G90 G01 X0.0 Y0.0 F20.0 (Start at origin in absolute)
G91 (Switch to incremental mode)
Y2.0Y50.0 (Move 2.0 units UP from current spot)
X2.0X50.0 (Move 2.0 units RIGHT from current spot)
Y-2.0Y-50.0 (Move 2.0 units DOWN from current spot)
X-2.0X-50.0 (Move 2.0 units LEFT from current spot)
G90 (Back to absolute straight away)

Both draw the same square. Notice that in G91 the moves add up to zero in each axis (+2 − 2 = 0), which is how you can check that an incremental shape closes.

3. Worked Example: A Row of Holes and Rounding Error

Seven holes are equally spaced across 6.000", from X0 to X6.0. The pitch is 6 ÷ 6 = 1.000", so both modes give exact numbers. Now space eight holes across 6.000": the pitch is 6 ÷ 7 = 0.857142…", which has to be rounded to 0.8571" in the program.

  • G91: seven moves of 0.8571" put the last hole at 7 × 0.8571 = 5.9997". Each rounding error adds to the next, so the last hole is 0.0003" short.
  • G90: each position is calculated and rounded on its own (0.8571, 1.7143, 2.5714, 3.4286, 4.2857, 5.1429, 6.0000). No hole is ever more than 0.00005" from its true position.

This is the same reason drawings dimension important features from a datum (baseline dimensioning) instead of chaining them one after another: errors in a chain add up. The machine itself does not get less accurate in G91, but your rounded numbers do. Program critical positions in G90.

4. Why Use G91? The Power of Subprograms

Looking at the examples above, G90 seems much easier to read and troubleshoot. So why does G91 exist? Repetition.

If you have to machine the same small pocket ten times on a plate, programming each one in absolute takes hundreds of lines. With G91, you write the pocket shape once in a subprogram that starts and ends at the pocket centre. You use G90 to drive the tool to the centre of pocket 1, call the subprogram, drive to pocket 2, and call it again. Because the subprogram only describes distances, the shape cuts correctly wherever it starts.

(Main program)
G90 G00 X1.0 Y1.0 Z0.1 (Centre of pocket 1, 0.1 above the top)
M98 P1000
G90 G00 X4.0 Y1.0 (Centre of pocket 2)
M98 P1000

(O1000: small square slot around the current point)
G91 G01 Z-0.35 F5.0 (Down 0.35: from Z0.1 to Z-0.25)
X0.25 F10.0
Y0.25
X-0.5
Y-0.5
X0.5
Y0.25
X-0.25 (Back to the centre)
G00 Z0.35 (Back up to Z0.1)
G90 (Leave the subprogram in absolute)
M99

Check it: the X moves add to 0.25 + (−0.5) + 0.5 + (−0.25) = 0 and the Y moves to 0.25 + (−0.5) + 0.25 = 0, so the tool ends where it started. The Z moves also cancel. The M98/M99 subroutine generator builds this kind of program for you, and the G-code XYZ shifter can move a whole absolute program instead.

Incremental canned cycles

Canned cycles also work in G91, with a repeat count. On a Fanuc control, with the tool at Z1.0 above the top of the part and over the first hole:

G91 G81 X1.0 R-0.9 Z-0.6 K4 F8.0 (4 holes, 1.0 apart)
G80 G90

In G91, R is the distance from the start height to the R plane (1.0 − 0.9 = Z0.1) and Z is the distance from the R plane to the bottom (0.1 − 0.6 = Z−0.5). Each repeat moves X 1.0 before drilling, so the first hole is 1.0 to the right of the start point. Haas uses L instead of K for the repeat count. More on cycles in the canned cycles guide.

5. The G28 Safety Trick (Crucial)

One of the most important uses of G91 is sending the machine home safely with G28 (return to reference point). G28 first moves through an intermediate point, given by the axis words in the block, and then goes to machine home. The intermediate point is read in whatever mode is active.

The G90 vs G91 Z-Retract Trap

When you want to send Z straight up for a tool change, you use G28. But watch what happens depending on the positioning mode:

  • BAD: G90 G28 Z0.0
    This tells the machine: "First go to absolute Z0.0 (often the top of the part!), THEN go to machine home." If the tool is beside a clamp or below the top of the part, the result is a crash.
  • GOOD: G91 G28 Z0.0
    This tells the machine: "Move 0.0 from your current position, THEN go to machine home." The spindle retracts straight up. Follow it with G90.
The Modern Alternative: G53

While the G91 G28 trick is an industry classic, many programmers now prefer G00 G53 Z0.0 to retract the spindle.

G53 moves in machine coordinates for that one block only, ignoring the work offset. Machine Z0 is the top of travel on most mills, so the spindle goes straight up. It is often considered the safest method because you do not switch into G91 at all, so there is nothing to forget to switch back.

6. Absolute and Incremental on a Lathe

Fanuc-style lathes using the standard (A) G-code system do not use G91 at all. Instead, X and Z are absolute and U and W are incremental moves in X and Z. You can mix them in one block: G01 X1.0 W-0.5 moves to a diameter of 1.0 while feeding 0.5 towards the chuck.

On a Lathe, G90 May Not Mean Absolute

In the Fanuc lathe A system, G90 is a turning (box) cycle, not absolute mode. Putting a mill habit like G90 on its own line in a lathe program will not do what you expect. Also remember that U is a change in diameter when diameter programming is on: U-0.1 takes 0.05 off each side. Check which G-code system your lathe uses before you copy code between machines.

  • Arc centres: I, J and K are incremental from the arc start point on most controls, even in G90. See the G02 and G03 guide.
  • G53: always machine coordinates, for one block.
  • Work and tool offsets: the offset values themselves are not affected by G90 or G91; only the program moves are.
The Modal Forgetting Curve

G90 and G91 are modal. If you switch to G91 for a quick incremental move and forget to put G90 back, the machine reads all your following absolute coordinates as incremental jumps. A move meant to go to X5.0 instead goes 5.0 further. Always return to G90 straight after an incremental operation, and end every subprogram that uses G91 with G90 before M99.

8. Common Mistakes

  • No G90 in the safe start line, so the program inherits G91 from the last job or an MDI move.
  • G28 in G90 with a non-zero or part-zero intermediate point.
  • Restarting mid-program in G91. If you restart at a block after an incremental section, the tool's start point is not where the program expects. Restart from a block that sets G90 and a full position.
  • Chaining critical positions in G91, so rounding errors add up.
  • Mill habits on a lathe: G90 is a turning cycle in the Fanuc lathe A system.

Test Your Coordinates

Want to see what forgetting to switch back to G90 does? Copy the "Method B" code above into our G-Code Viewer, then remove the minus signs from the last two moves and watch the tool walk away from the origin.

Open G-Code Viewer

Frequently Asked Questions

G90 is absolute positioning: each coordinate is a position measured from part zero, the active work offset such as G54. G91 is incremental positioning: each coordinate is a distance to move from where the tool is now. Both are modal and stay active until the other is commanded.

G28 moves through an intermediate point before going to machine home. In G91, Z0 means an intermediate point zero distance away, so the spindle goes straight up to home. In G90, Z0 means part zero, so the tool first moves down to the top of the part, which can crash it. Many programmers now use G53 Z0 instead.

Absolute (G90) is better for nearly all programming because each line can be read and checked on its own, restarts are safer and rounding errors do not add up. Incremental (G91) is useful for subprograms that repeat a shape at different positions, repeated hole patterns and some retract moves.

Not on most controls. Arc centre offsets I, J and K are incremental distances from the arc start point to the centre whether G90 or G91 is active. Some controls can be set to read them as absolute, so check your control's settings.

On Fanuc-style lathes using the standard A G-code system, use U and W for incremental moves in X and Z, and X and Z for absolute moves. They can be mixed in one block. In that system G90 is a turning cycle, not absolute mode.

Conclusion

CAM software outputs nearly all its code in G90, because absolute positions are safer and easier to check. G91 still earns its place for reusable subprograms, repeated hole patterns and the classic G91 G28 Z0 retract. Know which mode you are in, return to G90 as soon as you are done, and keep the G and M code reference next to the machine. For the moves themselves, see G00 and G01.