An electric generator is a device that converts mechanical energy into electrical energy. It works by rotating a wired coil within a magnetic field. The rotation of the coil causes the magnetic field to induce an electric current in the wire. The strength of the current depends on the strength of the magnetic field, the speed of rotation, and the number of turns in the coil.
Electric generators are used in a wide variety of applications, including power plants, cars, and wind turbines. They are also used in smaller devices, such as flashlights and portable chargers.