G91 sets your CNC machine to incremental positioning mode. Every move you program is measured from wherever the tool currently is — not from a fixed zero point.
Key Takeaways
- G91 activates incremental positioning mode — each move is measured from the tool’s current position
- It’s modal, meaning it stays active until you switch back to G90 (absolute mode)
- Most programs use G91 only for specific situations: evenly spaced hole patterns and machine home moves
- G91 G28 Z0.0 is one of the most common G91 lines you’ll see — it sends the Z axis home incrementally
- Always return to G90 after using G91 to avoid unexpected moves in the next section of code
| G91 – At A Glance | |
|---|---|
| Function | Incremental positioning mode |
| Type | Modal (Group 3) |
| Cancelled by | G90 |
| Common use | Evenly spaced hole patterns, G28 home moves |
| Paired with | G28, canned cycles (G81, G83, etc.) |
What does G91 do?
When G91 is active, every coordinate you program tells the machine how far to travel from where it is right now. The zero point moves with the tool on every single move.
If the tool is at X1.0 and you program G00 X1.5, the machine moves 1.5 inches further in the X direction — landing at X2.5 from part zero. It doesn’t go to X1.5 on the coordinate grid. It travels a distance of 1.5.
This is the opposite of G90 (absolute mode), where every coordinate is always measured from the same fixed part zero.


G90 vs G91: CNC positioning modes
CNC machines have two positioning modes available.
They are absolute positioning using the G90 code and incremental positioning using the G91 code.
As noted above, incremental positioning with G91 will take all locations relative to the machines current location.
With absolute positioning (G90), the machine will interpret all locations as relative a static location. This will usually be the work offset zero location as set by the G54 code or the machines home location if no work offset is active.
G90 and G91 are both modal codes.
Modal codes stay active until they are either canceled or changed. For G90 and G91, there is no cancel code so the only way to change them is to call the opposite code.
G91 vs G90: Choosing the right mode
Most CNC programs are written in G90 (absolute mode) for the main body of code. It’s easier to read a part print and program directly from the dimension values on the drawing.
G91 gets used in two specific situations where it actually makes the code simpler: evenly spaced hole patterns and machine home moves.
The difference between the two modes comes down to one question: is each coordinate a position or a distance? In G90, it’s always a position from part zero. In G91, it’s always a distance from wherever you just were.
Enter a few target positions below to see both modes side by side:
| # | Enter position (X, Y) | G90 — Absolute | G91 — Incremental | |
|---|---|---|---|---|
Notice how the G90 column always traces back to part zero, while the G91 column shows only the distance traveled from the previous point. Same tool path — different instructions.
Now let’s focus on when G91 gets used.
Evenly spaced hole patterns
If you need to drill five holes spaced exactly 1.5 inches apart, G91 lets you write the same move five times instead of calculating five different absolute positions.
G91 ; Switch to incremental mode
G99 G81 Z-0.75 R0.1 F8.0 ; Drill first hole
X1.5 ; Move 1.5" and drill
X1.5 ; Move 1.5" and drill
X1.5 ; Move 1.5" and drill
X1.5 ; Move 1.5" and drill
G80 ; Cancel canned cycle
G90 ; Return to absolute mode
Each X1.5 line means “move 1.5 inches from where you just drilled.” You don’t have to calculate X2.5, X4.0, X5.5, X7.0 — the machine handles the math.
In G90, that same pattern would require five different X coordinates. G91 makes it cleaner and less error-prone.
COMMON MISTAKE – Forgetting to call G90 after finishing a G91 section
Why it matters: G91 is modal — it stays active until you turn it off. If the next tool section starts without a G90, all those absolute coordinates get read as incremental moves. The tool will go to the wrong position, and if a fixture is in the way, you’ll crash.
The G91 G28 home move
The most common place you’ll see G91 in a real program is the machine home move between tool changes:
G91 G28 Z0.0 ; Move Z to machine home (incrementally)
G28 X0.0 Y0.0 ; Move X and Y to machine home
G90 ; Return to absolute mode
The G91 here isn’t about hole patterns — it’s about how G28 works. G28 sends the axis to machine home by first moving to an intermediate point. Using G91 with Z0.0 tells the machine to move zero distance in Z before going home, which sends it straight up from wherever it is. This is the safe way to retract the tool before moving X and Y.
You’ll see this block in nearly every CNC program that uses tool changes.
COMMON MISTAKE – Using G90 G28 Z0.0 instead of G91 G28 Z0.0
Why it matters: With G90 active, G28 Z0.0 moves the Z axis to Z0.0 on the coordinate system (part zero) before going home — which could drive the tool straight into your part.
With G91, Z0.0 means “travel zero distance, then go home,” which retracts cleanly from wherever the tool is.
When to use G91 — and when not to
Use G91 when you have repetitive moves with equal spacing, or when you need a G28 home move. These are the two situations where incremental mode genuinely simplifies the code.
For everything else, stay in G90. Programming an entire part in incremental mode is possible but makes the code much harder to read and verify. One wrong move throws off every subsequent position.
A good rule: if you use G91, always put G90 on the very next line after you’re done with it.
FAQs
What does G91 mean in CNC?
G91 is the G-code that activates incremental positioning mode. When G91 is active, all coordinate values are measured from the tool’s current position, not from a fixed part zero.
What is G91 G28 Z0.0 used for?
This is the standard way to send the Z axis to machine home between tool changes. G91 tells the machine to treat the Z0.0 as an incremental distance (zero distance), so it goes straight to home from wherever the tool currently is without first moving to the part zero Z position. It is the safe way to retract before moving X and Y.
When should I use G91 instead of G90?
Use G91 for evenly spaced hole patterns (where you want to repeat the same distance move) and for G28 home moves. For all other machining, G90 is easier to read and verify.
What happens if I forget to switch back to G90 after using G91?
The machine will stay in incremental mode. Any absolute coordinates in the next section of your program will be interpreted as distances to travel, not positions to go to. This will send the tool to the wrong location and can cause a crash.