Skip to main content
Independent machine intelligence · Research before the decision
THE MACHINEBLUE BOOKFree machine reference
◧ The Machine Blue BookTechnologyReference LibraryMachine DirectoryGlossaryShowroomControlsManualsContactMain site ↗
Reference › Glossary › M-Code
Definition

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

G-Code
Programming
Post Processor
Programming
CNC
Computer Numerical Control
Canned Cycle
Programming
See it in machines → Browse the machine reference