The extension of a spring is how much longer it gets: the new length minus the original length. For linear elastic distortion the force on a spring is directly proportional to its extension. This is written as force = spring constant × extension, or F = k × x.
Force is in newtons (N), extension is in metres (m) and the spring constant is in N/m. Extensions measured in centimetres must be divided by 100 to give metres, so 3 cm is 0.03 m. A stiff spring has a larger spring constant than a soft one because it needs more force for the same extension.
Rearranging gives k = F ÷ x. A force of 4 N that stretches a spring by 0.08 m gives k = 4 ÷ 0.08 = 50 N/m. A force of 10 N that gives an extension of 0.20 m also gives 50 N/m. To find a force, multiply: a spring with a spring constant of 25 N/m stretched by 0.30 m needs a force of 25 × 0.30 = 7.5 N.
The equation only works while the spring obeys the straight-line rule. Past the limit of proportionality the force is no longer proportional to the extension.