Simple Harmonic Motion Calculator
Enter mass and spring constant to find the period and frequency of simple harmonic motion.
What this calculator returns
Two answers for a mass on an ideal spring: the period in seconds and the frequency in hertz. At the defaults — 1 kg on a 40 N/m spring — the period is 0.9935 s and the frequency is 1.01 Hz, so the mass completes just over one full cycle per second.
The period is the time from one extreme to the next and back. The frequency is simply its reciprocal, which is why the two numbers always multiply to 1.
The formula and the natural frequency
m is the oscillating mass in kilograms and k is the spring constant in newtons per metre. The ratio m/k has units of s², so its square root is a time, and 2π converts that natural timescale into a full cycle. Nothing else can enter: the period does not depend on how far you pull the mass.
The angular frequency is ω = √(k ÷ m) = 2π ÷ T. At the defaults that is 6.32 rad/s. A stiffer spring raises ω and shortens T; a heavier mass lowers ω and lengthens T, both by the square root.
Why amplitude drops out
A larger displacement means a larger restoring force, and the extra force exactly compensates for the extra distance. That cancellation is what makes the motion simple harmonic and the period amplitude-independent. Real springs break the rule once coils start to close up, and pendulums break it beyond roughly 15° of swing, where the period lengthens by a few percent.
Worked example at the defaults
m ÷ k = 1 ÷ 40 = 0.025 s². Square root: 0.1581 s. Multiply by 2π: 0.1581 × 6.2832 = 0.9935 s. Frequency: 1 ÷ 0.9935 = 1.0066 Hz, shown as 1.01.
If you hang the 1 kg mass on the spring and let it settle, the static extension is mg ÷ k = 9.81 ÷ 40 = 0.245 m. The period then also equals 2π√(extension ÷ g), which is a quick experimental check: measure 24.5 cm of sag and you should time 0.99 s per cycle.
Period across mass and stiffness
| Mass | k = 20 N/m | k = 40 N/m | k = 80 N/m |
|---|---|---|---|
| 0.5 kg | 0.993 s | 0.702 s | 0.497 s |
| 1.0 kg | 1.405 s | 0.993 s | 0.702 s |
| 2.0 kg | 1.987 s | 1.405 s | 0.993 s |
The grid is self-similar: doubling the mass and doubling the spring constant at the same time leaves the period unchanged, so the 1 kg row at 40 N/m matches the 2 kg row at 80 N/m at 0.993 s. Only the ratio matters, never the absolute values separately.
What moves the period
- Mass: four times the mass doubles the period, so 1 kg to 4 kg takes 0.9935 s to 1.987 s.
- Spring constant: four times the stiffness halves the period, from 0.9935 s to 0.497 s.
- Units: entering k in N/cm instead of N/m multiplies the period by √100 = 10.
- Gravity: a horizontal spring-mass system has the same period on the Moon, while a pendulum does not.
Energy and peak speed
The total energy of the oscillation is ½kA². Pull the default mass 0.1 m and you store 0.5 × 40 × 0.01 = 0.2 J. Peak speed occurs at the centre and equals Aω = 0.1 × 6.32 = 0.632 m/s, while peak acceleration at the ends is ω²A = 4.0 m/s², about 0.4 g.
Spring versus pendulum
A pendulum’s period is 2π√(L ÷ g) and depends on length and gravity, not on mass. A 1 m pendulum on Earth swings in 2.01 s, about twice the default spring period of 0.99 s. The shared 2π√(something ÷ something) shape is not a coincidence: both systems have a restoring force proportional to displacement, with m/k and L/g playing the same role.
For the pendulum version, enter the length in the pendulum period calculator; the numbers are not interchangeable between the two tools.
Mistakes worth catching
- Entering weight in newtons as mass, which overstates the period by √9.81 = 3.13.
- Mixing N/m and N/cm: a spring sold as 0.4 N/cm is 40 N/m, and the digits alone will mislead you.
- Assuming a bigger swing slows the mass. It does not, until the spring or the geometry stops being linear.
- Using the combined mass of two springs in series without first finding the equivalent k, which is k/2 for identical springs.
Spring mass is the quiet error in real measurements. A heavy spring contributes roughly one third of its own mass to the oscillating load, so a 1 kg mass on a 0.3 kg spring behaves closer to 1.1 kg and runs about 5% slow. In a lab that is 0.05 s per cycle, visible with a stopwatch over ten swings.
Where the result matters
Vehicle suspensions are tuned so the body bounces at 1–1.5 Hz, close to the default 1.01 Hz, because that is where human discomfort peaks and where the spring must be damped. Seismometers use a long period of 20 s or more to stay still while the ground shakes, and quartz tuning forks sit near 32,768 Hz, the same frequency as a watch crystal.
If you need the force the spring exerts at a given displacement rather than the timing, the spring force calculator applies F = kx directly.
Frequently asked questions
What is the period of a spring oscillator?
T = 2π√(m÷k). A 1 kg mass on a 40 N/m spring gives 0.9935 s, and the matching frequency is 1.01 Hz.
Does amplitude change the period?
Not for an ideal spring-mass system. Pulling the default mass 2 cm or 20 cm both give 0.9935 s, because the restoring force grows in step with the displacement.
How is frequency related to period?
Frequency is the reciprocal of period, f = 1/T. The default 0.9935 s corresponds to 1.0066 Hz, so the mass completes just over one cycle per second.
What happens if I double the mass?
The period rises by √2, from 0.9935 s to 1.405 s, and the frequency falls to 0.712 Hz. The same factor appears whenever mass and stiffness change by a ratio of 2.
What happens if I double the spring constant?
The period falls by √2, from 0.9935 s to 0.702 s, and the frequency rises to 1.42 Hz. Stiffer springs always mean faster oscillation.
How do I check the result with a ruler?
Measure the static sag: 1 kg on 40 N/m stretches 0.245 m. The period then equals 2π√(sag ÷ 9.81), which returns 0.9935 s from a 24.5 cm measurement.
Is this the same as a pendulum?
No. A pendulum period is 2π√(L÷g) and ignores mass, while this formula ignores gravity entirely. A 1 m pendulum swings in 2.01 s, about twice the default spring period.
Why is my period ten times too large?
You likely entered the spring constant in N/cm. 40 N/m is 0.4 N/cm, and using 0.4 in the formula multiplies the period by √100 = 10, giving 9.935 s.
How fast does the mass move at the centre?
Peak speed is Aω. With a 0.1 m amplitude and ω = 6.32 rad/s, the mass passes the centre at 0.632 m/s and stores 0.2 J of energy.
Does a spring’s own mass matter?
In careful work, yes. About one third of the spring mass adds to the load, so a 0.3 kg spring on a 1 kg mass behaves like 1.1 kg and runs roughly 5% slower at 1.043 s per cycle.
Method and sources
- Simple harmonic motion period T = 2π√(m/k) for a mass-spring system.