Audited ·Last updated 27 Jul 2026·3 citations·Tier 2·0 uses

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

Maximum displacement from equilibrium. Does not affect period or frequency, but scales maximum velocity and acceleration directly.
Mass of the oscillating object attached to the spring.
Stiffness of the spring, from Hooke's law F = -kx. A soft lab spring is 5-50 N/m; a car suspension spring is 20,000-40,000 N/m.
Period (T)
0.3142
Time for one complete oscillation, T = 2π√(m/k). Independent of amplitude.
Frequency (f)
3.1831 Hz
Angular frequency (ω)
20 rad/s
Maximum velocity (v_max)
1 m/s
Maximum acceleration (a_max)
20 m/s²

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.

  1. Enter the amplitude A — the maximum displacement from equilibrium — in meters. This only affects the velocity and acceleration outputs, not the timing outputs.
  2. Enter the oscillating mass m in kilograms.
  3. Enter the spring constant k in N/m, the same stiffness value used in Hooke's law F = -kx.
  4. Read the period and frequency, which describe how fast the whole cycle repeats regardless of amplitude.
  5. Read maximum velocity (reached at the equilibrium point) and maximum acceleration (reached at maximum displacement) to understand the physical extremes of the motion.
  6. 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.

ω = √(k ⁄ m), T = 2π ⁄ ω, v_max = Aω, a_max = Aω²

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.

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.

amplitude0.05
mass0.5
spring Constant200

Frequently asked questions.

Why doesn't the period depend on amplitude?
Because the angular frequency ω = √(k/m) is derived purely from the spring constant and the mass — amplitude never enters that formula. This is a direct consequence of the restoring force being exactly linear in displacement (Hooke's law, F = -kx): a larger amplitude means both a larger distance to travel and a proportionally larger restoring force accelerating the mass back, and those two effects cancel exactly, leaving the round-trip time unchanged. This amplitude-independence, sometimes called isochronism, breaks down the moment the restoring force stops being linear — which is why a large-swing pendulum (where the restoring force involves sin θ, not θ) does show a small period dependence on amplitude, as Quanta's pendulum-period calculator quantifies.
What is the difference between velocity and maximum velocity in SHM?
Instantaneous velocity v(t) = -Aω·sin(ωt + φ) changes continuously throughout the cycle, passing through zero at the turning points (x = ±A) and reaching its extreme values as the mass crosses equilibrium. Maximum velocity, v_max = Aω, is just the single largest speed the object attains anywhere in its cycle — the peak of that sinusoidal velocity curve. This calculator reports only v_max, the number most often needed for energy calculations (kinetic energy at equilibrium is ½m·v_max²) and safety or design checks (peak speed a moving part will reach).
How is this different from the spring-force calculator?
Spring-force solves the static Hooke's law relationship F = -kx at one instant — given displacement and stiffness, what force does the spring exert right now, and how much elastic potential energy is stored? This calculator instead describes the full time-domain oscillation that results when that spring is allowed to move a mass freely: how long one cycle takes (period, frequency), and how fast the mass moves and accelerates at the extremes of that motion. The two tools share the same underlying spring but ask different questions — use spring-force for an instantaneous force/energy snapshot, and this calculator for the oscillation's timing and motion envelope.
Does this calculator account for friction or air resistance?
No. This calculator models the idealized, undamped case, where the oscillation repeats forever at constant amplitude A. Real oscillators lose energy to friction, air resistance, and internal material damping, so their amplitude decays exponentially over time — a behavior called damped harmonic motion, governed by an additional damping term in the equation of motion. The undamped model computed here is still the essential starting point: it gives the natural frequency ω₀ that damped and driven oscillators are measured relative to, and for lightly-damped systems (most mechanical springs, tuning forks, LC circuits) the period and frequency computed here remain accurate to a very good approximation over many cycles.
Can I use this calculator for something other than a literal spring?
Yes, as long as you can identify an effective mass and an effective spring constant for the system. Any object oscillating through a small displacement around a stable equilibrium — a molecule's bond length, a building swaying slightly in the wind, a diving board, an LC electrical circuit, the small-oscillation limit of a pendulum — obeys the same F = -kx form once you linearize its true restoring force around equilibrium (a first-order Taylor expansion), and it will have its own effective k derived from the physics of that system. Substitute that effective k, and the effective mass (or, in an LC circuit, the effective inductance-capacitance combination), and the same four formulas — ω, T, f, v_max, a_max — apply directly.
What happens to v_max and a_max if I double both the amplitude and the spring constant?
v_max = Aω = A√(k/m) scales with the amplitude directly and with the square root of the spring constant, so doubling A and doubling k together multiplies v_max by 2 × √2 ≈ 2.83. a_max = Aω² = A(k/m) scales with amplitude directly and linearly with spring constant, so the same change multiplies a_max by 2 × 2 = 4. Meanwhile the period T = 2π√(m/k) depends only on k (and m), not amplitude at all, so doubling k alone shrinks the period by a factor of √2 ≈ 1.41, regardless of what you do to A. This is a good sanity check to run in the calculator directly: adjust one input at a time and watch which outputs move.
Why is angular frequency ω used instead of just frequency f?
Angular frequency (radians per second) is the natural variable in the differential equation of motion and in the sinusoidal solution x(t) = A·cos(ωt + φ) — it is what actually appears inside the cosine. Ordinary frequency f (cycles, or Hertz, per second) is more intuitive for everyday communication ('the mass oscillates about 3 times a second'), but it requires an extra factor of 2π to convert: ω = 2πf. This calculator reports both so you can use whichever is more convenient for your next calculation — ω for further calculus-based work, f for a more intuitive sense of how fast the oscillation repeats.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon