M03, M04, and M05 are the spindle controls, and they are usually the first M-codes a beginner meets. M-codes are “miscellaneous” or machine functions: they switch things on and off rather than command motion the way G-codes do.
The three codes
- M03: spindle on, clockwise (forward). This is the workhorse. Standard right-hand tools cut running clockwise, so most programs use
M03. - M04: spindle on, counterclockwise (reverse). Used for left-hand tooling and operations like certain tapping setups.
- M05: spindle stop.
They almost always travel with a speed value:
M03 S1200 (spindle on, clockwise, at 1200 rpm)
...
M05 (spindle stop)
Why the mix-up happens
M03 and M04 differ by one digit and both start the spindle, so beginners reverse them. And because M03 is so common, M04 is easy to forget entirely until a left-hand or tapping job needs it. M05 is simpler, but under pressure students sometimes blank on which number is “stop.”
A memory hook: M03 is the default workhorse (3 is the one you will type most), M04 is the rare reverse, M05 is the full stop.
Learn them as a set
Spindle codes are easiest to remember as a group of three rather than one at a time, the same way you would drill M03, M04, and M05 as a mix-up set. They sit alongside coolant and program codes on the list of common M-codes every CNC beginner should know.
Bottom line
M03 is clockwise on, M04 is counterclockwise on, M05 is stop. Most cutting uses M03. Drill the three together with their S value and they stop blurring.
G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.