When a spring is stretched, work is done on it and energy is stored. The energy stored is found with E = 0.5 × k × x2, where k is the spring constant in N/m and x is the extension in metres. The force needed is found separately with F = k × x.
The equation only works when every quantity is in the right unit, so the first step is often a unit conversion. Extensions are usually measured in centimetres, so divide by 100 to change them into metres. An extension of 5 cm is 0.05 m. If you leave the extension in centimetres, the answer will be wrong by a huge factor.
Worked example: a spring has k = 20 N/m and is stretched by 0.10 m. First square the extension: 0.10 × 0.10 = 0.01 m2. Then E = 0.5 × 20 × 0.01 = 0.1 J. Because x is squared, doubling the extension makes the stored energy four times bigger.
Energy is measured in joules. Work done is force × distance moved in the direction of the force, so a force in newtons multiplied by a distance in metres gives newton-metres. One newton-metre is the same as one joule, so the answer can be written in either unit.