Calculate the energy stored in an ideal linear spring, or solve backward for the spring constant or deformation. Unit conversion and every calculation happen locally in your browser; input values are not sent anywhere.
Calculate spring potential energy
How spring energy changes with deformation
For a fixed spring constant, elastic energy follows a parabola. The marker shows the current deformation; the curve extends to twice that value.
At twice the deformation, the spring stores four times the energy.
Elastic potential energy formula
U = ½kx²
The energy equals the area under the linear force–deformation graph: force rises from 0 to kx, so the triangular area is ½ × x × kx. In SI units, k is in newtons per metre, x is in metres, and U is in joules.
Solve for
Rearranged formula
SI result
Energy U
U = ½kx²
joules (J)
Spring constant k
k = 2U/x²
newtons per metre (N/m)
Deformation magnitude x
x = √(2U/k)
metres (m)
Force magnitude F
F = kx
newtons (N)
Reference point: this page assigns zero elastic energy to the undeformed spring. Adding a different arbitrary potential-energy constant changes absolute U values but not energy differences or forces.
Worked examples
Find stored energy
Given: k = 250 N/m and x = 8 cm = 0.08 m.
Work: U = ½(250)(0.08)² = 0.8 J.
Find spring constant
Given: U = 2 J and x = 10 cm = 0.1 m.
Work: k = 2(2)/(0.1)² = 400 N/m.
Find compression
Given: U = 9 J and k = 800 N/m.
Work: x = √(18/800) = 0.15 m.
Model assumptions and limits
This calculator models a passive, ideal spring with constant stiffness k. It assumes the deformation is within the elastic, approximately linear range and that energy lost to hysteresis, friction, damping, heat, sound, and permanent deformation is negligible. Use measured force–displacement data or manufacturer limits for real springs, elastomers, gas springs, composite structures, and safety-critical designs.
How to use the calculator
Choose energy, spring constant, or deformation from Solve for.
Enter the other two values and choose the units actually used.
Select an answer unit and significant-figure setting, then press Calculate.
Review the SI conversions, substituted formula, related force, and model assumptions.
The deformation field is a magnitude. Compression and extension of equal magnitude produce the same result in this ideal model.
Frequently asked questions
What is the formula for elastic potential energy?
For an ideal linear spring, elastic potential energy is U = ½kx², where k is the spring constant and x is the deformation from the unstretched position.
Does compression give negative elastic potential energy?
No. Because x is squared, equal-magnitude compression and extension store the same nonnegative energy when the undeformed spring is the zero-energy reference.
What units should I use for spring energy?
Using k in N/m and x in m gives U in joules. The calculator converts the other listed units to SI before applying the formula.
Why does doubling deformation quadruple spring energy?
Energy depends on x². Replacing x with 2x multiplies the energy by 2², or four.
When is U = ½kx² inaccurate?
It is inaccurate when stiffness changes substantially with deformation or energy is not fully recoverable—for example near yielding, coil bind, large geometric deformation, hysteresis, or friction.
Is spring potential energy measured from equilibrium or natural length?
For a standalone ideal spring, x is measured from its undeformed natural length. For a vertical oscillator, a gravity-shifted equilibrium can be used if elastic and gravitational potential energy are combined consistently.