Hooke’s Law Calculator

Use this Hooke's law calculator to solve for spring force, stiffness, displacement, energy, work, equilibrium stretch, or mass-spring period with fewer sign mistakes.

Advanced options
Displacement input
Work inputs
Mass and gravity
Energy and period inputs
Hooke inputs (if needed)
Did we solve your problem today?

How to use our Hooke's Law Calculator

  1. Choose What do you want to solve? so the calculator knows which spring formula to use.
  2. Pick Solve for (in the selected mode) to choose the unknown answer you want.
  3. Set Displacement unit (for x inputs and x outputs) and Spring constant unit (for k inputs and k outputs) before typing numbers.
  4. Choose Force meaning (sign convention). Use restoring force for the spring's force on the object, or applied holding force for the force needed to hold the spring still.
  5. Open Advanced options if needed. There you can switch How will you enter displacement?, turn on Treat displacement as magnitude (use |x| in formulas where it makes sense), or enter values like Mass m (kg), Gravity g (m/s^2), Potential energy U (J), and Period T (seconds).
  6. Enter the known values. If you use lengths, type Natural length L0 (selected unit) and Current length L (selected unit); the calculator will find displacement from their difference.
  7. Click Calculate to see the main answer plus converted values such as Displacement x (meters), Spring constant k (N/m), and the exact Equation used (with your sign convention).
  8. Sanity-check the result: if stretching gives a force sign you did not expect, recheck Force meaning (sign convention) and whether your problem wants signed x or just a magnitude.

Definitions

What do you want to solve? The physics situation you want to use: basic Hooke's law, spring energy, work, vertical equilibrium, or mass-spring period.

Solve for (in the selected mode) The unknown value the calculator will find for you.

Displacement x (selected unit) How far the spring is stretched or compressed from its equilibrium length, not the full spring length.

Spring constant k (selected unit) The spring's stiffness. Larger k means a stiffer spring. In SI units, k is measured in N/m.

Force meaning (sign convention) A choice between the restoring force by the spring, which points back toward equilibrium, and the applied holding force, which points the opposite way.

Spring potential energy U (J) Energy stored in the spring. It depends on x squared, so it does not stay negative just because x is negative.

Work done by the spring from x1 to x2 (J) Energy transferred by the spring as it moves between two displacements. The sign tells you whether the spring gives energy away or stores more.

Mass m (kg) The attached mass used in vertical equilibrium and mass-spring period calculations.

Period T (seconds) The time for one full back-and-forth oscillation of a mass on a spring.

Imperial spring constant units If you choose lb/ft or lb/in, the calculator converts them to SI using exact foot and inch conversions and the pound-force relation before solving.


Common mistakes and quick fixes

Mistake: Entering total spring length into Displacement x (selected unit) instead of the change from equilibrium.
Fix: Either enter only the stretch or compression from equilibrium, or switch How will you enter displacement? to lengths and use Natural length L0 (selected unit) plus Current length L (selected unit) .

Mistake: Getting the opposite sign on Force (N) because the worksheet means holding force, not restoring force.
Fix: Change Force meaning (sign convention) to match the problem statement, then compare the result with Equation used (with your sign convention) .

Mistake: Mixing centimeters or inches with a spring constant typed as if it were in N/m.
Fix: Set Displacement unit (for x inputs and x outputs) and Spring constant unit (for k inputs and k outputs) first, then enter values in those exact units.

Mistake: Trying to solve for stiffness using Displacement x (selected unit) equal to 0.
Fix: Use a nonzero displacement, because Spring constant k (N/m) cannot be found from force divided by zero displacement.

Mistake: Thinking a negative Work done by the spring from x1 to x2 (J) is automatically wrong.
Fix: Keep the sign. Negative work can be correct and means energy was stored in the spring instead of released by it.

Mistake: Using oscillation amplitude as the x value in Vertical equilibrium note situations.
Fix: For hanging-mass equilibrium, use the static downward stretch from the unloaded spring length with Mass m (kg) , Gravity g (m/s^2) , and Spring constant k (selected unit) .


Limitations & Key Assumptions / Boundary Conditions

  • This calculator uses the ideal linear spring model, so it is best when the spring obeys Hooke's law and force is proportional to displacement.
  • The sign of force depends on your chosen Force meaning (sign convention). A negative answer can be physically correct.
  • Energy and work formulas assume the same spring constant throughout the motion and no losses from friction, heat, or damping.
  • Vertical equilibrium uses m g = k x for a hanging mass at rest, where x is the downward stretch from the spring's unloaded length.
  • The SHM period formula applies to small oscillations of an ideal mass-spring system and does not include damping or a heavy spring.
  • Solving for k or x can fail when the needed divisor is zero, such as x = 0 in Hooke mode or T = 0 in SHM mode.
  • Unit conversions are handled internally, but your inputs must match the selected displacement and spring-constant units exactly.

Methodology

Core equations

The calculator first converts displacement to meters and spring constant to N/m so every mode uses consistent SI physics units. If you choose lengths input style, it computes displacement from the change in length.

x = L - L0

For Hooke mode, it uses your chosen sign convention. Restoring force is the spring's force on the object. Applied holding force is the outside force needed to hold the spring at that displacement.

F = -k x

F_applied = +k x

If magnitude mode is turned on, the calculator uses |x| where the problem is clearly about size rather than direction. That mainly affects stiffness and energy-style calculations, while the displayed force still follows your chosen sign convention.

Other supported formulas

U = (1/2) k x^2

W_spring = (1/2) k (x1^2 - x2^2)

m g = k x

T = 2 pi sqrt(m / k)

From these, the calculator rearranges the equation for the unknown you picked. Examples: k = -F/x in restoring-force Hooke mode, x = sqrt(2U/k) in energy mode, and k = 4 pi^2 m / T^2 in SHM mode.

Mini-example

Suppose you choose Hooke mode, solve for force, enter x = 0.10 m and k = 200 N/m, and keep restoring-force convention. Then the calculator multiplies 200 by 0.10 to get 20, then applies the minus sign from Hooke's law.

F = -k x = -(200)(0.10) = -20 N

If you switch to applied holding force, the same numbers give +20 N instead. This is why the sign-convention control matters.

Unit conversion method

Length units are converted to meters before use. For example, centimeters use 1 cm = 0.01 m, millimeters use 1 mm = 0.001 m, and inches use the standard inch definition. Imperial spring constants also convert through standard foot, inch, and pound-force relations.

Assumptions used by the math

The formulas assume an ideal spring, no permanent deformation, and no damping. The SHM period result assumes small oscillations, and the vertical formula assumes the mass is hanging at rest rather than moving.

The calculator blocks impossible inputs such as nonpositive k where the formula requires a physical spring constant, negative spring energy input when solving from U, or zero values that would cause division by zero.