G – Codes
G0 & G1: Move
G2 & G3: Controlled Arc Move
G4: Dwell
G6: Direct Stepper Move
G10: Set tool Offset and/or workplace coordinates and/or tool temperatures
G10: Retract
G11: Unretract
G12: Clean Tool
G17..19: Plane Selection (CNC specific)
G20: Set Units to Inches
G21: Set Units to Millimeters
G22: Firmware Retract
G23: Firmware Recover
G26: Mesh Validation Pattern
G27: Park toolhead
G28: Move to Origin (Home)
G29: Detailed Z-Probe
G29 Auto Bed Leveling (Marlin – MK4duo)
G29 Unified Bed Leveling (Marlin – MK4duo)
G29 Manual Bed Leveling (Marlin – MK4duo)
G29 Auto Bed Leveling (Repetier-Firmware)
G29 Mesh Bed Compensation (RepRapFirmware)
G29.1: Set Z probe head offset
G29.2: Set Z probe head offset calculated from toolhead position
G30: Single Z-Probe
G31: Set or Report Current Probe status
G31: Dock Z Probe sled
G32: Probe Z and calculate Z plane
Probe and calculate in Reprapfirmware
Probe and calculate in Repetier firmware
G32: Undock Z Probe sled
G33: Firmware dependent
G33: Measure/List/Adjust Distortion Matrix (Repetier – Redeem)
G33: Delta Auto Calibration (Marlin 1.1.x – MK4duo)
G34: Z Stepper Auto-Align
G34: Calculate Delta Height from toolhead position (DELTA)
G38.x Straight Probe (CNC specific)
G38.2 probe toward workpiece, stop on contact, signal error if failure
G38.3 probe toward workpiece, stop on contact
G38.4 probe away from workpiece, stop on loss of contact, signal error if failure
G38.5 probe away from workpiece, stop on loss of contact
G40: Compensation Off (CNC specific)
G42: Move to Grid Point
G53..59: Coordinate System Select (CNC specific)
G60: save current position to slot
G68: Coordinate rotation
G69: Cancel coordinate rotation
G75: Print temperature interpolation
G76: PINDA probe temperature calibration
G80: Cancel Canned Cycle (CNC specific)
G80: Mesh-based Z probe
G81: Mesh bed leveling status
G82: Single Z probe at current location
G83: Babystep in Z and store to EEPROM
G84: UNDO Babystep Z (move Z axis back)
G85: Pick best babystep
G86: Disable babystep correction after home
G87: Enable babystep correction after home
G88: Reserved
G90: Set to Absolute Positioning
G91: Set to Relative Positioning
G92: Set Position
G92.x: Reset Coordinate System Offsets (CNC specific)
G93: Feed Rate Mode (Inverse Time Mode) (CNC specific)
G94: Feed Rate Mode (Units per Minute) (CNC specific)
G98: Activate farm mode
G99: Deactivate farm mode
G100: Calibrate floor or rod radius
G130: Set digital potentiometer value
G131: Remove offset
G132: Calibrate endstop offsets
G133: Measure steps to top
G161: Home axes to minimum
G162: Home axes to maximum
G425: Perform auto-calibration with calibration cube
M0: Stop or Unconditional stop
M1: Sleep or Conditional stop
M2: Program End
M3: Spindle On, Clockwise (CNC specific)
M4: Spindle On, Counter-Clockwise (CNC specific)
M5: Spindle Off (CNC specific)
M6: Tool change
M7: Mist Coolant On (CNC specific)
M8: Flood Coolant On (CNC specific)
M9: Coolant Off (CNC specific)
M10: Vacuum On (CNC specific)
M11: Vacuum Off (CNC specific)
M13: Spindle on (clockwise rotation) and coolant on (flood)
M16: Expected Printer Check
M17: Enable/Power all stepper motors
M18: Disable all stepper motors
M20: List SD card
M21: Initialize SD card
M22: Release SD card
M23: Select SD file
M24: Start/resume SD print
M25: Pause SD print
M26: Set SD position
M27: Report SD print status
M28: Begin write to SD card
M29: Stop writing to SD card
M30: Delete a file on the SD card
M30: Program Stop
M31: Output time since last M109 or SD card start to serial
M32: Select file and start SD print
M33: Get the long name for an SD card file or folder
M33: Stop and Close File and save restart.gcode
M34: Set SD file sorting options
M35: Upload firmware NEXTION from SD
M36: Return file information
M36.1: Return embedded thumbnail data
M37: Simulation mode
M38 Compute SHA1 hash of target file
M39 Report SD card information
M40: Eject
M41: Loop
M42: Switch I/O pin
M43: Stand by on material exhausted
M43: Pin report and debug
M44: Codes debug – report codes available
M44: Reset the bed skew and offset calibration
M45: Bed skew and offset with manual Z up
M46: Show the assigned IP address
M47: Show end stops dialog on the display
M48: Measure Z-Probe repeatability
M49: Set G26 debug flag
M70: Display message
M72: Play a tone or song
M73: Set/Get build percentage
M75: Start the print job timer
M76: Pause the print job timer
M77: Stop the print job timer
M78: Show statistical information about the print jobs
M80: ATX Power On
M81: ATX Power Off
M82: Set extruder to absolute mode
M83: Set extruder to relative mode
M84: Stop idle hold
M85: Set Inactivity Shutdown Timer
M86: Set Safety Timer expiration time
M87: Cancel Safety Timer
M92: Set axis_steps_per_unit
M93: Send axis_steps_per_unit
M98: Call Macro/Subprogram
M99: Return from Macro/Subprogram
M101: Turn extruder 1 on (Forward), Undo Retraction
M102: Turn extruder 1 on (Reverse)
M103: Turn all extruders off, Extruder Retraction
M104: Set Extruder Temperature
M104 in Marlin Firmware
M104 in Teacup Firmware
M104 in RepRapFirmware and Klipper
M105: Get Extruder Temperature
M106: Fan On
M106 in RepRapFirmware
M106 in Teacup Firmware
M107: Fan Off
M108: Cancel Heating
M108: Set Extruder Speed (BFB)
M109: Set Extruder Temperature and Wait
M109 in Teacup
M109 in Marlin, MK4duo, Sprinter (ATmega port), RepRapFirmware, Prusa
M109 in Sprinter (4pi port)
M109 in MakerBot
M109 in Klipper
M110: Set Current Line Number
M111: Set Debug Level
M111 in RepRapFirmware
M111 in Repetier
M112: Full (Emergency) Stop
M113: Set Extruder PWM
M113: Host Keepalive
M114: Get Current Position
M115: Get Firmware Version and Capabilities
M116: Wait
M117: Get Zero Position
M117: Display Message
M118: Echo message on host
M118: Negotiate Features
M119: Get Endstop Status
M120: Push
M121: Pop
M120: Enable endstop detection
M121: Disable endstop detection
M122: Firmware dependent
M122: Diagnose (RepRapFirmware)
M122: Set Software Endstop (MK4duo)
M122: Debug Stepper drivers (Marlin)
M123: Firmware dependent
M123: Tachometer value (RepRap, Prusa & Marlin)
M123: Endstop Logic (MK4duo)
M124: Firmware dependent
M124: Immediate motor stop
M124: Set Endstop Pullup
M126: Open Valve
M126 in MakerBot
M127: Close Valve
M127 in MakerBot
M128: Extruder Pressure PWM
M129: Extruder pressure off
M130: Set PID P value
M131: Set PID I value
M132: Set PID D value
M132 in MakerBot
M133: Set PID I limit value
M133 in MakerBot
M134: Write PID values to EEPROM
M134 in MakerBot
M135: Set PID sample interval
M135 in MakerBot
M136: Print PID settings to host
M140: Set Bed Temperature (Fast)
M141: Set Chamber Temperature (Fast)
M142: Firmware dependent
M142: Holding Pressure
M142: Set Cooler Temperature (Fast)
M143: Maximum heater temperature
M144: Bed Standby
M146: Set Chamber Humidity
M149: Set temperature units
M150: Set LED color
M154: Auto Report Position
M155: Automatically send temperatures
M160: Number of mixed materials
M163: Set weight of mixed material
M164: Store weights
M165: Set multiple mix weights
M190: Wait for bed temperature to reach target temp
M191: Wait for chamber temperature to reach target temp
M192: Wait for Probe Temperature
M200: Set filament diameter
M201: Set max acceleration
M201.1: Set reduced acceleration for special move types
M202: Set max travel acceleration
M203: Firmware dependent
M203: Set maximum feedrate
M203 (Repetier): Set temperature monitor
M204: Firmware dependent
M204: Set default acceleration
M204 (Repetier): Set PID values
M205: Firmware dependent
M205: Advanced settings
M205 (Repetier): EEPROM Report
M206: Firmware dependent
M206: Offset axes
M206 (Repetier): Set EEPROM value
M207: Firmware dependent
M207: Set retract length
M207 Calibrate Z axis with Z max endstop
M207 (Repetier): Set jerk without saving to EEPROM
M208: Firmware dependent
M208: Set unretract length
M208 (RepRapFirmware): Set axis max travel
M209: Enable automatic retract
M210: Set homing feedrates
M211: Disable/Enable software endstops
M212: Set Bed Level Sensor Offset
M217: Toolchange Parameters
M218: Set Hotend Offset
M220: Set speed factor override percentage
M221: Set extrude factor override percentage
M220: Turn off AUX V1.0.5
M221: Turn on AUX V1.0.5
M222: Set speed of fast XY moves
M223: Set speed of fast Z moves
M224: Enable extruder during fast moves
M225: Disable on extruder during fast moves
M226: G-code Initiated Pause
M226: Wait for pin state
M227: Enable Automatic Reverse and Prime
M228: Disable Automatic Reverse and Prime
M229: Enable Automatic Reverse and Prime
M230: Disable / Enable Wait for Temperature Change
M231: Set OPS parameter
M232: Read and reset max. advance values
M240: Trigger camera
M240: Start conveyor belt motor / Echo off
M241: Stop conveyor belt motor / echo on
M245: Start cooler
M246: Stop cooler
M250: Set LCD contrast
M256: Set LCD brightness
M251: Measure Z steps from homing stop (Delta printers)
M260: i2c Send Data
M261: i2c Request Data
M280: Set servo position
M281: Set Servo Angles
M282: Detach Servo
M290: Babystepping
M291: Display message and optionally wait for response
M292: Acknowledge message
M300: Play beep sound
M301: Set PID parameters
RepRapFirmware 1.15 onwards
RepRapFirmware 1.09 to 1.14 inclusive
Other implementations
M302: Allow cold extrudes
M303: Run PID tuning
M304: Set PID parameters – Bed
M304 in RepRapPro version of Marlin: Set thermistor values
M305: Set thermistor and ADC parameters
M306: Set home offset calculated from toolhead position
M307: Set or report heating process parameters
M308: Set or report sensor parameters
M309: Set or report heater feedforward
M320: Activate autolevel (Repetier)
M321: Deactivate autolevel (Repetier)
M322: Reset autolevel matrix (Repetier)
M323: Distortion correction on/off (Repetier)
M340: Control the servos
M350: Set microstepping mode
M351: Toggle MS1 MS2 pins directly
M355: Turn case lights on/off
M360: Report firmware configuration
SCARA calibration codes (Morgan)
M360: Move to Theta 0 degree position
M361: Move to Theta 90 degree position
M362: Move to Psi 0 degree position
M363: Move to Psi 90 degree position
M364: Move to Psi + Theta 90 degree position
M365: SCARA scaling factor
M366: SCARA convert trim
M370: Morgan manual bed level – clear map
M371: Move to next calibration position
M372: Record calibration value, and move to next position
M373: End bed level calibration mode
M374: Save calibration grid
M375: Display matrix / Load Matrix
M376: Set bed compensation taper
M380: Activate solenoid
M381: Disable all solenoids
M400: Wait for current moves to finish
M401: Deploy Z Probe
M402: Stow Z Probe
M403: Set filament type (material) for particular extruder and notify the MMU
M404: Filament width and nozzle diameter
M405: Filament Sensor on
M406: Filament Sensor off
M407: Display filament diameter
M408: Report JSON-style response
M409: Query object model
M410: Quick-Stop
M412: Disable Filament Runout Detection
M413: Power-Loss Recovery
M415: Host Rescue
M416: Power loss
M420: Set RGB Colors as PWM (MachineKit)
M420: Leveling On/Off/Fade (Marlin)
M421: Set a Mesh Bed Leveling Z coordinate
M422: Set a G34 Point
M423: X-Axis Twist Compensation
M425: Backlash Correction
M450: Report Printer Mode
M451: Select FFF Printer Mode
M452: Select Laser Printer Mode
M453: Select CNC Printer Mode
M460: Define temperature range for thermistor-controlled fan
M470: Create Directory on SD-Card
M471: Rename File/Directory on SD-Card
M486: Cancel Object
M500: Store parameters in non-volatile storage
M501: Read parameters from EEPROM
M502: Restore Default Settings
M503: Report Current Settings
M504: Validate EEPROM
M505: Firmware dependent
M505: Clear EEPROM and RESET Printer
M505: Set configuration file folder
M509: Force language selection
M510: Lock Machine
M511: Unlock Machine with Passcode
M512: Set Passcode
M524: Abort SD Printing
M530: Enable printing mode
M531: Set print name
M532: Set print progress
M540: Set MAC address
M540 in Marlin: Enable/Disable “Stop SD Print on Endstop Hit”
M550: Set Name
M551: Set Password
M552: Set IP address, enable/disable network interface
M553: Set Netmask
M554: Set Gateway and/or DNS server
M555: Set compatibility
M556: Axis compensation
M557: Set Z probe point or define probing grid
M558: Set Z probe type
M559: Upload configuration file
M560: Upload web page file
M561: Set Identity Transform
M562: Reset temperature fault
M563: Define or remove a tool
M564: Limit axes
M565: Set Z probe offset
M566: Set allowable instantaneous speed change
M567: Set tool mix ratios
M568: Tool settings
M568: Turn off/on tool mix ratios (obsolete meaning in old RepRapFirmware versions)
M569: Stepper driver control
M569.1: Stepper driver closed loop configuration
M569.2: Read or write any stepper driver register
M569.3: Read Motor Driver Encoder
M569.4: Set Motor Driver Torque Mode
M569.5: Collect Data from Closed-loop Driver
M569.6: Execute Closed-loop Driver Tuning Move
M569.7: Configure motor brake port
M569.8: Read Axis Force
M569.9: Sets the driver sense resistor and maximum current
M570: Configure heater fault detection
M571: Set output on extrude
M572: Set or report extruder pressure advance
M573: Report heater PWM
M574: Set endstop configuration
M575: Set serial comms parameters
M576: Set SPI comms parameters
M577: Wait until endstop is triggered
M578: Fire inkjet bits
M579: Scale Cartesian axes
M580: Select Roland
M581: Configure external trigger
M582: Check external trigger
M584: Set drive mapping
M585: Probe Tool
M586: Configure network protocols
M587: Store WiFi host network in list, or list stored networks
M588: Forget WiFi host network
M589: Configure access point parameters
M590: Report current tool type and index
M591: Configure filament monitoring
M592: Configure nonlinear extrusion
M593: Configure Dynamic Acceleration Adjustment
M594: Enter/Leave Height Following mode
M595: Set movement queue length
M596: Select movement queue number
M600: Set line cross section
M600: Filament change pause
M601: Pause print
M602: Resume print
M603: Stop print (Prusa i3)
M603: Configure Filament Change
M605: Set dual x-carriage movement mode
M650: Set peel move parameters
M651: Execute peel move
M665: Set delta configuration
M666: Set delta endstop adjustment
M667: Select CoreXY mode
M668: Set Z-offset compensations polynomial
M669: Set kinematics type and kinematics parameters
M670: Set IO port bit mapping
M671: Define positions of Z leadscrews or bed leveling screws
M672: Program Z probe
M673: Align plane on rotary axis
M674: Set Z to center point
M675: Find center of cavity
M700: Level plate
M701: Load filament
M702: Unload filament
M703: Configure Filament
M704: Filament/MMU related gcode in development (reserve)
M705: Filament/MMU related gcode in development (reserve)
M706: Filament/MMU related gcode in development (reserve)
M707: Filament/MMU related gcode in development (reserve)
M708: Filament/MMU related gcode in development (reserve)
M709: Filament/MMU related gcode in development (reserve)
M710: Firmware dependent
M710: Controller Fan settings
M710: Erase the EEPROM and reset the board
M750: Enable 3D scanner extension
M751: Register 3D scanner extension over USB
M752: Start 3D scan
M753: Cancel current 3D scanner action
M754: Calibrate 3D scanner
M755: Set alignment mode for 3D scanner
M756: Shutdown 3D scanner
M800: Fire start print procedure
M801: Fire end print procedure
M808: Set or Goto Repeat Marker
M808 in Marlin 2.0.8
M851: Set Z-Probe Offset
M851 in Marlin 1.0.2
M851 in Marlin 1.1.0
M851 in Marlin 2.0.0
M851 in MK4duo 4.3.25
M851 in RepRapFirmware 2.02 and later
M860 Wait for Probe Temperature
M861 Set Probe Thermal Compensation
M862: Print checking
M862.1: Check nozzle diameter
M862.2: Check model code
M862.3: Model name
M862.4: Firmware version
M862.5: Gcode level
M871: PTC Configuration
M876: Dialog handling
M890 Run User Gcode
M900 Set Linear Advance Scaling Factors
M905: Set local date and time
M906: Set motor currents
M907: Set digital trimpot motor
M908: Control digital trimpot directly
M909: Set microstepping
M910: Set decay mode
M910: TMC2130 init
M911: Configure auto save on loss of power (“power panic”)
M911: Set TMC2130 holding currents
M912: Set electronics temperature monitor adjustment
M912: Set TMC2130 running currents
M913: Set motor percentage of normal current
M913: Print TMC2130 currents
M914: Set/Get Expansion Voltage Level Translator
M914: Set TMC2130 normal mode
M915: Configure motor stall detection
M915: Set TMC2130 silent mode
M916: Resume print after power failure
M916: Set TMC2130 Stallguard sensitivity threshold
M917: Set motor standstill current reduction
M917: Set TMC2130 PWM amplitude offset (pwm_ampl)
M918: Configure direct-connect display
M918: Set TMC2130 PWM amplitude gradient (pwm_grad)
M928: Start SD logging
M929: Start/stop event logging to SD card
M950: Create heater, fan or GPIO/servo device
M951: Set height following mode parameters
M952: Set CAN expansion board address and/or normal data rate
M953: Set CAN-FD bus fast data rate
M954: Configure as CAN expansion board
M955: Configure Accelerometer
M956: Collect accelerometer data and write to file
M957: Raise event
M995: Calibrate Touch Screen
M997: Perform in-application firmware update
M998: Request resend of line
M999: Restart after being stopped by error