M-code List
Every M-code in the G-Code Guru reference, across Fanuc, Haas, Siemens, Mazak, Okuma, Grbl and Marlin. Sort by any column or type to filter.
49 of 49
| M00 | Program StopUnconditional program stop. Machine stops and waits for operator to press cycle start. Spindle, coolant, and feed are stopped. |
| M01 | Optional StopConditional program stop. Machine stops only if Optional Stop switch is ON. Allows operator to skip stops during production runs. |
| M02 | Program EndEnds the program. Stops spindle, coolant, and feed. Cursor stays at M02 line. Does not rewind program. |
| M03 | Spindle On CWStarts the spindle rotating clockwise (when viewed from above on a vertical mill, or from the tailstock on a lathe). Standard direction for right-hand tooling. |
| M04 | Spindle On CCWStarts the spindle rotating counter-clockwise. Used for left-hand tooling, left-hand tapping, and specific operations. |
| M05 | Spindle StopStops the spindle rotation. Should be called before tool changes and at program end. |
| M06 | Tool ChangeExecutes automatic tool change. Swaps the current tool for the tool specified by the preceding T command. Machine goes through its tool change sequence. |
| M07 | Mist Coolant OnActivates mist coolant (air/oil mixture). Provides lubrication with minimal coolant volume. Good for aluminum and where flood coolant is undesirable. |
| M08 | Flood Coolant OnActivates flood coolant. Standard coolant delivery for most machining operations. Provides cooling, lubrication, and chip evacuation. |
| M09 | Coolant OffTurns off all coolant (both mist and flood). Should be called before tool changes and at program end. |
| M10 | ClampActivates workholding clamp or 4th axis clamp. Specific function varies by machine configuration. |
| M11 | UnclampReleases workholding clamp or 4th axis clamp. Specific function varies by machine configuration. |
| M13 | Spindle CW + Coolant OnStarts spindle clockwise and turns on coolant simultaneously. Combines M03 and M08 in one command. |
| M14 | Spindle CCW + Coolant OnStarts spindle counter-clockwise and turns on coolant simultaneously. Combines M04 and M08. |
| M19 | Spindle OrientationOrients the spindle to a specific angular position and locks it. Required for tool changes with orientation, some boring cycles, and live tooling operations. |
| M21 | Mirror X-Axis OnEnables X-axis mirroring. All X coordinates are reversed. Used for symmetric parts. |
| M22 | Mirror Y-Axis OnEnables Y-axis mirroring. All Y coordinates are reversed. Used for symmetric parts. |
| M23 | Mirror OffCancels both X and Y axis mirroring. Returns to normal coordinate interpretation. |
| M29 | Rigid TappingActivates rigid tapping mode where the spindle and Z-axis are electronically synchronized. Provides more accurate threading than floating tap holders, especially in harder materials. |
| M30 | Program End and RewindEnds the program and rewinds to the beginning. Stops spindle, coolant, and feed. Standard program ending code. |
| M32 | Lubrication OnActivates automatic lubrication cycle. Lubricates machine slideways and ballscrews. |
| M33 | Lubrication OffDeactivates automatic lubrication or cancels manual lube cycle. |
| M36 | Part Counter IncrementIncrements the part counter by one. Used for production tracking and batch counting. |
| M37 | Part Counter DecrementDecrements the part counter by one. Used to correct count after scrapped parts. |
| M41 | Low Gear SelectSelects low gear range on machines with gear-driven spindles. Provides higher torque at lower RPM. |
| M42 | High Gear SelectSelects high gear range on machines with gear-driven spindles. Provides higher RPM at lower torque. |
| M48 | Enable Feedrate OverrideEnables feedrate override. Allows operator to adjust feed rate percentage during cutting. |
| M49 | Disable Feedrate OverrideDisables feedrate override. Machine runs at exactly programmed feed rate, ignoring override knob. |
| M50 | Pallet ClampClamps the pallet on machines with pallet systems. Ensures pallet is secured before machining. |
| M51 | Pallet UnclampUnclamps the pallet for removal or pallet change. |
| M60 | Pallet ChangeExecutes automatic pallet change on machines with pallet changer. Swaps workholding pallet for automated production. |
| M82 | Absolute ExtrusionSets extruder to absolute positioning mode. E values represent total filament extruded from start. |
| M83 | Relative ExtrusionSets extruder to relative positioning mode. E values represent filament for each move only. |
| M84 | Disable SteppersDisables stepper motors after a period of inactivity, or immediately if no time specified. Saves power and reduces noise. |
| M97 | Local Subprogram CallCalls a local subprogram within the same program file. Jumps to a block with the specified N number and executes until M99 is encountered, then returns. |
| M98 | Subprogram CallCalls a subprogram. Execution transfers to the subprogram and returns to the next line after M98 completes. |
| M99 | Subprogram ReturnReturns from a subprogram to the calling program. Execution continues at the line after the M98 call. |
| M104 | Set Extruder TemperatureSets the target temperature for the extruder (hotend). Does not wait for temperature to be reached - continues immediately. |
| M105 | Report TemperaturesReports current temperatures of all heaters (extruder, bed, chamber). Output includes current and target temperatures. Used for monitoring and host communication. |
| M106 | Part Cooling Fan OnTurns on the part cooling fan at the specified speed. Essential for PLA, bridges, and overhangs. |
| M107 | Part Cooling Fan OffTurns off the part cooling fan. Equivalent to M106 S0. |
| M109 | Wait for Extruder TemperatureSets extruder temperature and waits for it to be reached before continuing. Blocks execution until at temperature. |
| M117 | Display MessageDisplays a text message on the printer's LCD screen. Useful for showing progress updates, instructions, or status messages during a print. |
| M140 | Set Bed TemperatureSets the target temperature for the heated bed. Does not wait - continues immediately. Use M190 to wait. |
| M190 | Wait for Bed TemperatureSets bed temperature and waits for it to be reached. Blocks execution until bed is at target temperature. |
| M200 | Set Filament DiameterSets the filament diameter for volumetric extrusion mode. When enabled, E values represent cubic millimeters instead of linear filament length. |
| M400 | Wait for Moves to FinishWaits for all buffered moves to complete before processing the next command. Ensures synchronization. |
| M420 | Bed Leveling StateControls the bed leveling compensation. Can enable/disable stored mesh and show leveling data. |
| M600 | Filament ChangeInitiates a filament change sequence. Pauses print, retracts filament, and prompts user to load new filament. |
Descriptions are the one-line entries from the app's reference database. Controller support marks whether a code exists in that dialect, not that it behaves identically; the full pages cover the differences.