What M106 / M107 means
Slicers vary part cooling by layer, material and feature. A low or zero fan may be used for the first layers to improve adhesion, followed by a higher setting for bridges and overhangs. M106 changes the requested fan output without creating toolpath geometry.
M107 is the traditional off command, although M106 S0 is often equivalent. P commonly selects a fan index in Marlin-style G-code, but the mapping from an index to a physical output is part of the printer configuration. Commands should never be copied between machines on the assumption that P0, P1 and P2 control the same hardware.
Syntax and parameters
M106 [P<fan>] S<speed>M107 [P<fan>]SRequested speed, commonly 0–255; scaling and special values are firmware-specific.
PFan index on firmware that supports multiple controllable fans.
Practical examples
Full part cooling
M106 S255Requests the default controllable fan at full scale on a common Marlin configuration.
Turn the fan off
M107Stops the default selected fan using the traditional off command.
Firmware context
| System | Status | What changes |
|---|---|---|
| Marlin | Common | Controls configured fan outputs; available parameters depend on firmware options. |
| Klipper | Check dialect | M106/M107 may be provided through printer macros or slicer compatibility; native fan commands are configuration-driven. |
| RepRapFirmware | Check dialect | Supports fan commands with its own mapping, frequency and thermostatic-control options. |
| CNC controllers | Not applicable | Do not confuse printer fan codes with CNC coolant or spindle controls. |
What this viewer can show
Fan commands remain in the file, but the current viewer does not chart fan speed or predict cooling effects. They do not change the rendered toolpath.
Common mistakes
- Fan index mapping is a machine configuration detail, not a universal standard.
- Maximum part cooling is not appropriate for every material or first layer.
- A viewer cannot infer actual airflow, fan failure or cooling performance from the command alone.
Primary sources
This page is an original explanation, reviewed against the firmware documentation below. Always confirm commands against the firmware and configuration on the machine that will execute them.