Reference
3D Printer G-Code List — Marlin and Klipper Commands
Complete 3D printer G-code list for Marlin and Klipper: temperature, motion, bed levelling, calibration and settings, each with parameters, example and tips.
- G1: Linear move (G0 / G1) (Marlin & Klipper)G1 linear move (G0 / G1) for Marlin & Klipper 3D printers: syntax G1 [X] [Y] [Z] [E] [F], parameters, example and tips.
- G2: Arc move clockwise (G2 / G3) (Marlin & Klipper)G2 arc move clockwise (G2 / G3) for Marlin & Klipper 3D printers: syntax G2 X Y I J [E] [F] or G2 X Y R [E] [F], parameters, example and tips.
- G4: Dwell (pause) (Marlin & Klipper)G4 dwell (pause) for Marlin & Klipper 3D printers: syntax G4 P<ms> or G4 S<s>, parameters, example and tips.
- G10: Firmware retract (G10 / G11) (Marlin & Klipper)G10 firmware retract (G10 / G11) for Marlin & Klipper 3D printers: syntax G10 then G11, parameters, example and tips.
- G28: Home axes (Marlin & Klipper)G28 home axes for Marlin & Klipper 3D printers: syntax G28 [X] [Y] [Z], parameters, example and tips.
- G90: Absolute positioning (G90 / G91) (Marlin & Klipper)G90 absolute positioning (G90 / G91) for Marlin & Klipper 3D printers: syntax G90 or G91, parameters, example and tips.
- G92: Set position (G92 E0) (Marlin & Klipper)G92 set position (G92 E0) for Marlin & Klipper 3D printers: syntax G92 [X] [Y] [Z] [E], parameters, example and tips.
- M104: Set hotend temperature (no wait) (Marlin & Klipper)M104 set hotend temperature (no wait) for Marlin & Klipper 3D printers: syntax M104 S<°C> [T<tool>], parameters, example and tips.
- M109: Set hotend temperature and wait (Marlin & Klipper)M109 set hotend temperature and wait for Marlin & Klipper 3D printers: syntax M109 S<°C> or M109 R<°C>, parameters, example and tips.
- M140: Set bed temperature (no wait) (Marlin & Klipper)M140 set bed temperature (no wait) for Marlin & Klipper 3D printers: syntax M140 S<°C>, parameters, example and tips.
- M190: Set bed temperature and wait (Marlin & Klipper)M190 set bed temperature and wait for Marlin & Klipper 3D printers: syntax M190 S<°C> or M190 R<°C>, parameters, example and tips.
- M141: Set chamber temperature (Marlin)M141 set chamber temperature for Marlin 3D printers: syntax M141 S<°C>, parameters, example and tips.
- M303: PID autotune (Marlin)M303 pID autotune for Marlin 3D printers: syntax M303 E<heater> S<°C> C<cycles> [U1], parameters, example and tips.
- M301: Set hotend PID values (Marlin)M301 set hotend PID values for Marlin 3D printers: syntax M301 P<Kp> I<Ki> D<Kd>, parameters, example and tips.
- M304: Set bed PID values (Marlin)M304 set bed PID values for Marlin 3D printers: syntax M304 P I D, parameters, example and tips.
- M155: Temperature auto report (Marlin)M155 temperature auto report for Marlin 3D printers: syntax M155 S<seconds>, parameters, example and tips.
- M105: Report temperatures (Marlin & Klipper)M105 report temperatures for Marlin & Klipper 3D printers: syntax M105, parameters, example and tips.
- M82: Absolute extrusion (M82 / M83) (Marlin & Klipper)M82 absolute extrusion (M82 / M83) for Marlin & Klipper 3D printers: syntax M82 or M83, parameters, example and tips.
- M92: Set steps per unit (E-steps) (Marlin)M92 set steps per unit (E-steps) for Marlin 3D printers: syntax M92 [X] [Y] [Z] [E], parameters, example and tips.
- M221: Flow percentage (Marlin & Klipper)M221 flow percentage for Marlin & Klipper 3D printers: syntax M221 S<percent>, parameters, example and tips.
- M220: Speed factor (Marlin & Klipper)M220 speed factor for Marlin & Klipper 3D printers: syntax M220 S<percent>, parameters, example and tips.
- M900: Linear advance factor (Marlin)M900 linear advance factor for Marlin 3D printers: syntax M900 K<factor>, parameters, example and tips.
- M600: Filament change (Marlin)M600 filament change for Marlin 3D printers: syntax M600 [X Y Z E L U], parameters, example and tips.
- M412: Filament runout sensor (Marlin)M412 filament runout sensor for Marlin 3D printers: syntax M412 S<0|1>, parameters, example and tips.
- G29: Bed levelling (probe the mesh) (Marlin)G29 bed levelling (probe the mesh) for Marlin 3D printers: syntax G29 [options depend on the levelling type], parameters, example and tips.
- M420: Bed levelling state (Marlin)M420 bed levelling state for Marlin 3D printers: syntax M420 [S<0|1>] [Z<fade>] [V], parameters, example and tips.
- M851: Probe offset (Z offset) (Marlin)M851 probe offset (Z offset) for Marlin 3D printers: syntax M851 [X] [Y] [Z], parameters, example and tips.
- M48: Probe repeatability test (Marlin)M48 probe repeatability test for Marlin 3D printers: syntax M48 [P<count>] [X Y] [V], parameters, example and tips.
- G34: Z stepper auto-align (Marlin)G34 z stepper auto-align for Marlin 3D printers: syntax G34 [I<iterations>] [T<accuracy>], parameters, example and tips.
- G26: Mesh validation pattern (Marlin)G26 mesh validation pattern for Marlin 3D printers: syntax G26 [H<°C>] [B<°C>] [P], parameters, example and tips.
- M500: Save settings to EEPROM (Marlin)M500 save settings to EEPROM for Marlin 3D printers: syntax M500, parameters, example and tips.
- M501: Load settings from EEPROM (Marlin)M501 load settings from EEPROM for Marlin 3D printers: syntax M501, parameters, example and tips.
- M502: Factory reset (firmware defaults) (Marlin)M502 factory reset (firmware defaults) for Marlin 3D printers: syntax M502, parameters, example and tips.
- M503: Report settings (Marlin)M503 report settings for Marlin 3D printers: syntax M503, parameters, example and tips.
- M201: Max acceleration per axis (Marlin)M201 max acceleration per axis for Marlin 3D printers: syntax M201 [X] [Y] [Z] [E], parameters, example and tips.
- M203: Max feed rate per axis (Marlin)M203 max feed rate per axis for Marlin 3D printers: syntax M203 [X] [Y] [Z] [E], parameters, example and tips.
- M204: Set acceleration (Marlin & Klipper)M204 set acceleration for Marlin & Klipper 3D printers: syntax M204 [P<print>] [R<retract>] [T<travel>] or M204 S<accel>, parameters, example and tips.
- M205: Jerk and junction deviation (Marlin)M205 jerk and junction deviation for Marlin 3D printers: syntax M205 [J<deviation>] or M205 [X Y Z E jerk], parameters, example and tips.
- M593: Input shaping (Marlin) (Marlin)M593 input shaping (Marlin) for Marlin 3D printers: syntax M593 [X|Y] F<Hz> D<damping>, parameters, example and tips.
- M906: Stepper motor current (TMC) (Marlin)M906 stepper motor current (TMC) for Marlin 3D printers: syntax M906 [X] [Y] [Z] [E] <mA>, parameters, example and tips.
- M413: Power-loss recovery (Marlin)M413 power-loss recovery for Marlin 3D printers: syntax M413 S<0|1>, parameters, example and tips.
- M106: Fan on (part cooling) (Marlin & Klipper)M106 fan on (part cooling) for Marlin & Klipper 3D printers: syntax M106 S<0–255> [P<fan>], parameters, example and tips.
- M107: Fan off (Marlin & Klipper)M107 fan off for Marlin & Klipper 3D printers: syntax M107 [P<fan>], parameters, example and tips.
- M84: Disable motors (M84 / M18) (Marlin & Klipper)M84 disable motors (M84 / M18) for Marlin & Klipper 3D printers: syntax M84 [X Y Z E], parameters, example and tips.
- M400: Finish moves (Marlin & Klipper)M400 finish moves for Marlin & Klipper 3D printers: syntax M400, parameters, example and tips.
- M117: Display message (Marlin & Klipper)M117 display message for Marlin & Klipper 3D printers: syntax M117 <text>, parameters, example and tips.
- M73: Set print progress (Marlin & Klipper)M73 set print progress for Marlin & Klipper 3D printers: syntax M73 P<percent> [R<minutes>], parameters, example and tips.
- M114: Report position (Marlin & Klipper)M114 report position for Marlin & Klipper 3D printers: syntax M114, parameters, example and tips.
- M119: Endstop states (Marlin)M119 endstop states for Marlin 3D printers: syntax M119, parameters, example and tips.
- M300: Beep (Marlin)M300 beep for Marlin 3D printers: syntax M300 S<Hz> P<ms>, parameters, example and tips.
- M112: Emergency stop (Marlin & Klipper)M112 emergency stop for Marlin & Klipper 3D printers: syntax M112, parameters, example and tips.
- M25: Pause SD print (M25 / M24) (Marlin)M25 pause SD print (M25 / M24) for Marlin 3D printers: syntax M25 then M24, parameters, example and tips.
- PRINT_START: Start macro (convention) (Klipper)PRINT_START start macro (convention) for Klipper 3D printers: syntax PRINT_START BED=<°C> EXTRUDER=<°C>, parameters, example and tips.
- BED_MESH_CALIBRATE: Probe the bed mesh (Klipper) (Klipper)BED_MESH_CALIBRATE probe the bed mesh (Klipper) for Klipper 3D printers: syntax BED_MESH_CALIBRATE [PROFILE=<name>] [ADAPTIVE=1], parameters, example and…
- BED_MESH_PROFILE: Save and load mesh profiles (Klipper)BED_MESH_PROFILE save and load mesh profiles for Klipper 3D printers: syntax BED_MESH_PROFILE LOAD=<name> | SAVE=<name> | REMOVE=<name>, parameters, example…
- SAVE_CONFIG: Save calibration to printer.cfg (Klipper)SAVE_CONFIG save calibration to printer.cfg for Klipper 3D printers: syntax SAVE_CONFIG, parameters, example and tips.
- SET_PRESSURE_ADVANCE: Pressure advance (Klipper) (Klipper)SET_PRESSURE_ADVANCE pressure advance (Klipper) for Klipper 3D printers: syntax SET_PRESSURE_ADVANCE ADVANCE=<value> [SMOOTH_TIME=<s>], parameters, example…
- SET_VELOCITY_LIMIT: Speed, acceleration and corner limits (Klipper)SET_VELOCITY_LIMIT speed, acceleration and corner limits for Klipper 3D printers: syntax SET_VELOCITY_LIMIT [VELOCITY] [ACCEL] [SQUARE_CORNER_VELOCITY]…
- PID_CALIBRATE: PID tuning (Klipper) (Klipper)PID_CALIBRATE pID tuning (Klipper) for Klipper 3D printers: syntax PID_CALIBRATE HEATER=<extruder|heater_bed> TARGET=<°C>, parameters, example and tips.
- SHAPER_CALIBRATE: Measure resonances (input shaper) (Klipper)SHAPER_CALIBRATE measure resonances (input shaper) for Klipper 3D printers: syntax SHAPER_CALIBRATE [AXIS=X|Y], parameters, example and tips.
- SET_INPUT_SHAPER: Set input shaper (Klipper)SET_INPUT_SHAPER set input shaper for Klipper 3D printers: syntax SET_INPUT_SHAPER SHAPER_FREQ_X=<Hz> SHAPER_FREQ_Y=<Hz> SHAPER_TYPE=<mzv|ei|zv|...>…
- TUNING_TOWER: Change a value with height (Klipper)TUNING_TOWER change a value with height for Klipper 3D printers: syntax TUNING_TOWER COMMAND=<cmd> PARAMETER=<name> START=<v> FACTOR=<v per mm> |…
- Z_TILT_ADJUST: Level the gantry (two or three Z motors) (Klipper)Z_TILT_ADJUST level the gantry (two or three Z motors) for Klipper 3D printers: syntax Z_TILT_ADJUST, parameters, example and tips.
- QUAD_GANTRY_LEVEL: Quad gantry level (Klipper)QUAD_GANTRY_LEVEL quad gantry level for Klipper 3D printers: syntax QUAD_GANTRY_LEVEL, parameters, example and tips.
- PROBE_CALIBRATE: Find the probe Z offset (Klipper)PROBE_CALIBRATE find the probe Z offset for Klipper 3D printers: syntax PROBE_CALIBRATE, parameters, example and tips.
- SET_GCODE_OFFSET: Live Z (babystep) (Klipper)SET_GCODE_OFFSET live Z (babystep) for Klipper 3D printers: syntax SET_GCODE_OFFSET Z=<mm> | Z_ADJUST=<mm> [MOVE=1], parameters, example and tips.
- SCREWS_TILT_CALCULATE: Bed screw turns (Klipper)SCREWS_TILT_CALCULATE bed screw turns for Klipper 3D printers: syntax SCREWS_TILT_CALCULATE, parameters, example and tips.
- TEMPERATURE_WAIT: Wait for a temperature range (Klipper)TEMPERATURE_WAIT wait for a temperature range for Klipper 3D printers: syntax TEMPERATURE_WAIT SENSOR=<name> [MINIMUM=<°C>] [MAXIMUM=<°C>], parameters…
- SET_HEATER_TEMPERATURE: Set a heater (Klipper)SET_HEATER_TEMPERATURE set a heater for Klipper 3D printers: syntax SET_HEATER_TEMPERATURE HEATER=<name> TARGET=<°C>, parameters, example and tips.
- SET_RETRACTION: Change firmware retraction (Klipper)SET_RETRACTION change firmware retraction for Klipper 3D printers: syntax SET_RETRACTION [RETRACT_LENGTH] [RETRACT_SPEED] [UNRETRACT_EXTRA_LENGTH]…
- EXCLUDE_OBJECT: Cancel one object (Klipper)EXCLUDE_OBJECT cancel one object for Klipper 3D printers: syntax EXCLUDE_OBJECT NAME=<object>, parameters, example and tips.
- PAUSE: Pause, resume, cancel (Klipper)PAUSE pause, resume, cancel for Klipper 3D printers: syntax PAUSE / RESUME / CANCEL_PRINT, parameters, example and tips.
- FIRMWARE_RESTART: Restart (RESTART / FIRMWARE_RESTART) (Klipper)FIRMWARE_RESTART restart (RESTART / FIRMWARE_RESTART) for Klipper 3D printers: syntax RESTART or FIRMWARE_RESTART, parameters, example and tips.