The static compression ratio of an internal combustion engine or external combustion engine is a value that represents the ratio of the volume of its combustion chamber from its largest capacity to its smallest capacity. It is a fundamental specification for many common combustion engines.
In a piston engine, it is the ratio between the volume of the cylinder and combustion chamber when the piston is at the bottom of its stroke, and the volume of the combustion chamber when the piston is at the top of its stroke.
For example, a cylinder and its combustion chamber with the piston at the bottom of its stroke may contain 1000 cc of air (900 cc in the cylinder plus 100 cc in the combustion chamber). When the piston has moved up to the top of its stroke inside the cylinder, and the remaining volume inside the head or combustion chamber has been reduced to 100 cc, then the compression ratio would be proportionally described as 1000:100, or with fractional reduction, a 10:1 compression ratio.
A high compression ratio is desirable because it allows an engine to extract more mechanical energy from a given mass of air-fuel mixture due to its higher thermal efficiency. This occurs because internal combustion engines are heat engines, and higher efficiency is created because higher compression ratios permit the same combustion temperature to be reached with less fuel, while giving a longer expansion cycle, creating more mechanical power output and lowering the exhaust temperature. It may be more helpful to think of it as an "expansion ratio", since more expansion reduces the temperature of the exhaust gases, and therefore the energy wasted to the atmosphere. Diesel engines actually have a higher peak combustion temperature than petrol engines, but the greater expansion means they reject less heat in their cooler exhaust.
Higher compression ratios will however make gasoline engines subject to engine knocking (also known as detonation) if lower octane-rated fuel is used. This can reduce efficiency or damage the engine if knock sensors are not present to modify the ignition timing. However, knock sensors have been a requirement of the OBD-II specification used in 1996 model year vehicles and newer.