Spring Calculator
Solve spring problems using Hooke’s Law, spring work (area under the F–x curve), simple harmonic motion, vertical equilibrium, and energy swapping (EPE ↔ KE). Includes quick picks, step-by-step, and mini visuals.
Background
For an ideal (linear) spring, force is proportional to displacement: F = −kx. The minus sign means the spring force points opposite the displacement. Energy stored is E = ½kx², and in oscillations energy swaps between spring energy and kinetic energy.
How to use this calculator
- Choose a mode (Hooke’s law, work, SHM period, vertical equilibrium, or energy swap).
- Select your preferred units for x, k, and m.
- Enter values and click Calculate.
- Turn on step-by-step and visuals for extra intuition.
How this calculator works
- Step 1 — Pick a mode. The calculator uses a different model depending on what you’re solving: Hooke’s law, spring work, SHM period, vertical equilibrium, or energy swap.
- Step 2 — Convert everything to “physics units” internally. Displacement x is converted to meters (m), spring constant k to N/m, and mass m to kg. Results are then displayed in the units you selected.
- Step 3 — Apply the correct relationship for that mode. For example, Hooke’s law uses the restoring-force idea (force points back toward equilibrium), spring work is computed from the change in spring energy between x₁ and x₂, and SHM period depends only on m and k (not amplitude).
- Sign convention matters. In Hooke’s law mode, the spring force is opposite the displacement: a positive stretch (x > 0) produces a negative force (F < 0). If you enable “Treat x as magnitude”, the calculator uses |x| where that makes physical sense.
- Visuals (when enabled). The mini visuals illustrate: (1) the linear F–x relationship (slope = k), and/or (2) how energy splits between spring energy and kinetic energy at your chosen position x.
- Safety warning (optional). If you enter x_safe, the calculator flags when |x| exceeds it (or warns at |x| > 0.5 m if no safe limit is provided).
Formula & Equation Used
Hooke’s law (restoring force): F = −kx (F in N, k in N/m, x in m)
Spring potential energy: U = ½kx² (U in J)
Work done by the spring (x₁ → x₂): W = ½k(x₁² − x₂²) (W in J; positive means the spring gives energy to the mass)
SHM period (mass–spring): T = 2π√(m/k) (T in s, m in kg)
Vertical equilibrium stretch: mg = kx (g ≈ 9.80665 m/s²)
Total energy (energy swap): E = ½kx² + ½mv² (E in J, v in m/s)
Example Problems & Step-by-Step Solutions
Example 1 — Hooke’s law force
A spring has k = 200 N/m and is stretched x = 0.10 m. Find the spring force.
- F = −kx
- F = −(200)(0.10)
- F = −20 N (points back toward equilibrium)
Example 2 — Spring work from x₁ to x₂
A spring has k = 200 N/m. It moves from x₁ = 0.20 m to x₂ = 0.05 m. Find the work done by the spring.
- W = ½k(x₁² − x₂²)
- W = 0.5 × 200 × (0.20² − 0.05²)
- W = 100 × (0.04 − 0.0025) = 3.75 J
Example 3 — SHM period
A mass m = 0.50 kg is attached to a spring with k = 200 N/m. Find the period of oscillation.
- T = 2π√(m/k)
- T = 2π√(0.50/200)
- T ≈ 0.314 s
Frequently Asked Questions
Q: Is Hooke’s law always accurate?
It’s accurate for an ideal linear spring. Real springs can stop behaving linearly if stretched too far.
Q: What does the minus sign mean in F = −kx?
It means the spring force always points opposite the displacement — back toward equilibrium.
Q: What is the difference between work done by the spring and work done on the spring?
Work done by the spring is energy the spring gives to the mass. Work done on the spring is the energy you put into stretching it. They are equal in magnitude but opposite in sign.
Q: Why does a stiffer spring oscillate faster?
A larger k means a larger restoring force for the same displacement, so the mass accelerates faster and the period decreases.