Simple Harmonic Motion Calculator
Free SHM calculator for a mass-spring oscillator. Get period, frequency, angular frequency, and maximum velocity and acceleration from amplitude, mass, k.
Simple Harmonic Motion Calculator
Background.
This simple harmonic motion calculator models the textbook mass-spring oscillator: a mass m attached to an ideal spring of constant k, displaced by amplitude A and released. It returns the period, frequency, and angular frequency of the resulting oscillation, plus the two numbers that describe how fast the mass actually moves and accelerates as it swings — maximum velocity and maximum acceleration. Enter a 0.5 kg mass on a 200 N/m spring released from a 5 cm amplitude, and the calculator returns an angular frequency of exactly 20 rad/s, a period of 0.3142 s, a frequency of 3.1831 Hz, a maximum speed of 1 m/s (reached as the mass flies through the equilibrium point), and a maximum acceleration of 20 m/s² (reached at the two turning points where the spring is most stretched or compressed).
Simple harmonic motion is the single most important idealized motion in physics, not because ideal springs are common but because almost nothing that oscillates around a stable equilibrium behaves any other way for small displacements. Push a swing gently, pluck a guitar string, disturb a molecule's bond length, or nudge a building slightly off its resting sway, and the restoring force is approximately proportional to displacement — Hooke's law, F = -kx — which is exactly the condition that produces SHM. That is why the mass-spring system taught in every introductory mechanics course generalizes so far beyond literal springs: this calculator's four output formulas describe the small-oscillation behavior of an enormous range of physical systems once you identify their effective mass and effective stiffness.
The calculator deliberately separates two kinds of quantities. Period, frequency, and angular frequency depend only on mass and spring constant — never on amplitude. Double the starting displacement and the oscillator still completes a full cycle in exactly the same time; this amplitude-independence (isochronism) is the defining, almost magical property of a linear restoring force, and it's the same property that makes pendulum clocks and quartz oscillators reliable timekeepers. Maximum velocity and maximum acceleration, by contrast, scale directly with amplitude: pull the mass back twice as far and it flies through equilibrium at twice the speed and slams into its turning points with twice the acceleration. Seeing both behaviors side by side in one calculator makes that asymmetry concrete rather than abstract.
This tool is the kinematic companion to Quanta's spring-force calculator, which solves the static Hooke's law relationship F = -kx and elastic potential energy U = ½kx² at a single instant. Where spring-force answers 'how hard is the spring pushing right now,' this calculator answers 'how does the whole oscillation unfold over time' — same physical system, complementary questions. Together with the pendulum-period calculator, which handles the other classic small-oscillation system, these three tools cover the standard first-semester physics toolkit for periodic motion.
Real oscillators only approximate this model. Real springs are Hookean only within their elastic limit; real systems lose energy to friction and air resistance, so the amplitude actually decays over time (damped oscillation) rather than repeating forever at constant A; and driven systems near resonance behave very differently again. This calculator assumes the clean, undamped, ideal case — the correct first approximation for the vast majority of introductory and intermediate mechanics problems, and the baseline every more realistic model builds on.
What is simple harmonic motion calculator?
Simple harmonic motion (SHM) is the periodic back-and-forth motion that results whenever the net restoring force on an object is directly proportional to its displacement from equilibrium and points back toward that equilibrium — Hooke's law, F = -kx. The canonical example is a mass m attached to an ideal spring of stiffness k, but the same mathematics describes any system oscillating through a small displacement around a stable equilibrium point, since a Taylor expansion of almost any smooth potential energy curve near a minimum reduces to exactly this form.
Applying Newton's second law to F = -kx gives the differential equation m(d²x/dt²) = -kx, whose solution is sinusoidal: x(t) = A·cos(ωt + φ), where A is the amplitude (maximum displacement), ω = √(k/m) is the angular frequency, and φ is a phase constant set by initial conditions. Differentiating gives velocity v(t) = -Aω·sin(ωt + φ), which has magnitude at most Aω — the maximum velocity, reached as the mass crosses equilibrium. Differentiating again gives acceleration a(t) = -Aω²·cos(ωt + φ), with magnitude at most Aω² — the maximum acceleration, reached at the two extremes of the motion where displacement is largest.
The period T = 2π/ω = 2π√(m/k) and frequency f = 1/T = ω/(2π) depend only on the system's mass and stiffness. Amplitude does not appear in either expression — a hallmark of SHM that this calculator's outputs make explicit by keeping period/frequency separate from the amplitude-dependent maximum velocity and acceleration.
How to use this calculator.
- Enter the amplitude A — the maximum displacement from equilibrium — in meters. This only affects the velocity and acceleration outputs, not the timing outputs.
- Enter the oscillating mass m in kilograms.
- Enter the spring constant k in N/m, the same stiffness value used in Hooke's law F = -kx.
- Read the period and frequency, which describe how fast the whole cycle repeats regardless of amplitude.
- Read maximum velocity (reached at the equilibrium point) and maximum acceleration (reached at maximum displacement) to understand the physical extremes of the motion.
- To model a different oscillating system, substitute an effective mass and effective spring constant for that system's own equation of motion — the same four formulas apply near any stable equilibrium.
The formula.
The starting point is Newton's second law applied to a Hookean spring, m(d²x/dt²) = -kx. This differential equation has the general solution x(t) = A·cos(ωt + φ), where ω = √(k/m) is the angular frequency — a quantity fixed entirely by the physical system, not by how far you pull the mass back. The period, the time for one full cycle, follows directly: T = 2π/ω = 2π√(m/k). Frequency is simply its reciprocal, f = 1/T = ω/(2π) = (1/2π)√(k/m).
Velocity comes from differentiating position: v(t) = dx/dt = -Aω·sin(ωt + φ). Because sine ranges between -1 and 1, the speed |v(t)| reaches a maximum of Aω exactly when sin(ωt + φ) = ±1 — which is exactly when cos(ωt + φ) = 0, i.e., when the mass is passing through equilibrium (x = 0). That maximum speed is the calculator's v_max = Aω output.
Acceleration comes from differentiating velocity: a(t) = dv/dt = -Aω²·cos(ωt + φ). This reaches its maximum magnitude of Aω² exactly when cos(ωt + φ) = ±1 — when x = ±A, the two turning points of the motion, where the spring is stretched or compressed the most and the restoring force (and therefore the acceleration, via F = ma) is largest. That maximum acceleration is the calculator's a_max = Aω² output. Notice the elegant relationship a_max = ω²·A = (k/m)·A: it is simply Hooke's law force at maximum displacement, F = kA, divided by mass, exactly consistent with Newton's second law.
The amplitude A cancels out of both ω and T algebraically — it never appears in the equation ω = √(k/m) at all — which is why period and frequency are amplitude-independent for an ideal Hookean spring. This same amplitude-independence appears in the small-angle pendulum, and both systems lose it once the restoring force stops being exactly linear (large-angle pendulums, springs pushed past their elastic limit).
A worked example.
A 0.5 kg mass is attached to a spring with stiffness k = 200 N/m, pulled 5 cm (0.05 m) from equilibrium, and released. The angular frequency is ω = √(k/m) = √(200/0.5) = √400 = 20 rad/s exactly. The period follows as T = 2π/20 ≈ 0.3142 seconds, and the frequency is f = 1/T ≈ 3.1831 Hz — the mass completes a little over three full back-and-forth cycles every second. As the mass swings, its speed is not constant: it moves fastest as it flies through the equilibrium point (x = 0), reaching v_max = A·ω = 0.05 × 20 = 1 m/s there, and it briefly comes to rest at each turning point (x = ±0.05 m), where its acceleration is instead at its peak: a_max = A·ω² = 0.05 × 400 = 20 m/s². If the release amplitude were doubled to 10 cm, the period and frequency would stay exactly the same — 0.3142 s and 3.1831 Hz — but both v_max and a_max would double, to 2 m/s and 40 m/s² respectively, since they scale linearly with A while ω itself is unchanged.
Frequently asked questions.
Why doesn't the period depend on amplitude?
What is the difference between velocity and maximum velocity in SHM?
How is this different from the spring-force calculator?
Does this calculator account for friction or air resistance?
Can I use this calculator for something other than a literal spring?
What happens to v_max and a_max if I double both the amplitude and the spring constant?
Why is angular frequency ω used instead of just frequency f?
References& sources.
- [1]OpenStax. University Physics Volume 1, Section 15.1 'Simple Harmonic Motion' — equations for ω = √(k/m), T = 2π√(m/k), v_max = Aω, and a_max = Aω² for a mass on a spring.
- [2]Hooke, R. (1678). De Potentia Restitutiva, or Of Spring. Cutlerian Lecture, London — origin of F = -kx, the linear restoring force whose solution is simple harmonic motion.
- [3]Halliday, D., Resnick, R., & Walker, J. (2018). Fundamentals of Physics, 11th edition, Chapter 15 (Oscillations). Wiley.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 313 calculators remain free
- No billing is enabled