compression on a 318

heads CC and deck height mostly
When 318willrun said this, the deck height of the block is high and often doesn’t come in on its actual measurements as what the books say they are.

Id like to add that the piston height from the wrist line on up will vary a lot. Between the three listed here and the head gasket thickness is how you come to the mathematics of the compression ratio.

As mentioned above, piston replacement is how you would start. There are 2 styles from Keith Black, 1 flat top, 1 with a small dome. Once you have the machine work done to the block and heads to be dead flat for a perfect mating, you will know or adjust for where the piston sits in the block. Now you can figure out what thickness of a head gasket you can use for the desired ratio.
I suggest keeping an iron header engine below 10-1 to ru n pump gas without issues. 9.5-1 is great.