An electric motor converts mechanical energy into electrical energy.
The basic idea of an electric motor is very simple. We supply electricity through the terminals and obtain axle rotation, giving us mechanical power to drive any machine at the expense of electricity. Thus, an electric motor converts electrical energy into mechanical energy.
A device that converts mechanical energy to electrical energy is called a generator.