Spring Calculator

Enter a spring constant, displacement, and (optionally) an attached mass to find the spring force and elastic potential energy from Hooke's Law, plus the oscillation period and frequency of a mass-spring system.

Quick Facts

Hooke's Law
F = kx
The restoring force is proportional to displacement, in the opposite direction (F = -kx).
Elastic potential energy
PE = ½kx²
Energy stored in a stretched or compressed spring; always positive.
Oscillation period
T = 2π√(m/k)
Time for one full cycle of a mass bouncing on an ideal spring.

Your Results

Calculated
Spring Force
-
F = k × x, in newtons
Elastic Potential Energy
-
PE = ½kx², in joules
Oscillation Period
-
T = 2π√(m/k), in seconds
Natural Frequency
-
f = 1/T, in hertz

Ready

Enter a spring constant and displacement, then press Calculate. Add a mass to also see the oscillation period.

How Spring Calculations Work

An ideal spring resists being stretched or compressed with a restoring force that grows in proportion to how far it is displaced from its natural (equilibrium) length. This relationship — Hooke's Law — lets you find the force needed to hold a spring at a given displacement, the elastic energy stored inside it, and, if a mass is attached, how quickly that mass bounces back and forth. This calculator uses your spring constant, displacement, and optional mass to compute all four quantities at once.

Hooke's Law and elastic potential energy

Hooke's Law states that the restoring force of a spring is F = -kx, where k is the spring constant (stiffness, in N/m) and x is the signed displacement from equilibrium; the minus sign shows the force always points back toward equilibrium. The magnitude of force required to hold the spring at displacement x is simply F = k|x|. The energy stored while stretching or compressing the spring to that point is the elastic potential energy, PE = ½kx² — the area under the straight-line force-versus-displacement graph. Because x is squared, PE is always positive whether the spring is stretched or compressed, and doubling the displacement quadruples the stored energy.

Simple harmonic motion: period and frequency

If you attach a mass m to the spring and let it oscillate freely (on a frictionless surface or hanging vertically, ignoring air resistance), it undergoes simple harmonic motion with period T = 2π√(m/k) — the time for one complete back-and-forth cycle — and frequency f = 1/T, measured in hertz (cycles per second). A stiffer spring (larger k) or a lighter mass produces faster oscillation; a heavier mass or a softer spring produces slower oscillation. Notice that the period does not depend on how far you stretch or release the spring, only on m and k — a hallmark of simple harmonic motion.

Assumptions and common mistakes

  • Elastic limit: Hooke's Law only holds while the spring deforms elastically. Stretch or compress it too far and it deforms permanently, so F = kx no longer applies.
  • Massless, ideal spring: the period formula assumes the spring itself is massless and there is no friction, air resistance, or damping — real systems oscillate with slowly decaying amplitude.
  • Sign confusion: a negative displacement means compression, not a "negative" force — always interpret the sign relative to your chosen positive direction.
  • Unit mixing: keep spring constant, displacement, and mass in consistent units before combining them; this calculator converts your chosen units to SI (N/m, m, kg) internally so results stay correct.

Frequently Asked Questions

What is Hooke's Law?
Hooke's Law states that the restoring force of an ideal spring is proportional to its displacement from equilibrium: F = -kx, where k is the spring constant (N/m) and x is the displacement. The magnitude of the force needed to stretch or compress the spring by x is F = kx. It holds only within the spring's elastic limit.
How do you calculate the elastic potential energy stored in a spring?
Elastic potential energy is PE = (1/2)kx², where k is the spring constant and x is the displacement from the spring's natural (equilibrium) length. This is the area under the force-versus-displacement line for an ideal spring, and it is always positive whether the spring is stretched or compressed.
How do you find the period of oscillation for a mass on a spring?
For a mass m attached to an ideal, massless spring with constant k undergoing simple harmonic motion, the period is T = 2π√(m/k) and the frequency is f = 1/T. Larger masses oscillate more slowly; stiffer springs (higher k) oscillate faster. This formula assumes no friction, air resistance, or damping.
What is the difference between spring constant and spring rate?
Spring constant and spring rate refer to the same quantity: the stiffness of a spring, usually written k, measured in force per unit length (such as N/m or lbf/in). A higher value means the spring resists deformation more and requires more force to stretch or compress by the same distance.