Petrol/gasoline engines are limited in the variety and quality of the fuels they can burn. Older petrol engines fitted with a carburetor required a volatile fuel that would vaporize easily to create the necessary air-fuel ratio for combustion. Because both air and fuel are admitted to the cylinder, if the compression ratio of the engine is too high or the fuel too volatile (with too low an octane rating), the fuel will ignite under compression, as in a diesel engine, before the piston reaches the top of its stroke. This pre-ignition causes a power loss and over time major damage to the piston and cylinder. The need for a fuel that is volatile enough to vaporize but not too volatile (to avoid pre-ignition) means that petrol engines will only run on a narrow range of fuels. There has been some success at dual-fuel engines that use petrol and ethanol, petrol and propane, and petrol and methane.
In diesel engines, a mechanical injector system vaporizes the fuel directly into the combustion chamber or a pre-combustion chamber (as opposed to a Venturi jet in a carburetor, or a Fuel injector in a fuel injection system vaporizing fuel into the intake manifold or intake runners as in a petrol engine). This forced vaporisation means that less-volatile fuels can be used. More crucially, because only air is inducted into the cylinder in a diesel engine, the compression ratio can be much higher as there is no risk of pre-ignition provided the injection process is accurately timed. This means that cylinder temperatures are much higher in a diesel engine than a petrol engine, allowing less volatile fuels to be used.
Diesel fuel is a form of light fuel oil, very similar to kerosene/paraffin, but diesel engines, especially older or simple designs that lack precision electronic injection systems, can run on a wide variety of other fuels. Some of the most common alternatives are Jet A-1 or vegetable oil from a very wide variety of plants. Some engines can be run on vegetable oil without modification, and most others require fairly basic alterations. Biodiesel is a pure diesel-like fuel refined from vegetable oil and can be used in nearly all diesel engines. The only limits on the fuels used in diesel engines are the ability of the fuel to flow along the fuel lines and the ability of the fuel to lubricate the injector pump and injectors adequately. Inline mechanical injector generally pumps tolerate poor-quality or bio-fuels better than distributor-type pumps. Also, indirect injection engines generally run more satisfactorily on bio-fuels than direct injection engines. This is partly because an indirect injection engine has a much greater 'swirl' effect, improving vaporisation and combustion of fuel, and because (in the case of vegetable oil-type fuels) lipid depositions can condense on the cylinder walls of a direct-injection engine if combustion temperatures are too low (such as starting the engine from cold).
It is often reported that Diesel designed his engine to run on peanut oil, but this is not the case. Diesel stated in his published papers, "at the Pairs Exhibition in 1900 (Exposition Universelle) there was shown by the Otto Company a small diesel engine, which, at the request of the French Government ran on Arachide (earth-nut or pea-nut) oil (see biodiesel), and worked so smoothly that only a few people were aware of it. The engine was constructed for using mineral oil, and was then worked on vegetable oil without any alterations being made. The French Government at the time thought of testing the applicability to power production of the Arachide, or earth-nut, which grows in considerable quantities in their African colonies, and can easily be cultivated there." Diesel himself later conducted related tests and appeared supportive of the idea.
Most large marine diesels (often called cathedral engines due to their size) run on heavy fuel oil (sometimes called "bunker oil"), which is a thick, viscous and almost flameproof fuel which is very safe to store and cheap to buy in bulk as it is a waste product from the petroleum refining industry. The fuel must be heated to thin it out (often by the exhaust header) and is often passed through multiple injection stages to vaporize it.