A generator is a device that converts mechanical energy into electrical energy with the help of magnetic field. No other source of electric power can produce as large amounts of electric power as the generator.
A conductor or a set of conductors is rotated in a magnetic field and voltage is developed across the rotating conductor due to electromagnetic induction.
The energy for the rotation of the conductors can be supplied by water, coal, diesel or gas or even nuclear fuel. Accordingly, there are hydro-generators, thermal generators, and nuclear reactors, respectively.
There are two types of generators:
Both these generators work on the principle of electromagnetic induction.