An octane rating, or octane number, is a standard measure of the performance of an engine or aviation fuel. 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 at the end of the compression stroke using 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.
In a normal spark-ignition engine, the air-fuel mixture is heated due to being compressed and is then triggered to burn rapidly by the spark plug. If it is heated (or compressed) too much, it will self-ignite before the ignition system sparks. This causes much higher pressures than engine components are designed for, and can cause a "knocking" or "pinging" sound. Knocking can cause major engine damage if severe.
The most typically used engine management systems found in automobiles today have a knock sensor that monitors if knock is being produced by the fuel being used. In modern computer-controlled engines, the ignition timing will be automatically altered by the engine management system to reduce the knock to an acceptable level.
Octanes are a family of hydrocarbon that are typical components of gasoline. They are colorless liquids that boil around 125 °C (260 °F). One member of the octane family, isooctane, is used as a reference standard to benchmark the tendency of gasoline or LPG fuels to resist self-ignition.