An octane rating, or octane number, is a standard measure of the performance of an engine or aviation gasoline. The higher the octane number, the more compression the fuel can withstand before detonating (igniting). In broad terms, fuels with a higher octane rating are used in high-performance gasoline engines that require higher compression ratios. In contrast, fuels with lower octane numbers (but higher cetane numbers) are ideal for diesel engines, because diesel engines (also referred to as compression-ignition engines) do not compress the fuel, but rather compress only air and then inject fuel into the air which was heated by compression.
Gasoline engines rely on ignition of air and fuel compressed together as a mixture, which is ignited near the end of the compression stroke using electrically activated spark plugs. Therefore, high compressibility of the fuel matters mainly for gasoline engines. Use of gasoline with lower octane numbers may lead to the problem of engine knocking
Petroleum