MechSimulator

Hooke’s Law Simulator

F = kx • Spring Constant • Elastic PE • Series & Parallel — Simulate • Explore • Practice • Quiz

Mode
Units
📖 User Guide
Drag the weight or use the sliders/steppers. Right-click the canvas for export & reset. Ctrl+Z undo, Ctrl+Shift+Z redo.
Spring k 80 N/m
N/m
Mass 0.0 kg
kg
Mass presets
k presets
Config
Force
0.00 N
Extension
0.0000 m
Energy
0.000 J
k effective
80.0 N/m
📖 Learning panels
Σ Live equations — values substituted from current state
💡 What-if coach — insights from current values
User Guide — Hooke’s Law Simulator
1 Overview

This free Hooke’s law spring constant simulator lets you stretch virtual springs, plot real-time F = kx graphs, and explore elastic behaviour interactively. Adjust the spring constant k (10–1000 N/m) and add mass (0–50 kg) to see the force-extension relationship plotted live, with a colour-coded equation overlay on the canvas. The simulator covers series and parallel springs, the elastic limit, and elastic potential energy (Ep = ½kx²).

Built for physics and engineering students, this tool provides a complete virtual spring experiment with classical LaTeX equation rendering, a step-by-step calculation modal, SI / Imperial unit toggle, CSV / PNG export, and full undo/redo — no equipment required.

2 Getting Started

The simulator opens in Simulate mode showing a single spring with k = 80 N/m and no load. The canvas displays the spring on the left, the F–x graph on the right, and the live F = k·x equation across the bottom. Four readout cards show Force, Extension, Energy, and Effective k.

Use the Mode pills to switch between Simulate, Explore, Practice, and Quiz. Toggle SI / Imperial at the top right to switch all displayed units (N ↔ lbf, m ↔ in, J ↔ ft·lbf, kg ↔ lb) — internal calculations always stay in SI for accuracy.

3 Simulate Mode & Controls

Sliders + steppers: Drag a slider or use the [−] [value] [+] stepper to set spring k or mass precisely. Type a value directly into the stepper input (in the currently displayed unit) and press Enter.

Drag the weight directly on the canvas — the cursor turns into a grab icon when hovering. Pull it down to stretch the spring; mass and all readouts update live.

Mass presets (1, 2, 5, 10, 20 kg) and k presets (Soft 20, Med 80, Stiff 200, Very stiff 500) let you jump to common values.

Config pills switch between Single, Series and Parallel spring arrangements: series springs are softer (1/keff = 1/k1 + 1/k2), parallel springs are stiffer (keff = k1 + k2).

Toggles: Show Elastic Limit (red zone past x = 0.12 m), Show Energy Area (shaded triangle under F–x), Show Equation (canvas overlay).

4 Learning Panels & Show Calculations

Below the simulator, the Learning panels include collapsible cards rendered in classical LaTeX:

  • Live equations — current state substituted into F = mg, x = F/keff, Ep = ½kx² (using KaTeX rendering).
  • What-if coach — tips and warnings based on your current k, mass and config (e.g. elastic-limit alert, soft-spring + heavy-mass warnings).

Click Show Calculations (blue floating button at the canvas’s bottom-right) to open a step-by-step modal showing the full derivation in classical math notation, recomputed live every time you open it.

5 Keyboard, Right-Click & Export

Keyboard shortcuts: Ctrl+Z undoes any change (slider, stepper, preset, config, unit toggle), and Ctrl+Shift+Z redoes. Esc closes the calculation modal or the right-click menu.

Right-click the canvas to get a context menu with: Copy current values to clipboard, Export CSV (mass sweep through k, F, x, E with limit flag), Export PNG (canvas snapshot with watermark), Toggle grid background, and Reset.

6 Explore, Practice & Quiz

Explore mode provides concept cards across four categories: Fundamentals, Springs, Energy, and Applications. Each card includes a formula, diagram, and worked example.

Practice mode generates unlimited random problems: calculate force from k and x, extension from F, elastic PE, or effective k of series/parallel combinations. Step-by-step solutions are revealed after each attempt.

Quiz mode presents 5 randomised questions per session, mixing conceptual and numerical items. A detailed per-question score breakdown is shown at the end (tracked accurately for each question).

7 Tips & Best Practices
  • Compare Single vs Series vs Parallel: Apply the same load to all three configurations to see how effective stiffness changes the extension.
  • Watch the energy shading grow as you add mass — it provides a visual proof that Ep = ½kx² is the area of a triangle.
  • Push past the elastic limit (red zone) to see why springs must be designed to operate within their proportional range.
  • Toggle to Imperial when working from textbook units (lbf, in, ft·lbf) — calculations remain accurate because internals are always SI.
  • Use the Show Calculations modal when working through homework — every step is shown with substituted values in classical math notation.
  • Export CSV for any (k, config) combination and import into a spreadsheet or Python for further analysis.

Understanding Hooke’s Law — Free Interactive Simulator

Hookes Law simulator showing a single vertical spring with the force-extension graph alongside, ready for a mass to be attached, with the elastic-limit dashed line marked at the right edge
Default state of the simulator. Attach a mass or drag the spring to see the force-extension line plot in real time.

Hooke’s Law states that the force a spring exerts is directly proportional to its extension: F = kx. The constant k is the spring constant in N/m. This law holds only within the elastic limit — beyond it, permanent deformation occurs. Use the simulator above to stretch the spring, watch F–x plot in real time, and compare series vs parallel configurations.

A 5 N Spring, a 0.05 m Stretch — The Cleanest Possible Worked Example

Set the simulator to a single spring with k = 100 N/m. Hang a 0.5 kg mass on it. The whole problem fits on a sticky note:

That energy figure is the one students miss most often. It is not F·x (that would give 0.240 J), because the force only reaches its full value at the final extension — on average through the stretch it is half. Geometrically: the area under the F-x line is a triangle, not a rectangle. I draw that triangle on the board for first-time learners and they remember the factor of one half forever.

A Common Misconception Worth Killing Early

Students sometimes say “a stiffer spring stretches less” as if stiffness causes the smaller stretch directly. The clearer statement is: a stiffer spring needs more force to produce the same stretch, so for a given load (like gravity pulling on a mass), it ends up stretched less. The cause is the load not changing; the result is the smaller extension.

Run the simulator with k = 50, 100 and 200 N/m for the same 1 kg mass. Extensions come out as roughly 196 mm, 98 mm, 49 mm — exactly halving each time the stiffness doubles. The simulator’s F-x line gets steeper too. Same load, different gradients, different equilibrium points.

Where Hooke Stops Being Hooke — The Elastic Limit

Push past the elastic limit and the force-extension line stops being straight. Three regimes you can see in the simulator’s extended-load mode:

  1. Elastic region (Hookean). F = kx exactly. Load and unload — the spring returns to its natural length. This is everything I have described above.
  2. Yielded but not broken. The line bends but the spring still pulls back, just not as much. Unload and the spring stays partially stretched. Real coil springs above their proof load behave this way.
  3. Plastic and approaching break. The line goes nearly flat — the spring stretches under barely-increasing load. The next small extension snaps it. In a workshop, this is what happens when you over-tension a valve spring once too often.

For an extension simulator like this, the elastic limit is shown as a dashed red line. Stay left of it and Hooke holds. Cross it and the simulator switches into the non-linear regime so you can see the deviation.

Where Hooke’s Law Shows Up Beyond Springs

The Hookean form — restoring force linear in displacement — appears everywhere small displacements matter. You don’t think of these as “springs” but they all obey F = kx for small enough x:

Force-Extension Graphs & Energy

A force-extension graph for a spring obeying Hooke’s Law is a straight line through the origin with gradient k. The area under the graph equals the elastic potential energy stored: Ep = ½kx². This energy can be fully recovered when the spring returns to its natural length (within the elastic limit). The simulator above lets you see this energy area grow in real time as you increase the load.

Series & Parallel Spring Combinations

When springs are placed in series (end to end), the effective spring constant is lower than either individual spring: 1/keff = 1/k1 + 1/k2. In parallel (side by side), the stiffness adds up: keff = k1 + k2. Toggle between configurations in the simulator to see the difference in extension for the same load.

How to Use This Tool

In Simulate mode, drag the weight or use the sliders/steppers to apply force. Watch the F–x graph plot in real time and the live equation overlay update. Toggle SI / Imperial for unit conversion, open Show Calculations for the full derivation in classical math notation, or right-click the canvas to export CSV/PNG. Practice generates random problems and Quiz tests your understanding with 5 questions.

Hooke’s Law & Spring Formulas

PropertyFormulaUnit
Hooke’s LawF = k × xN
Spring Constantk = F / xN/m
Elastic Potential EnergyPE = ½ k x²J
Springs in Series1/keff = 1/k1 + 1/k2N/m
Springs in Parallelkeff = k1 + k2N/m
Natural Frequency (mass-spring)f = (1/2π) √(k/m)Hz

Typical Spring Constants by Application

ApplicationApprox. k (N/m)Material
Ballpoint pen spring100 – 300Music wire
Screen door spring500 – 1 500Galvanised steel
Automotive valve spring15 000 – 50 000Chrome vanadium
Car suspension spring20 000 – 60 000Chrome silicon
Industrial die spring50 000 – 200 000Alloy tool steel
Railroad buffer spring500 000+High-carbon steel

Explore Related Simulators

If you found this Hooke’s Law simulator helpful, explore our Spring Design simulator, Stress–Strain Curve simulator, Simple Harmonic Motion simulator, and Universal Testing Machine simulator for more hands-on practice.