M03 G-Code: Turn the Spindle On (Clockwise) — CNC Basics

What Does M03 Do?

M03 turns the CNC spindle on in a clockwise direction. That’s it — one command, one job.

On a CNC mill, clockwise rotation is the standard for right-hand cutting tools. Right-hand tooling is what you’ll use in almost every situation. So M03 is probably the most common spindle command you’ll ever write.

Key Takeaways

  • M03 starts the spindle in a clockwise direction (right-hand tooling)
  • Always pair it with an S code to set spindle speed — or make sure speed is already set
  • M03 stays on until you cancel it with M05
  • Use M04 for counterclockwise rotation (left-hand tooling)
  • Stop the spindle before changing direction — never switch M03 to M04 mid-program without M05 first
M03 – At A Glance
FunctionSpindle On — Clockwise
FormatM03 or M3
TypeModal
Cancelled byM05
Used withUsed with
ToolingRight-hand (standard)

Setting Spindle Speed with M03

M03 is almost always programmed with an S code. The S code sets the spindle speed in RPM. You can write them on the same line or on separate lines — the machine doesn’t care.

Same line:

S1000 M03

Separate lines:

S1000
M03

Both do the same thing. The spindle will turn on at 1,000 RPM.

If you write M03 without an S code, the machine uses whatever speed was set last. That might be fine — but it’s risky if you’re not sure what’s still in memory. The safer habit is to always set the speed explicitly.

M3 vs M03 — Is the Zero Required?

No. M3 and M03 are identical to the CNC controller.

The zero is just a formatting preference. Textbooks and reference materials tend to show the full M03. In real shop programs, you’ll often see the shorter M3. Either works.

If you’re programming on your own, pick one and be consistent. If you’re in a shop with existing programs, match their format.

M03 vs M04 — Which Direction?

There are two codes that turn the spindle on:

  • M03 — Clockwise. Used with right-hand tooling.
  • M04 — Counterclockwise. Used with left-hand tooling.
Spindle direction

Right-hand tools are the standard. Most mills, drills, and end mills are right-hand cut. You’ll use M03 the vast majority of the time.

M04 shows up occasionally — tapping with left-hand taps, some specialized operations, or certain lathe work. But for everyday milling and drilling, M03 is your go-to.

COMMON MISTAKE – Changing Directions

Never switch directly from M03 to M04 (or vice versa) without stopping the spindle first. Always use M05 between them.

Changing direction while the spindle is still spinning puts stress on the drive and can cause a fault or damage. Stop it, then restart in the new direction.

Turning the Spindle Off — M05

M05 is the spindle stop command. It works no matter which direction the spindle is turning.

If you started with M03, you stop with M05. Same if you started with M04. One command stops both.

Always use M05 before a tool change, before the program ends, and before you change spindle direction.

M03 Example Program

Here’s a simple drilling program using M03 to turn the spindle on before drilling a series of holes with the G81 canned cycle:

O0001                            (Program number)
G90 G54 G17 G40 G49 G80         (Safety line — absolute mode, work offset, cancel comp)
T01 M06                          (Tool change — Drill)
S1200 M03                        (Spindle on clockwise at 1200 RPM)
G43 H01 Z1.0                     (Tool length compensation on)
G00 X1.0 Y1.0                    (Rapid to first hole)
G81 Z-0.75 R0.1 F8.0             (Drill canned cycle)
X2.0                             (Next hole)
X3.0                             (Next hole)
G80                              (Cancel canned cycle)
G00 Z5.0                         (Retract)
M05                              (Spindle off)
M30                              (End program, rewind)

Notice that S1200 M03 appears before the rapid move and canned cycle. The spindle is running before the tool ever gets close to the part.

Other CNC codes to know when working with M03

When you’re writing programs that use M03, you’ll frequently see these codes nearby:

  • S — Sets spindle speed in RPM. Used on the same line or just before M03.
  • M04 — Counterclockwise spindle. The opposite of M03.
  • M05 — Spindle stop.
  • G96 — Constant surface speed mode (mainly on lathes). Tells the machine to maintain a set surface speed, automatically adjusting RPM as the diameter changes.
  • G97 — Constant RPM mode. Locks the spindle at a specific RPM regardless of diameter. This is the default mode on most mills.

FAQS

Does M03 automatically set the spindle speed?

No. M03 only starts the spindle — it doesn’t set the speed. You need an S code to define the RPM. If no S code is given, the machine uses the last speed in memory, which may or may not be correct.

What happens if I forget M05 and the program ends?

On most modern CNC machines, M30 (program end) or M02 will stop the spindle automatically. But it’s still good practice to include M05 explicitly — it makes the program easier to read and doesn’t rely on the controller doing cleanup for you.

Can I use M03 on a CNC lathe?

Yes. M03 works on lathes too. On a lathe, clockwise typically means the spindle rotates so the cutting tool engages the outside diameter correctly for right-hand turning tools. Check your machine’s documentation to confirm the rotation direction for your specific setup.

What’s the difference between M03 and G97 M03?

G97 puts the machine in constant RPM mode — meaning the S code sets a fixed RPM. When you write G97 S1000 M03, the spindle turns on at exactly 1,000 RPM. On lathes, you’d use G96 for constant surface speed mode instead, but mills almost always run G97.

Leave a Comment