An engine controller that controls an operating state of an engine through operation of an actuator (15, 18, 21) provided to the engine, the engine controller is configured to perform: a first calculation process that calculates a first intake air amount introduced into a cylinder of the engine, the first calculation process calculating the first intake air amount based on an output of an air flow meter that detects an intake air flow rate in an intake passage of the engine; a second calculation process that calculates a second intake air amount introduced into the cylinder of the engine based on at least one of a detected value of an intake pipe pressure and a throttle opening degree, without using the output of the air flow meter; a first determination process that determines whether an intake air pulsation in the intake passage is great based on the output of the air flow meter; a second determination process (P4, P11, P21) that determines whether the intake air pulsation in the intake passage is great based on at least one of the detected value of the intake pipe pressure and the throttle opening degree, without using the output of the air flow meter; and a calculation method switching process, wherein when the intake air pulsation is not determined to be great by both of the first determination process and the second determination process (P4, P11, P21), the calculation method switching process selects the first intake air amount to determine an operation amount of the actuator (15, 18, 21), and when the intake air pulsation is determined to be great by at least one of the first determination process and the second determination process (P4, P11, P21), the calculation method switching process selects the second intake air amount to determine the operation amount of the actuator (15, 18, 21), wherein when the intake air pulsation is not determined to be great by the first determination process and the intake air pulsation is determined to be great by the second determination process (P4, P11, P21), the calculation method switching process selects the second intake air amount to determine the operation amount of the actuator (15, 18, 21). a first calculation process that calculates a first intake air amount introduced into a cylinder of the engine, the first calculation process calculating the first intake air amount based on an output of an air flow meter that detects an intake air flow rate in an intake passage of the engine; a second calculation process that calculates a second intake air amount introduced into the cylinder of the engine based on at least one of a detected value of an intake pipe pressure and a throttle opening degree, without using the output of the air flow meter; a first determination process that determines whether an intake air pulsation in the intake passage is great based on the output of the air flow meter; a second determination process (P4, P11, P21) that determines whether the intake air pulsation in the intake passage is great based on at least one of the detected value of the intake pipe pressure and the throttle opening degree, without using the output of the air flow meter; and a calculation method switching process, wherein when the intake air pulsation is not determined to be great by both of the first determination process and the second determination process (P4, P11, P21), the calculation method switching process selects the first intake air amount to determine an operation amount of the actuator (15, 18, 21), and when the intake air pulsation is determined to be great by at least one of the first determination process and the second determination process (P4, P11, P21), the calculation method switching process selects the second intake air amount to determine the operation amount of the actuator (15, 18, 21), when the intake air pulsation is not determined to be great by both of the first determination process and the second determination process (P4, P11, P21), the calculation method switching process selects the first intake air amount to determine an operation amount of the actuator (15, 18, 21), and when the intake air pulsation is determined to be great by at least one of the first determination process and the second determination process (P4, P11, P21), the calculation method switching process selects the second intake air amount to determine the operation amount of the actuator (15, 18, 21), wherein when the intake air pulsation is not determined to be great by the first determination process and the intake air pulsation is determined to be great by the second determination process (P4, P11, P21), the calculation method switching process selects the second intake air amount to determine the operation amount of the actuator (15, 18, 21).