M-code reference

M04: Spindle on, counterclockwise

M04 is spindle on, counterclockwise. Starts the spindle in reverse (counterclockwise). It is modal, so it stays active on the following lines until another code from the same group replaces it.

What M04 does

M04 runs the spindle counterclockwise, for left-hand tools and some lathe setups. Running a right-hand drill in M04 rubs instead of cutting and usually breaks it.

TypeM-code
MachineMill and lathe
GroupSpindle
ModalYes: stays active until replaced by another code from the same group

M04 example

S800 M04

Spindle on counterclockwise at 800 RPM.

WordWhat it means here
S800spindle speed, or a speed limit or surface speed with some codes
M04Spindle on, counterclockwise

Codes people confuse with M04

CodeWhat it does instead
M03 Spindle on, clockwise. Starts the spindle forward (clockwise) at speed S.
M05 Spindle stop. Stops the spindle.

Other codes in the spindle group

Only one code from a modal group is active at a time. Programming any of these replaces M04.

  • M03 Spindle on, clockwise
  • M05 Spindle stop
  • M19 Spindle orientation
  • M29 Rigid tapping mode (Fanuc)

Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.

Quick check: M04

  1. What does M04 do? (Mill and lathe)

  2. Which code: Starts the spindle in reverse (counterclockwise).(Mill and lathe)

  3. What does M03 do? (Mill and lathe)

Show the answers
  1. Starts the spindle in reverse (counterclockwise).
  2. M04
  3. Starts the spindle forward (clockwise) at speed S.

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does M04 mean in CNC programming?
Spindle on, counterclockwise. Starts the spindle in reverse (counterclockwise).
Is M04 modal?
Yes. M04 belongs to the spindle group and stays active until another code from that group is programmed.
What is the difference between M04 and M03?
M04 (spindle on, counterclockwise): starts the spindle in reverse (counterclockwise). M03 (spindle on, clockwise): starts the spindle forward (clockwise) at speed S.
What is the difference between M04 and M05?
M04 (spindle on, counterclockwise): starts the spindle in reverse (counterclockwise). M05 (spindle stop): stops the spindle.

G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.

Free preview · no card Try G-Code Sprint