M-Code
What is M-Code?
M-codes are the miscellaneous (machine) commands in a CNC program that control functions other than motion — spindle on/off and direction (M03/M04/M05), coolant (M08/M09), tool change (M06), and program stop/end (M00/M30). They work alongside G-codes to run the machine.
Exact M-code meanings vary by control and machine, which is one reason a post processor is tuned per machine.
Also known as
M codemiscellaneous code
Related terms
See it in machines → Browse the machine reference