Compression ratio is total cylinder volume at bottom dead centre divided by what is left at top dead centre. The swept volume is easy. The clearance volume is four separate things added together, and the usual error is forgetting one of them.
Five volumes
The swept volume is the piston's travel times the bore area — the same calculation as displacement, per cylinder.
The clearance volume is the chamber in the head, plus the volume of the gasket gap, plus any space above the piston crown at top dead centre, plus the piston's dish.
Add swept to clearance, divide by clearance, and that is the ratio. Leaving out the gasket alone shifts the answer by a few tenths, and leaving out the deck clearance can shift it by more.
The gasket is a real volume
A head gasket holds the head about a millimetre off the block. Across an 86 mm bore that is 5.8 cc — comparable to a piston dish and far from negligible.
This is why gasket thickness is a tuning variable. A thinner gasket raises compression measurably, and it is the cheapest way to gain a few tenths during an assembly.
It also changes quench — how close the piston comes to the flat part of the head — which affects knock resistance separately from the ratio itself.
Deck clearance, and negative deck
Most production engines have the piston stopping slightly below the block deck at top dead centre. That gap is part of the clearance volume.
Some built engines have the piston rising slightly above the deck, called negative deck or a positive deck height. That subtracts volume, and it is entered as a negative number.
Zero decking an engine — machining the block so the piston finishes exactly level — is a common blueprinting step, and it makes this term disappear.
Domes are negative dishes
A flat-top piston has no dish and no dome, so the term is zero. A dished piston adds volume and raises the term. A domed piston occupies volume that would otherwise be chamber, which lowers the clearance volume.
Manufacturers quote dome volume as a positive number, so it has to be entered here as a negative dish. Getting that sign wrong produces a ratio that is wrong in an obvious direction, which is at least easy to spot.
A dome big enough to exceed the chamber is not physical and the calculator will say so.
Static ratio is not the whole story
The ratio calculated here is the static, geometric one. What the engine actually experiences is the dynamic compression, which depends on when the intake valve closes.
A long-duration camshaft holds the intake open well past bottom dead centre, so the effective stroke is shorter and the dynamic ratio is lower than the static one. That is why a high-compression race engine with a big cam can run on pump fuel.
Forced induction adds cylinder pressure independently of the ratio, which is why boosted engines run low static ratios. Adding boost to a high-compression engine without dropping the ratio is how engines get destroyed.