A wood router runs a leaner M-code vocabulary than any metal machine, which makes the list quick to learn, with one genuinely confusing twist baked in: the coolant codes survive on machines that have no coolant, because they stopped meaning coolant and started meaning whatever relay is wired to them.

The working list

For the GRBL-class controllers on most hobby and small-shop routers:

M-codeOfficial meaningOn a wood router, usually
M0Program pauseHold for clamp moves or checks
M2 / M30Program endJob done, outputs off
M3Spindle on (CW)Router or spindle start
M4Spindle CCW / variable powerLaser-attachment mode
M5Spindle stopRouter off
M7Mist coolantAir assist, where compiled in
M8Flood coolantDust collection or air blast relay
M9Coolant offThat relay off

The official meanings come from the standard M-code definitions; the right-hand column is shop reality. The spindle rows behave exactly as on any machine, including the family logic, two ons then the off, that the coolant-code memory pattern teaches: M3/M4 then M5, M7/M8 then M9.

Why do coolant codes run the dust collector?

Because a controller exposes outputs, not intentions. GRBL’s documentation defines M8 as switching the coolant pin; what that pin energizes is the builder’s choice, and on wood machines the useful peripherals are extraction and air, not flood coolant. So CAM posts emit M8 before cutting and M9 after, and the dust extractor obeys codes named for liquid. The practical rule: map your own machine’s outputs once, label them, and read M8 in any file as switch my wired peripheral until proven otherwise.

Two genuine cautions ride along. M4 on GRBL doubles as the variable-power mode used for laser attachments, the dynamic-power story told in M3 vs M4 on a CNC laser cutter, so a file written for a laser build behaves differently on a spindle build. And M7 exists only when compiled into the firmware, so posts emitting it for air assist do nothing on stock builds, silently.

What changes on industrial wood machines?

The core survives; a vendor layer lands on top. Nesting machines and woodworking machining centers from the major builders keep standard motion and spindle codes but add their own M-codes for drill-bank selection, vacuum pod and zone control, aggregate heads, and tool clusters, with numbers that differ between builders and sometimes between models. The discipline is identical to metalworking’s builder codes: the core transfers, the rest is manual material, and an unfamiliar M-code in a program is something to look up before cycle start, never to guess. That look-it-up reflex, plus the shared core from the common M-codes for CNC beginners, covers every wood machine you will meet.

How does this fit the rest of router practice?

The M-code list is the easy fifth of router literacy. The motion side, GRBL’s quirks, and the alarm messages live in their own guides, the OpenBuilds GRBL practice path and the GRBL alarm 1 vs error 1 decoder, and the codes themselves are a recall task small enough to finish in a week of spare minutes on the G-code practice hub. Learn the list, map the outputs, label the machine.

Bottom line

A wood router’s M-codes: M3/M5 for the spindle with M4 as laser mode, M0 pause, M2/M30 end, and M8/M9 switching outputs that usually mean dust collection or air rather than coolant. Industrial machines stack vendor codes on top that get looked up per builder. Short list, one wiring map, and the twist stops being confusing.

Sources

Frequently asked questions

What M-codes does a CNC wood router use?

The working set: M3/M5 spindle (with M4 as laser mode), M0 pause, M2/M30 end, and M8/M9 switching the coolant outputs, usually rewired to dust collection or air. Industrial machines add vendor codes.

Why does my router file contain coolant codes like M8?

The controller switches outputs, not intentions: the M8 pin commonly drives a dust extractor or air valve on wood machines, so CAM emits M8/M9 for whatever is wired there.

Do industrial wood routers use different M-codes?

Above the core, yes: drill banks, vacuum zones, and aggregate heads get vendor-specific numbers that differ per builder and belong in the manual, not in memory.

What is the best way to learn the M-codes a wood router uses?

Drill the short core to instant recall and map your machine’s outputs once. A free app like G-Code Sprint quizzes the everyday codes and repeats whichever ones you miss.

G-Code Sprint is a study and practice tool only. Always follow your instructor, employer, machine manual, and shop safety procedures.