An electric motor is a device used to convert electricity into mechanical energy—opposite to an electric generator. They operate using principles of electromagnetism, which shows that a force is applied when an electric current is present in a magnetic field