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
Results
Restoring Force (N)
5
Elastic PE (J)
0.13
How to Use This Calculator
- Enter spring constant k (N/m) — higher values mean a stiffer spring.
- Enter displacement x (m) from the equilibrium position — positive for stretch, negative for compression.
- Enter attached mass (kg) for oscillation calculations.
- Read restoring force (N) and elastic potential energy (J) stored in the spring.
- 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) |
|---|---|---|
| 50 | 2.5 | 0.06 |
| 75 | 3.75 | 0.09 |
| 150 | 7.5 | 0.19 |
| 250 | 12.5 | 0.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
- Identify Input ParametersSpring Constant k (N/m) = 100, Displacement x (m) = 0.05, Attached Mass (kg) = 1 = 3 input(s) provided
- Calculate Restoring ForceRestoring Force = springConstant * absDisp5 = 5
- Calculate Elastic PEElastic PE = 0.5 * springConstant * displacementM * displacementM0.125 = 0.125
- Calculate Oscillation PeriodOscillation Period = 2 * π * sqrt(massKg / springConstant)0.6283 = 0.6283
- Calculate FrequencyFrequency = 1 / period1.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.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Electric Field Calculator
Electric field, force, and potential from charge and distance.
PhysicsElastic Collision Calculator
Final velocities and energy transfer in 1D elastic collisions.
PhysicsFluid Dynamics (Bernoulli) Calculator
Apply Bernoulli's equation to calculate pressure or velocity changes in an ideal fluid between two points at different heights.
More in Science & Physics.