A heater controller configured to perform on/off control of a plurality of heaters (121A, 121B), the heater controller comprising: a storage unit configured to store therein a plurality of pattern sets, wherein each of the pattern sets includes a plurality of heater-on/off patterns for respectively controlling the heaters, and each of the heater-on/off patterns is set in terms of a predetermined control period; a reference-value calculating unit configured to calculate a reference value representing an average of values of electric power supplied to the heater controller over a predetermined period of time; an output-value calculating unit configured to calculate, for each of the pattern sets, an output power value to be supplied to the heaters (121A, 121B) when the heaters are turned-on according to the heater-on/off patterns included in the pattern set; a difference calculating unit configured to calculate, for each of the pattern sets, a difference between the reference value and the output power value; a selecting unit configured to select, from the pattern sets, one pattern set having a smallest difference; and an on/off control unit configured to perform on/off control of the heaters (121A, 121B) according to the heater-on/off patterns included in the pattern set selected by the selecting unit, respectively, each of the heater-on/off patterns is made up of a plurality of half-waves, each of which is a half of a cycle of an alternating current, AC, supply voltage to be supplied to the heaters (121A, 121B), characterised in that, the output-value calculating unit being configured to calculate the output power value for each of the half-waves within one control period, and the difference calculating unit being configured to calculate per-half-wave differences between the reference value and each output power value calculated for each of the half-waves in the one control period and calculates a sum of the per-half-wave differences over the one control period. a storage unit configured to store therein a plurality of pattern sets, wherein each of the pattern sets includes a plurality of heater-on/off patterns for respectively controlling the heaters, and each of the heater-on/off patterns is set in terms of a predetermined control period; a reference-value calculating unit configured to calculate a reference value representing an average of values of electric power supplied to the heater controller over a predetermined period of time; an output-value calculating unit configured to calculate, for each of the pattern sets, an output power value to be supplied to the heaters (121A, 121B) when the heaters are turned-on according to the heater-on/off patterns included in the pattern set; a difference calculating unit configured to calculate, for each of the pattern sets, a difference between the reference value and the output power value; a selecting unit configured to select, from the pattern sets, one pattern set having a smallest difference; and an on/off control unit configured to perform on/off control of the heaters (121A, 121B) according to the heater-on/off patterns included in the pattern set selected by the selecting unit, respectively, each of the heater-on/off patterns is made up of a plurality of half-waves, each of which is a half of a cycle of an alternating current, AC, supply voltage to be supplied to the heaters (121A, 121B), characterised in that, the output-value calculating unit being configured to calculate the output power value for each of the half-waves within one control period, and the difference calculating unit being configured to calculate per-half-wave differences between the reference value and each output power value calculated for each of the half-waves in the one control period and calculates a sum of the per-half-wave differences over the one control period.