An electric motor is an electrical machine that converts electrical energy into mechanical energy. Most electric motors operate through the interaction between the motor's magnetic field and electric current in a wire winding to generate force in the form of torque applied on the motor's shaft. Electric motors can be powered by direct current (DC) sources, such as from batteries, or rectifiers, or by alternating current (AC) sources, such as a power grid, inverters or electrical generators. An electric generator is mechanically identical to an electric motor, but operates with a reversed flow of power, converting mechanical energy into electrical energy.
Electric motors may be classified by considerations such as power source type, internal construction, application and type of motion output. In addition to AC versus DC types, motors may be brushed or brushless, may be of various phase (see single-phase, two-phase, or three-phase), and may be either air-cooled or liquid-cooled.