The simple harmonic motion calculator above models an ideal mass-spring oscillator and gives you both the whole-cycle quantities and the instantaneous ones. Period, frequency and angular frequency describe the oscillation as a whole. Displacement, velocity and acceleration describe where the mass is and what it is doing at one specific moment. Most pages give you one set or the other; both are needed to solve a real problem.
Arb Digital builds free calculators that make the structure of a result visible rather than returning a bare number. Simple harmonic motion is the case where the restoring force is proportional to displacement and directed back toward equilibrium, and that single condition is what produces sinusoidal motion, an amplitude-independent period, and an energy that continuously trades between kinetic and potential without ever changing in total.
What This Simple Harmonic Motion Calculator Does
You give it a mass, a spring stiffness and an amplitude, and it returns the period as its headline figure, with the frequency and angular frequency underneath. You also give it a time and a phase offset, and the grid reports the displacement, velocity and acceleration at exactly that instant, plus the total mechanical energy of the oscillator.
If you have not measured the spring but have timed the oscillation, the second input mode takes a measured period and works backwards to the spring constant. That is the more common laboratory situation, since timing twenty cycles with a stopwatch is easier and more accurate than measuring a spring constant directly.
The note under the grid carries the quantities that give the numbers meaning: the maximum speed and maximum acceleration, the split between kinetic and potential energy at your chosen instant, and where in the cycle that instant falls. That last figure is the one that turns an isolated number into a picture of what the mass is doing.
How to Use It
- Enter the mass in kilograms. For a real spring this should include roughly a third of the spring's own mass, which is the effective correction for a spring whose mass is not negligible against the load.
- Enter the spring constant, or switch to period mode. Spring constant is force per unit extension in newtons per metre. If you measured the period instead, use the second mode and the tool derives the constant for you.
- Set the amplitude. This is the maximum displacement from equilibrium, which is half the peak-to-peak travel. Getting this wrong by a factor of two is the most common input error on this page.
- Choose a time and a phase. Phase zero means the mass was released from maximum displacement at rest. Phase 90 degrees means it was launched from equilibrium at full speed.
- Read the energy split in the note. Kinetic and potential energy always sum to the same total, and seeing how that total is divided at your chosen instant is usually more informative than the displacement alone.
The Formula: How Simple Harmonic Motion Is Calculated
The defining condition is that the restoring force is proportional to displacement, F = −kx. Combining that with Newton's second law gives an equation whose solution is a sinusoid, and the angular frequency comes out as ω = √(k ÷ m). The period is T = 2π ÷ ω = 2π√(m ÷ k), and the frequency is its reciprocal. OpenStax University Physics Volume 1, section 15.1 on simple harmonic motion, derives this and notes explicitly that the period depends only on the mass and the force constant.
The three instantaneous quantities follow from the same sinusoid: x(t) = A cos(ωt + φ), v(t) = −Aω sin(ωt + φ), and a(t) = −Aω2 cos(ωt + φ). Note that the acceleration is always exactly −ω2 times the displacement, which is simply the defining condition restated.
Work the defaults. A 0.5 kg mass on a 20 N/m spring gives ω = √(20 ÷ 0.5) = √40 = 6.3246 rad/s, so the period is 2π ÷ 6.3246 = 0.9935 s and the frequency is 1.0066 Hz. At t = 0.25 s with zero phase, ωt = 1.5811 rad, which is a hair past a quarter cycle. The displacement is 0.1 × cos(1.5811) = −0.00103 m, essentially at equilibrium, and the velocity is −0.1 × 6.3246 × sin(1.5811) = −0.6324 m/s, essentially the maximum.
The total energy is E = ½kA2 = 0.5 × 20 × 0.01 = 0.1 J, a figure that OpenStax section 15.2 on energy in simple harmonic motion derives from conservation and shows to be constant through the cycle.
Why the Period Does Not Depend on Amplitude
This property, called isochronism, is what makes simple harmonic motion useful rather than merely tidy, and the reason for it is worth understanding rather than memorising.
Double the amplitude and the mass has twice as far to travel in each quarter cycle. But the restoring force at every corresponding point is also doubled, because force is proportional to displacement, so the acceleration is doubled and the mass reaches twice the speed. The extra distance and the extra speed cancel exactly, and the time is unchanged.
That exact cancellation is a consequence of the force being strictly linear in displacement. It fails the moment the restoring force stops being proportional — which is why a pendulum, whose restoring force involves a sine rather than the angle itself, is only approximately isochronous and only at small angles. The simple pendulum calculator quantifies exactly how large that departure gets.
It is also why a mass-spring system makes a better timekeeper than a pendulum in principle: the balance wheel and hairspring in a mechanical watch is a torsional version of this same oscillator, and its period is genuinely amplitude-independent as long as the hairspring stays in its linear range.
Where the Energy Goes During a Cycle
The total mechanical energy of an ideal oscillator is ½kA2 and never changes. What changes is how that fixed total is divided between the spring's potential energy, ½kx2, and the mass's kinetic energy, ½mv2.
At the extremes of travel the mass is momentarily stationary, so all the energy is potential. At the equilibrium point the spring is unstretched, so all of it is kinetic and the speed is at its maximum of Aω. Between those points the split follows the square of position, which means the energy is not divided evenly at the halfway point of the travel: at x = A ÷ 2 the potential energy is only a quarter of the total, not a half. The equal split happens at x = A ÷ √2, about 71 per cent of the way out.
The energy also cycles at twice the frequency of the motion, because it reaches a maximum at both ends of the travel rather than once per cycle. If you want the kinetic and potential terms separately for a specific configuration, the kinetic energy calculator and the potential energy calculator handle them individually, and the Hooke's law calculator relates the spring force to the extension that produced it.
What This Model Leaves Out
Three things, and each one matters in a different situation.
Damping is the big one. Every real oscillator loses energy to friction, air resistance and internal losses in the spring, so the amplitude decays rather than persisting. This calculator models the undamped case, which is a good approximation for a high-quality oscillator over a few cycles and a poor one over hundreds. Lightly damped systems keep almost the same period as the undamped result, so the period figure here stays usable even when the amplitude figure does not.
Spring mass is the second. The formula assumes the spring itself is massless. When it is not, the standard correction is to add one third of the spring's mass to the load, which pushes the period up. For a light mass on a heavy spring this is not a small adjustment.
Linearity is the third. A real spring obeys Hooke's law only within a range. Stretch it too far and the constant changes, the motion stops being sinusoidal, and the period starts depending on amplitude after all. If your amplitude approaches the point where the spring visibly deforms, none of these results hold.
Where This Sits Next to Our Other Oscillation Tools
This page is the mass-spring oscillator, where the restoring force comes from a spring and the period depends on mass and stiffness. The simple pendulum calculator is the gravitational version, where the restoring force comes from weight and the period depends on length and gravity — and where the small-angle approximation introduces an error this page does not have.
For the rotational quantities that describe the same sinusoid, the angular velocity calculator relates angular frequency to revolutions per minute, which is often how oscillator specifications are quoted. If you need the frequency in different units, the frequency converter moves between hertz, kilohertz and revolutions per minute.
Arb Digital builds free tools like this one because useful pages earn attention. If you want tools, calculators or content built for your own audience, we can help.
Browse All Free Tools Talk to Arb DigitalCommon Mistakes to Avoid
- Entering peak-to-peak travel as the amplitude — amplitude is measured from equilibrium to one extreme, so it is half the total swing. This doubles every velocity and quadruples the energy if you get it wrong.
- Confusing angular frequency with frequency — angular frequency is in radians per second and is 2π times the frequency in hertz. Substituting one for the other misses by a factor of about 6.28.
- Assuming the energy splits evenly at half the amplitude — energy goes as displacement squared, so at half amplitude the potential energy is a quarter of the total, not a half.
- Ignoring the mass of the spring — for a light load on a heavy spring, adding a third of the spring mass to the load changes the period noticeably.
- Applying these results to a heavily damped system — the period survives light damping almost unchanged, but the amplitude and energy figures assume no losses at all.
Related Free Tools From Arb Digital
Compare against the gravitational oscillator with the simple pendulum calculator, and relate spring force to extension with the Hooke's law calculator. Break the energy into its parts with the kinetic energy calculator and the potential energy calculator. For rotational forms of the same quantities use the angular velocity calculator, and change frequency units with the frequency converter. Everything Arb Digital publishes is listed at the free online tools hub.
Frequently Asked Questions
Because the restoring force is proportional to displacement. Doubling the amplitude doubles the distance to travel but also doubles the force and therefore the speed reached, and the two effects cancel exactly. This only holds while the spring stays in its linear range.
Frequency counts complete cycles per second and is measured in hertz. Angular frequency measures the same motion in radians per second and is 2 pi times the frequency. The equations of motion use angular frequency because the sine and cosine take radians.
Use zero if the mass was released from maximum displacement at rest, which is the usual laboratory setup. Use 90 degrees if it was launched from the equilibrium position at full speed. Any other starting condition falls somewhere between those two.
At the equilibrium position, where the displacement is zero and all the energy is kinetic. The maximum speed equals the amplitude times the angular frequency. At the extremes of travel the mass is momentarily stationary and the acceleration is at its largest.
No. It models an ideal undamped oscillator, so the amplitude and energy stay constant forever. Light damping barely changes the period, so that figure remains usable, but the amplitude of a real oscillator decays and this model does not show that decay.
If the spring is not negligible compared with the load, yes. The standard correction is to add one third of the spring's mass to the oscillating mass, which lengthens the period. For a heavy mass on a light spring the correction is not worth making.
Yes, and the second input mode does exactly that. Rearranging the period formula gives spring constant equal to 4 pi squared times mass divided by period squared. Timing twenty cycles and dividing is usually more accurate than measuring the spring directly.
This tool is provided for educational and study use. It models an ideal undamped linear oscillator with a massless spring, so it does not account for friction, air resistance, spring mass or non-linear behaviour at large extensions.