A diesel generator is the combination of a diesel engine with an electric generator (often an alternator) to generate electrical energy. This is a specific case of engine-generator. A diesel compression-ignition engine is usually designed to run on diesel fuel, but some types are adapted for other liquid fuels or natural gas.
Diesel generating sets are used in places without connection to a power grid, or as emergency power-supply if the grid fails, as well as for more complex applications such as peak-lopping, grid support and export to the power grid.
Proper sizing of diesel generators is critical to avoid low-load or a shortage of power. Sizing is complicated by the characteristics of modern electronics, specifically non-linear loads. In size ranges around 50 MW and above, an open cycle gas turbine is more efficient at full load than an array of diesel engines, and far more compact, with comparable capital costs; but for regular part-loading, even at these power levels, diesel arrays are sometimes preferred to open cycle gas turbines, due to their superior efficiencies.