Generators are devices that convert mechanical energy into electrical energy. They are available in a variety of styles and dimensions, from compact portable units used for leisure activities to enormous commercial generators used to power residences, structures, and events. Diesel, gasoline, propane, natural gas, and solar-powered generators are a few examples of typical generator kinds.