First enter the spring constant in pounds-force/inch, Newtons/meter or dynes/cm and select units from drop down menu.
This is the force required to compress a spring a fixed distance. ie: If 2 pounds of force is required to compress a
spring 1 inch the spring constant is 2 lbf-in. Next enter the compression values. These are the minimum and maximum
compression lengths. ie: If the spring is compressed by 2 inches from it's uncompressed length enter min=0 and max=2.
If compression starts at 1 inch and goes to 2 inches enter min=1 and max=2. Select length units from the drop down menu.
Click COMPUTE and read the energy in the output panel.
The formula is: PE = 0.5 * k * x^2
where k is the spring constant in Newton-meters and x is the compression in meters.
PE for minimum and maximum compression values are computed then the minimum PE is subtracted from the maximum PE to
give energy required to compress the spring over that distance. That energy will be released when the
spring returns to the min position.
More information on storing energy in springs.