Reference
M-Code List — CNC Miscellaneous Codes Explained
Complete CNC M-code list: spindle, coolant, tool change, program stop, subprogram and machine-specific codes for Fanuc and Haas, with examples.
| Code | Function | Machine |
|---|---|---|
M00 | Program Stop | Both |
M01 | Optional Stop | Both |
M02 | End of Program | Both |
M03 | Spindle On Clockwise | Both |
M04 | Spindle On Counter-Clockwise | Both |
M05 | Spindle Stop | Both |
M06 | Tool Change | Mill |
M07 | Mist Coolant On | Both |
M08 | Flood Coolant On | Both |
M09 | Coolant Off | Both |
M10 | Clamp / Brake On (builder specific) | Both |
M11 | Clamp / Brake Off (builder specific) | Both |
M13 | Spindle CW + Coolant On (builder specific) | Both |
M14 | Spindle CCW + Coolant On (builder specific) | Both |
M19 | Spindle Orientation | Both |
M23 | Thread Chamfer (Pull-Out) On — Lathe | Lathe |
M24 | Thread Chamfer (Pull-Out) Off — Lathe | Lathe |
M29 | Rigid Tapping Mode (Fanuc) | Both |
M30 | Program End and Rewind | Both |
M31 | Chip Conveyor Forward (Haas) | Both |
M33 | Chip Conveyor Stop (Haas) | Both |
M41 | Low Gear | Both |
M42 | High Gear | Both |
M48 | Feed/Speed Override Enable | Both |
M49 | Feed/Speed Override Disable | Both |
M50 | Pallet Change Sequence (Haas) | Mill |
M60 | Pallet Change / Automatic Work Change | Mill |
M62 | Digital Output On, Synchronised (LinuxCNC) | Mill |
M66 | Wait for Input (LinuxCNC) | Mill |
M83 | Auto Air Jet On (Haas) | Mill |
M84 | Auto Air Jet Off (Haas) | Mill |
M88 | Through-Spindle Coolant On (Haas) | Mill |
M89 | Through-Spindle Coolant Off (Haas) | Mill |
M95 | Sleep Mode (Haas) | Both |
M96 | Jump if Input Is Zero (Haas) | Both |
M97 | Local Subprogram Call (Haas) | Both |
M98 | Subprogram Call | Both |
M99 | Subprogram Return / Loop | Both |
M109 | Interactive User Input (Haas) | Both |
M198 | Subprogram Call from External Memory | Both |