Skip to content

Simple Harmonic Motion Calculator

Spring–mass simple harmonic motion: period, frequency and angular frequency, position, velocity and acceleration at any time, maximum speed and energy.

Calculator Details

Period (T):0.993459 sSee results ↓

The mass on the spring

One spring, or two springs in series (end to end) or in parallel (side by side)

Stiffness of the spring: the force per unit of stretch

An amplitude and phase angle, or the position and velocity at t = 0

m, cm, mm or in, for amplitude, position and velocity

Largest distance from the rest position

Degrees; 0° starts at +A (released from rest), −90° passes the rest position moving outward

When to report the position, velocity, acceleration and energy, in seconds

Your Results

Period (T): 0.993459 s

Period (T)

0.993459 s

Frequency 1.00658 Hz · ω = 6.32456 rad/s

Position at t = 0.5 s

−9.99786 cm

Amplitude 10 cm

Velocity

1.30814 cm/s

Maximum 63.2456 cm/s at the rest position

Acceleration

399.914 cm/s²

Maximum 400 cm/s² at the turning points

Total energy

0.1 J

Kinetic 4.27808 × 10⁻⁵ J + potential 0.0999572 J

The mass oscillates with a period of 0.9935 s (1.007 Hz). At t = 0.5 s it is at x = -9.998 cm, moving at 1.308 cm/s, and its total energy is 0.1 J.

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Position over two periods

Position over two periods

Detailed Breakdown

Position, velocity and acceleration over two periods
Time (s)x (cm)v (cm/s)a (cm/s²)
0100−400
0.16565−54.772−200
0.3312−5−54.772200
0.4967−10−7.7453 × 10⁻¹⁵400
0.6623−554.772200
0.8279554.772−200
0.9935101.5491 × 10⁻¹⁴−400
1.1595−54.772−200
1.325−5−54.772200
1.49−10−2.3236 × 10⁻¹⁴400
1.656−554.772200
1.821554.772−200
1.987103.0981 × 10⁻¹⁴−400

Every twelfth of a period. x is measured from the rest position; the acceleration always points back toward it.

How This Calculator Works

How It’s Calculated

ω = √(k ÷ m) · T = 2π ÷ ω · f = 1 ÷ T
x(t) = A cos(ωt + φ) · v(t) = −Aω sin(ωt + φ) · a(t) = −ω² x(t)
E = ½kA² = ½mv² + ½kx²

Your calculation: k = 20 N/m and m = 0.5 kg give ω = √(20 ÷ 0.5) = 6.32456 rad/s, so T = 2π ÷ 6.32456 = 0.993459 s. With A = 10 cm and φ = 0°, at t = 0.5 s the mass is at x = −9.99786 cm and moving at 1.30814 cm/s.

The spring is ideal: massless, with no friction or air resistance, so the motion and the total energy never decay.

Frequently Asked Questions

What is simple harmonic motion?

Back-and-forth motion in which the restoring force is proportional to the displacement and points back toward the rest position (F = −kx). A mass on an ideal spring is the textbook example. The position follows a cosine curve in time, and the period does not depend on how far you pull the mass.

How do you find the period of a mass on a spring?

T = 2π√(m ÷ k). A 0.5 kg mass on a 20 N/m spring has a period of 0.9935 s, a frequency of 1.007 Hz and an angular frequency of 6.325 rad/s. Four times the mass (2 kg) doubles the period to 1.987 s.

Does a bigger amplitude change the period?

No. For an ideal spring the period depends only on m and k: pulling the 0.5 kg mass out 20 cm instead of 10 cm keeps the period at 0.9935 s. The mass travels twice as far but moves twice as fast, so its maximum speed rises from 63.25 to 126.5 cm/s and the energy rises fourfold, from 0.1 J to 0.4 J.

Where is the speed greatest, and where is the acceleration greatest?

The speed is greatest, Aω, as the mass passes through the rest position, where the spring force is zero. The acceleration is greatest, Aω², at the two turning points, where the mass stops for an instant and the spring is stretched or compressed the most.

How does energy move between kinetic and potential?

The total energy stays at ½kA². At the turning points it is all elastic potential energy (½kx²); at the rest position it is all kinetic energy (½mv²). In between it is shared, and the two parts always add up to the same total.

How do springs in series and parallel combine?

In series (end to end) the stretches add, so 1/k = 1/k₁ + 1/k₂: 20 and 30 N/m make 12 N/m and a slower period of 1.283 s with 0.5 kg. In parallel (side by side) the forces add, k = k₁ + k₂ = 50 N/m, and the period drops to 0.6283 s.

What does the phase angle mean?

It sets where in the cycle the motion starts. With x = A cos(ωt + φ), φ = 0 means the mass starts at +A, released from rest; φ = −90° means it starts at the rest position moving in the positive direction. Enter a start position and velocity instead and the calculator works out A and φ for you.

Is a pendulum simple harmonic motion?

Only approximately, for small swings: the restoring force on a pendulum is proportional to sin θ, not θ. The pendulum calculator handles that (and the exact large-angle period). Real springs and pendulums also lose energy to friction; the damping ratio calculator covers that decay.

Uses the ideal spring–mass model of OpenStax University Physics Vol. 1 ch. 15: a massless spring that obeys Hooke’s law, no friction, air resistance or damping, and motion along one line. It leaves out the spring’s own mass (which lengthens the period slightly; about a third of it acts with the load), damping and driven oscillations, gravity’s shift of the rest position for a hanging spring (which does not change the period) and springs stretched beyond their elastic limit.

Simple Harmonic Motion Calculator: Period, Frequency, Position and Energy of a Spring

By FindMySum · Last reviewed

A mass on a spring is the classic oscillator. Pull it aside and let go, and it swings back and forth through its rest position in a smooth, repeating rhythm. This simple harmonic motion calculator gives the period, frequency and angular frequency of that rhythm, then tracks the mass at any moment: where it is, how fast it is moving, how hard it is accelerating, and how its energy is split between motion and the stretched spring. It works with one spring or two springs combined in series or in parallel, in metric or imperial units.

The physics in one line

An ideal spring pulls back with a force proportional to how far it is stretched or compressed, F = −kx (Hooke's law). Newton's second law then gives ma = −kx, or a = −(k/m)x: the acceleration is always proportional to the displacement and points the other way. The only functions whose second derivative is a negative multiple of themselves are sines and cosines, so the position follows

  • x(t) = A cos(ωt + φ), with ω = √(k/m)

Here A is the amplitude (the largest displacement), ω the angular frequency in radians per second and φ the phase angle, which sets where in the cycle the motion starts. Differentiate once for the velocity, v(t) = −Aω sin(ωt + φ), and again for the acceleration, a(t) = −ω²x(t).

From ω come the two numbers most people want: the period T = 2π/ω = 2π√(m/k), the time for one full cycle, and the frequency f = 1/T in hertz.

Worked example

The calculator opens with a 0.5 kg mass on a spring with k = 20 N/m, pulled 10 cm from its rest position and released (φ = 0):

  • ω = √(20 ÷ 0.5) = √40 = 6.325 rad/s
  • T = 2π ÷ 6.325 = 0.993 s, so f = 1.007 Hz, almost exactly one swing per second
  • maximum speed Aω = 0.10 × 6.325 = 0.632 m/s, as the mass passes the rest position
  • maximum acceleration Aω² = 0.10 × 40 = 4.0 m/s², at the turning points
  • total energy ½kA² = ½ × 20 × 0.10² = 0.10 J

At t = 0.5 s, half a period has nearly passed, so the mass is close to the far turning point: x = 10 cos(6.325 × 0.5) = −9.998 cm, moving at only 1.3 cm/s. Almost all of the 0.10 J is stored in the spring at that moment.

What the period depends on, and what it does not

The period depends only on the mass and the spring constant. It does not depend on the amplitude: pull the mass twice as far and it travels twice the distance at twice the speed, finishing the cycle in exactly the same time. This is what makes springs and other harmonic oscillators good timekeepers.

  • More mass, slower: T grows with √m. Four times the mass doubles the period.
  • Stiffer spring, faster: T shrinks with 1/√k. Four times the stiffness halves the period.
  • Gravity does not matter for a spring. Hanging it vertically only moves the rest position down by mg/k; the oscillation about that point has the same period.

Energy

The total mechanical energy stays at E = ½kA² throughout the motion. At the turning points the mass is momentarily at rest and all the energy is elastic potential energy, ½kx². At the rest position the spring is relaxed and all the energy is kinetic, ½mv². Everywhere in between the two shares add up to the same total, which the calculator shows at your chosen time. Doubling the amplitude quadruples the energy.

Setting the two forms equal gives a handy result: the speed at any position is v = ω√(A² − x²). It is greatest at x = 0 and zero at x = ±A.

Starting conditions and the phase angle

You can describe the start of the motion in two ways. The first is an amplitude and phase angle: φ = 0 starts the mass at +A, φ = 180° at −A, and φ = −90° at the rest position moving in the positive direction. The second is the position and velocity at t = 0, which is often what an experiment gives you. The calculator converts them with

  • A = √(x₀² + (v₀/ω)²) and φ = atan2(−v₀/ω, x₀)

For example, starting 5 cm out and moving outward at 50 cm/s with the default spring gives A = 9.35 cm and φ = −57.7°: the mass keeps going out to 9.35 cm before turning back.

Springs in series and in parallel

Two springs can share a load in two ways. Hooked end to end (in series), each carries the full force and their stretches add, so 1/k = 1/k₁ + 1/k₂. The combination is softer than either spring: 20 N/m and 30 N/m make 12 N/m. Side by side (in parallel), they stretch by the same amount and their forces add, so k = k₁ + k₂ = 50 N/m, stiffer than either. With the 0.5 kg mass, the series pair oscillates with a period of 1.28 s and the parallel pair with 0.63 s.

Reading the chart and table

The chart plots the position over two full periods, with a marker at the time you entered, so you can see where in the cycle the mass is. The table lists position, velocity and acceleration every twelfth of a period. Notice that the velocity is a quarter-cycle ahead of the position, and the acceleration is always opposite to the position, just as a = −ω²x says.

Limits of the model

The calculator treats the spring as ideal. A real spring has mass, and roughly a third of it moves with the load, which lengthens the period slightly; you can approximate this by adding a third of the spring's mass to m. Real systems also lose energy to friction and air resistance, so the amplitude slowly dies away; the damping ratio calculator covers that. Springs stretched past their elastic limit no longer obey Hooke's law. A pendulum is only approximately simple harmonic, for small swings, and has its own calculator.

More questions

Why is it called 'simple' harmonic motion?

Because the restoring force is exactly proportional to the displacement, which gives a single pure sine or cosine wave with one frequency. 'Harmonic' refers to that sinusoidal shape, the same one as a pure musical tone. Motions with several frequencies mixed together, or with forces that are not proportional to displacement, are still oscillations but not simple harmonic ones.

What is the difference between frequency and angular frequency?

Frequency f counts full cycles per second, in hertz. Angular frequency ω measures how fast the phase angle advances, in radians per second. One cycle is 2π radians, so ω = 2πf. The formulas for a spring come out most neatly in ω, which is why the calculator shows both.

Why does a heavier mass oscillate more slowly?

The same spring force has to accelerate more inertia. Since a = −(k/m)x, a larger m means a smaller acceleration at every displacement, so each cycle takes longer. The period grows with the square root of the mass: four times the mass, twice the period.

How do I measure a spring constant at home?

Hang the spring, note where its end sits, then hang a known mass and measure how far it stretches. k = mg ÷ stretch. A 200 g mass that stretches a spring by 10 cm gives k = 0.2 × 9.81 ÷ 0.10 ≈ 19.6 N/m. You can check it by timing ten oscillations and comparing the period with 2π√(m/k).

Does gravity change the period of a hanging spring?

No. Gravity only moves the rest position down by mg/k. The mass then oscillates about that new rest position with the same period it would have on a horizontal frictionless table. Measure the amplitude from the hanging rest position, not from the unstretched length.

Where does simple harmonic motion show up in real life?

Car suspensions, the quartz crystal in a watch, a guitar string's vibration, a building swaying in wind, the atoms in a solid and the current in an LC circuit all behave approximately like simple harmonic oscillators for small motions. The same equations, with different symbols, describe each of them.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy