M09 G-Code: How to Turn Off Coolant in CNC Programs

M09 is the M-code that shuts off coolant on a CNC machine. It’s one of the most commonly used codes in any CNC program — you’ll see it near the end of almost every operation where coolant was active.

Key Takeaways

  • M09 turns off both mist coolant (M07) and flood coolant (M08)
  • It doesn’t affect through-spindle coolant, which has its own separate code
  • Always program M09 after the tool has finished cutting, not while the cutter is still engaged
  • M09 is automatically executed by program end codes like M30 and M02
  • It appears near the end of an operation, just before the tool returns to home or a tool change happens
M09 – At A Glance
FunctionTurn off coolant (mist and flood)
CancelsM07 (mist coolant), M08 (flood coolant)
Does NOT cancelThrough-spindle coolant (TSC), high-pressure coolant
Also cancelled byM00, M01, M02, M30

What Does M09 Do?

M09 shuts off the coolant supply to the cutting area. This includes both flood coolant (M08) and mist coolant (M07).

Once M09 executes, the coolant pump stops and the flow cuts off. The machine doesn’t move — it just stops the coolant.

cnc machine table with coolant lines and spindle shown
Flood coolant in action

Where M09 Goes in a CNC Program

M09 typically appears in two places:

  • After an operation finishes and before a tool change
  • At or near the end of the program before the tool retracts to home

Here’s a simple example showing where M09 fits:

T01 M06                        (Tool change to Tool 1)
G90 G54 G00 X0. Y0.            (Move to start position)
G43 H01 Z1.0                   (Apply tool length offset)
M08                            (Turn on flood coolant)
G01 Z-0.5 F10.                 (Begin cutting)
X5.0 F20.                      (Cut along X axis)
G00 Z1.0                       (Retract tool)
M09                            (Turn off coolant)
M05                            (Stop spindle)
G28 G91 Z0.                    (Return Z to home)
M30                            (End program)

M09 fires after the tool retracts from the cut and before the spindle stops. That’s the typical sequence: retract → M09 → M05 → home → M30.

COMMON MISTAKE – Forgetting M09 before a tool change

Why it matters: Some machines will continue running coolant through the tool change, which can make a mess and waste fluid. Some controls also flag it. Get in the habit of programming M09 before every M06 tool change.

Why Coolant Matters in CNC Machining

Using coolant correctly extends tool life, improves surface finish, and keeps chips clear of the cutting zone. M09 is just as important as M08 — turning coolant off at the right time prevents flooding the machine unnecessarily and keeps the work area cleaner.

The three main benefits of coolant during a cut:

  • Reduces heat buildup at the cutting edge
  • Lubricates the cutter and workpiece
  • Removes chips from the cutting area

M07 vs M08: What’s the Difference?

There are two standard coolant-on codes, and M09 turns off both of them.

M08 — Flood coolant is the most common. It pumps a steady stream of cutting fluid directly over the cutter and workpiece. It’s the best option for controlling heat and clearing chips on most materials.

M07 — Mist coolant combines cutting fluid with compressed air and sprays a fine mist. It uses less fluid and can be less messy, but it doesn’t reduce heat as effectively as flood coolant.

cnc machine table with coolant lines and spindle shown
Flood coolant close up

Either way, M09 cancels both.

Other Coolant Options

Beyond flood and mist, there are other coolant delivery methods. M09 typically does NOT cancel these — they have their own codes:

Through-spindle coolant (TSC): Delivers coolant through the center of the spindle and tool directly to the cutting edge. This is especially effective for deep hole drilling because it pushes chips up and out of the hole.

High-pressure coolant: Similar to flood coolant but delivered at over 1,000 PSI. The extra pressure improves chip evacuation and cooling in difficult cuts. This usually has its own on/off code depending on the control.

Air blast: Uses compressed air only — no fluid. It clears chips and reduces heat without lubricating. Often used on materials that are sensitive to cutting fluids.

COMMON MISTAKE – Turning M09 off while the cutter is still cutting

Why it matters: If coolant cuts out mid-cut on a deep pass or difficult material, heat builds up fast and can cause tool failure, a poor surface finish, or a workpiece that’s out of spec. Always program M09 after the tool has retracted from the cut.

Which Codes Also Turn Coolant Off?

M09 is the dedicated coolant-off code, but several program control codes also shut off coolant as part of what they do:

You don’t need to program M09 before M30 in most cases — M30 handles it. But many programmers include it anyway as a habit, and it doesn’t hurt.

FAQs

Does M09 cancel through-spindle coolant?

No. M09 turns off standard flood (M08) and mist (M07) coolant only. Through-spindle coolant has its own dedicated on/off codes, which vary by machine and control. Check your machine’s programming manual for the specific code.

Do I need to program M09 at the end of every program?

Not always — M30 and M02 automatically shut off coolant when the program ends. That said, many programmers include M09 before the final tool retract as a good habit, especially before a tool change mid-program.

Does every CNC machine support M09?

Most industrial CNC mills and lathes do. Hobbyist-level machines like CNC routers often don’t come with a coolant system, so M09 may not do anything on those machines — though a coolant system can usually be added.

What happens if I forget to program M08 but include M09?

Nothing harmful — M09 just won’t have anything to cancel. The machine will execute the block and move on. It’s a harmless no-op in that case.

Leave a Comment