diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp
index 5a03a18cb9cada202856b81f19bec86a37e8aa2d..86197003e7493be3730aed4785e22c1eac136b96 100644
--- a/Marlin/temperature.cpp
+++ b/Marlin/temperature.cpp
@@ -342,7 +342,7 @@ int Temperature::getHeaterPower(int heater) {
       EXTRUDER_3_AUTO_FAN_PIN == EXTRUDER_2_AUTO_FAN_PIN ? 2 : 3
     };
     uint8_t fanState = 0;
-    for (int f = 0; f <= 3; f++) {
+    for (int f = 0; f <= EXTRUDERS; f++) {
       if (current_temperature[f] > EXTRUDER_AUTO_FAN_TEMPERATURE)
         SBI(fanState, fanBit[f]);
     }