Mass on a Spring Simulator
Watch simple harmonic motion live. Set the mass, spring constant, and amplitude and see the period, speed, and energy of a mass on a spring update instantly.
Offline ● Works without internet after loading After the first page load, no network connection is needed.Drag the mass to set the amplitude
This simulation needs a modern browser with canvas support. The measurements and formula below still describe the physics.
Controls
Live measurements
Graph
Formula
T = 2π √(m / k)
Type your own values to solve the formula. The simulation follows along.
- T Period
- —
Observations
What's happening
Real-world examples
Car suspension
A heavy car body on stiff springs bounces at a low frequency you can feel over a bump.
Stiff vs soft
A stiff, light spring buzzes quickly; a soft spring under a heavy mass sways with a long, slow period.
Energy trade
At the ends all the energy is spring potential energy; through the middle it is all kinetic energy.
Amplitude test
Drag the mass out further and the period stays the same, only the peak speed and energy grow.
Common Questions
What is simple harmonic motion?
Simple harmonic motion is the back-and-forth oscillation you get when the restoring force is proportional to displacement, F = -k x, as it is for a mass on a spring. The mass traces a smooth cosine curve in time. The defining feature is that the period does not depend on how far you pull the mass, only on the mass and the spring constant.
What is the period of a mass on a spring?
The period is T = 2 pi times the square root of m / k, where m is the mass and k is the spring constant. To calculate the period of a mass on a spring, divide the mass by the spring constant, take the square root, and multiply by 2 pi. A heavier mass gives a longer period; a stiffer spring gives a shorter one. The simulator shows the period updating as you drag either slider.
Does the amplitude change the period?
No. Amplitude does not change the period of simple harmonic motion. Pulling the mass out further stores more energy and produces a higher peak speed, but each full oscillation still takes the same time T = 2 pi times the square root of m / k. Drag the mass wider in the simulator and watch the period reading stay put while the energy grows.
How do I find the angular frequency?
The angular frequency is omega = the square root of k / m, in radians per second, and it relates to the period by omega = 2 pi / T. To find the angular frequency, divide the spring constant by the mass and take the square root. A stiff spring or a light mass makes omega large, so the mass oscillates quickly. The simulator reports omega alongside the period.
How does energy move during the oscillation?
Energy trades between spring potential energy and kinetic energy while the total stays constant at half k times amplitude squared. At the turning points the mass is momentarily still, so all the energy is potential; through the equilibrium point it moves fastest, so the energy is all kinetic. The PE and KE bars in the simulator rise and fall in opposite step.
Does the simulator send my data anywhere?
No. Everything runs in your browser with a canvas and simple maths. Nothing is uploaded or stored remotely, and the simulator keeps working offline after the page loads.