An inverter controller controlling an inverter main circuit which drives a motor by converting a direct current power of a direct current power source into an alternating current power, the inverter controller comprising: a PWM signal generating part configured to generate a PWM signal to control on-off of a plurality of switching elements configuring the inverter main circuit; an operating state detecting part configured to detect an operating state of the motor based on a direct current bus voltage of the inverter main circuit, a motor current which flows between the inverter main circuit and the motor and an operation instruction to the motor; a gate resistance selecting signal generating part configured to generate a gate resistance selecting signal corresponding to the operating state of the motor; and a gate resistance selecting part (16, 17, 18, 19, 20, 21) configured to select gate resistances connected to gate terminals of the switching elements of the inverter main circuit by using the gate resistance selecting signal, wherein the operating state detecting part is configured to detect the operating state as a restricted power supply state when the operation instruction is restricted power supply, wherein the operating state detecting part is configured to detect the operating state as an overload operating state when the operation instruction is a rotational operation other than the restricted power supply and the motor current is larger than a predetermined first threshold value, wherein the operating state detecting part is configured to detect the operating state as a light load operating state in which the direct current bus voltage is high when the operation instruction is a rotational operation other than the restricted power supply, the motor current is smaller than a predetermined second threshold value and the direct current bus voltage is larger than a predetermined third threshold value, wherein the operating state detecting part is configured to detect the operating state as a stop state when the operation instruction is neither the restricted power supply nor the rotational operation, and wherein the operating state detecting part is configured to detect the operating state as a normal operating state when the operating state is none of the restricted power supply state, the overload operating state, the light load operating state in which the direct current bus voltage is high and the stop state. a PWM signal generating part configured to generate a PWM signal to control on-off of a plurality of switching elements configuring the inverter main circuit; an operating state detecting part configured to detect an operating state of the motor based on a direct current bus voltage of the inverter main circuit, a motor current which flows between the inverter main circuit and the motor and an operation instruction to the motor; a gate resistance selecting signal generating part configured to generate a gate resistance selecting signal corresponding to the operating state of the motor; and a gate resistance selecting part (16, 17, 18, 19, 20, 21) configured to select gate resistances connected to gate terminals of the switching elements of the inverter main circuit by using the gate resistance selecting signal, wherein the operating state detecting part is configured to detect the operating state as a restricted power supply state when the operation instruction is restricted power supply, wherein the operating state detecting part is configured to detect the operating state as an overload operating state when the operation instruction is a rotational operation other than the restricted power supply and the motor current is larger than a predetermined first threshold value, wherein the operating state detecting part is configured to detect the operating state as a light load operating state in which the direct current bus voltage is high when the operation instruction is a rotational operation other than the restricted power supply, the motor current is smaller than a predetermined second threshold value and the direct current bus voltage is larger than a predetermined third threshold value, wherein the operating state detecting part is configured to detect the operating state as a stop state when the operation instruction is neither the restricted power supply nor the rotational operation, and wherein the operating state detecting part is configured to detect the operating state as a normal operating state when the operating state is none of the restricted power supply state, the overload operating state, the light load operating state in which the direct current bus voltage is high and the stop state.