A motor driving apparatus includes: a first inverter including: a plurality of first switching elements and connected to a first end of each of the windings; a second inverter including: a plurality of second switching elements and connected to a second end of each of the windings; and a controller configured to control a switching state of the plurality of first switching elements and the plurality of second switching elements based on a driving mode of the motor in one sampling period.