Skip to main content
Calcimator

Hooke's Law Calculator

Spring force, elastic potential energy, and oscillation period.

About this calculator

This tool applies Hooke's law, F = kx, treating the entered displacement as both the spring's static stretch (for force and stored energy) and — separately — as the amplitude of a simple-harmonic oscillation once a mass is attached. Restoring force comes straight from k times the absolute displacement, and elastic potential energy from ½kx², the area under the force-versus-displacement line. The oscillation figures (period, frequency, angular frequency, max velocity, max acceleration) all come from treating the spring-mass system as an ideal SHM oscillator: T = 2π√(m/k) is derived from Newton's second law applied to the restoring force, independent of amplitude — a stiffer spring or lighter mass always oscillates faster. Max velocity (ω times amplitude) and max acceleration (ω² times amplitude) assume the displacement you entered is the amplitude of the swing, which only matches your static-stretch scenario if you release the mass from that stretched position and let it oscillate freely.

Key assumptions: no damping (friction or air resistance), the spring stays within its elastic limit, and the mass is treated as a point mass with an ideal massless spring. The most common mixup is entering a one-time static displacement and expecting the oscillation numbers to describe a completely different physical setup — they only apply once you actually let the system swing. Also note the calculator forces both spring constant and mass to be positive nonzero values.

Inputs

ft
lb

Results

Restoring Force (N)

5

Elastic PE (J)

0.13

Oscillation Period (s)0.63
Frequency (Hz)1.59
Angular Frequency (rad/s)10
Max Velocity (m/s)0.5
Max Acceleration (m/s²)5
How to Use This Calculator
  1. Enter spring constant k (N/m) — higher values mean a stiffer spring.
  2. Enter displacement x (m) from the equilibrium position — positive for stretch, negative for compression.
  3. Enter attached mass (kg) for oscillation calculations.
  4. Read restoring force (N) and elastic potential energy (J) stored in the spring.
  5. Review oscillation period (s), frequency (Hz), and maximum velocity (m/s) for the spring-mass system.

How the result changes with Spring Constant k (N/m)

Spring Constant k (N/m)Restoring Force (N)Elastic PE (J)
502.50.06
753.750.09
1507.50.19
25012.50.31

What each input means

Spring Constant k (N/m)
Stiffness of the spring in newtons per meter.
Displacement x (m)
Distance stretched or compressed from equilibrium.
Attached Mass (kg)
Mass attached to the spring (for oscillation calculations).

What each result means

Restoring Force (N)
F = kx. Force magnitude pulling back to equilibrium.
Elastic PE (J)
PE = ½kx². Energy stored in the spring.
Oscillation Period (s)
T = 2π√(m/k). Time for one complete oscillation.
Frequency (Hz)
f = 1/T. Oscillations per second.
Angular Frequency (rad/s)
ω = 2πf.
Max Velocity (m/s)
v_max = ωA at equilibrium (if x is amplitude).
Max Acceleration (m/s²)
a_max = ω²A at maximum displacement.

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    Spring Constant k (N/m) = 100, Displacement x (m) = 0.05, Attached Mass (kg) = 1 = 3 input(s) provided
  2. Calculate Restoring Force
    Restoring Force = springConstant * absDisp
    5 = 5
  3. Calculate Elastic PE
    Elastic PE = 0.5 * springConstant * displacementM * displacementM
    0.125 = 0.125
  4. Calculate Oscillation Period
    Oscillation Period = 2 * π * sqrt(massKg / springConstant)
    0.6283 = 0.6283
  5. Calculate Frequency
    Frequency = 1 / period
    1.5915 = 1.5915

Engine last updated . Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Why does the period not depend on how far I stretch the spring?

T = 2π√(m/k) has no displacement term in it at all — the calculator only reads spring constant and mass to get the period. That's the hallmark of simple harmonic motion: a stiffer spring or heavier mass changes how fast the system oscillates, but stretching it further just means it swings through a larger arc in the same amount of time, not a shorter or longer one.

Why does doubling the displacement quadruple the elastic potential energy but only double the force?

Force is linear in displacement (F = kx), so doubling x exactly doubles F. Potential energy comes from ½kx², which has x squared in it, so doubling the displacement multiplies the stored energy by four. This is the same reason it takes progressively more work to stretch a spring further — each additional bit of stretch is fighting a larger restoring force than the bit before it.

I only entered a static stretch — why does the calculator also give me velocity and acceleration numbers?

Those numbers assume you let go of the mass from that stretched position and let it oscillate freely, treating your entered displacement as the amplitude of the resulting swing. If you're only interested in a fixed, held stretch — like a scale or a static mount — you can ignore the max velocity and max acceleration outputs; they describe a different physical scenario than a spring held in place.

What happens if I enter a negative displacement?

The calculator takes the absolute value of displacement before computing force, max velocity, and max acceleration, since those describe magnitudes. Elastic potential energy uses the squared displacement directly, so it comes out the same whether the spring is stretched or compressed by the same amount — Hooke's law and its stored energy don't care about direction, only about how far from equilibrium the spring is displaced.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Science & Physics.