An electric generator is a device that converts mechanical energy to electrical energy for use in a circuit.