G90 sets your CNC machine to absolute positioning mode. Every move you program will be measured from a fixed zero point — usually your work offset (like G54) or machine home.
Key Takeaways
- G90 activates absolute positioning mode — all moves are measured from a fixed zero point
- It’s modal, meaning it stays active until you switch to G91 (incremental mode)
- Most CNC programs run in G90 for the majority of their code
- G90 is commonly included in the safety block at the start of each tool section
- Forgetting to set G90 when your machine is in G91 can cause the tool to move to the wrong location
| G90 – At A Glance | |
|---|---|
| Function | Absolute positioning mode |
| Type | Modal (Group 3) |
| Cancelled by | G91 |
| Common use | Safety block, program startup |
| Paired with | G54–G59 (work offsets), G00, G01 |
What does G90 do?
When G90 is active, every coordinate you program tells the machine exactly where to go — measured from the same zero point every time.
If you tell the machine to go to X2.0, it moves to the location that is 2.0 inches from your part zero. It doesn’t matter where the tool currently is. The machine always goes to that exact spot on the coordinate grid.
This is different from G91 (incremental mode), where each move is measured from wherever the tool is right now.


The diagrams above show this difference clearly. In absolute mode, all your coordinates point back to one origin. In incremental mode, each move uses the last position as the new starting point.
G90 vs G91: Which mode does what?
Most CNC programs are written mostly in G90. Here’s why: it’s easier to think in absolute coordinates when you’re working from a part print.
Your print says the hole is at X1.500, Y2.000 from the datum. You just type that directly into your program. You don’t have to calculate how far from your last move that is.
G91 (incremental) gets used for specific situations — like when you want to drill a row of evenly spaced holes without calculating every absolute position.
Both G90 and G91 are modal commands. Once you turn one on, it stays on until you switch to the other. There’s no “off” code — G90 and G91 cancel each other.
COMMON MISTAKE – Leaving the machine in G91 when you start a new section of code
Why it matters: If the previous operation used G91 and you forget to call G90, all your absolute coordinates will be interpreted as incremental moves. The tool will go to the wrong position — and if there’s a fixture or clamp in the way, you could crash the machine.
The calculator below shows both modes side by side. Enter the positions you want to hit, and it will show you what those coordinates look like written in G90 (absolute) versus G91 (incremental) — and generate the actual G-code for each.
| # | Enter position (X, Y) | G90 — Absolute | G91 — Incremental | |
|---|---|---|---|---|
Now that you can see the difference, here is how G90 looks in a real program:
G90 code example
Here’s a simple example of G90 used in a program to drill three holes:
G90 G54 G00 X1.0 Y1.0 (Absolute mode, work offset, rapid to first hole)
G43 H01 Z1.0 M03 S1000 (Tool length comp on, spindle on)
G99 G81 Z-0.5 R0.1 F8.0 (Drill cycle, first hole)
X2.5 Y1.0 (Second hole — X2.5, Y1.0 from part zero)
X4.0 Y1.0 (Third hole — X4.0, Y1.0 from part zero)
G80 (Cancel canned cycle)
G91 G28 Z0.0 (Incremental move to machine home — Z only)
G90 (Back to absolute mode)
M30 (End of program)
Notice how all the hole positions (X1.0, X2.5, X4.0) are measured from the same part zero — that’s G90 at work. The brief switch to G91 at the end is used for the machine home move, then G90 is called again before the program ends
When to use G90
You’ll see G90 in nearly every CNC program — typically right at the top in the safety block (also called a safety line).
A safety block is a line of code run at the start of each new section to make sure the machine is in the correct modes. It usually looks something like this:
G90 G40 G49 G80
This single line sets the machine to absolute positioning (G90), cancels cutter compensation (G40), cancels tool length compensation (G49), and cancels any active canned cycle (G80) — all at once.
Running this before each tool change helps prevent crashes from leftover modal states.
FAQs
What does G90 mean in CNC?
G90 is the G-code that activates absolute positioning mode. When G90 is active, all coordinate values in your program are measured from a fixed zero point — usually the workpiece zero set by your work offset (G54–G59).
What is the difference between G90 and G91?
G90 uses absolute positioning — every move is measured from a single fixed zero point. G91 uses incremental positioning — every move is measured from wherever the tool currently is. Both are modal, and they cancel each other.
Does G90 need to be programmed at the start of every CNC program?
It’s best practice to include G90 in your safety block at the start of each tool section. Even if the machine defaults to G90 at power-up, explicitly calling it ensures your program won’t behave unexpectedly if a previous operation left the machine in G91.
Can you mix G90 and G91 in the same program?
Yes. Switching between absolute and incremental mode in the same program is common. A typical example is using G90 for all machining moves and briefly switching to G91 for a machine home (G28) move at the end of a tool section, then returning to G90.





















