The ability to get energy out depends on the material's elasticity. The energy stored in a spring depends on the: Distance the spring is deformed (stretched or compressed) The spring constant, which defines the amount of force required to deform a spring by a certain length (the work done on the spring).