SHM Energy Calculator – Total, Kinetic & Potential Energy

Use this free SHM Energy Calculator to find the total energy of a mass oscillating on a spring, and how that energy splits into kinetic and potential energy at any displacement x.

An oscillator is an energy juggler. Twice in every cycle it holds all its energy as stretch in the spring; twice it holds it all as motion; in between, it is always mid-trade. This calculator audits the juggle: give it the spring constant k, the amplitude A and any displacement x, and it reports the total energy E — which never changes — together with the potential and kinetic shares at that position. It is the bookkeeping page of simple harmonic motion, and the books always balance.

The headline result, E = ½kA², deserves a stare. The energy depends on the spring and the amplitude — and on nothing else. The mass is absent: a heavy mass and a light mass on the same spring, swung to the same amplitude, store identical energy; the heavy one simply trades it more slowly, moving at lower peak speed. And the amplitude enters squared, so doubling the swing quadruples the energy — the reason a trampoline's bounce height is so sensitive to how hard you drive it, and why vibration isolation is designed around limiting amplitude above all else.

SHM Energy Calculator — formula and diagram

Position by position, the split follows PE = ½kx² and KE = E − PE = ½k(A² − x²). Because x itself oscillates, the shares slosh sinusoidally, each completing two full exchanges per cycle. Learn to read that sloshing and you can answer, for any oscillator, the questions engineers actually ask: how fast is it moving here, how much must the spring withstand there, how much energy must a damper remove per cycle to quiet it.

x = −A x = −A/2 x = 0 x = +A blue = PE gold = KE total height never changes — only the split does

Formula

Total energy E = ½kA²  •  potential energy PE = ½kx²  •  kinetic energy KE = ½k(A² − x²)  •  energies in joules (J), k in N/m, A and x in metres (m)

The kinetic share can equally be written KE = ½mv², and equating the two at the centre (x = 0, where KE = E) yields the peak speed vmax = A√(k/m) — the bridge to the SHM Velocity Calculator. The potential share for a pendulum takes the gravitational form PE = mgh, with h the height above the lowest point; for small swings the two descriptions are interchangeable. Note what the formulas assume: an ideal spring storing energy exactly as ½kx², and no friction. Within those assumptions the split at any x is exact, and the fractions depend only on the ratio x/A: PE/E = (x/A)², a universality the quick-reference table below exploits.

SymbolMeaningUnits
Etotal mechanical energy (constant)J
PEpotential energy stored in the spring, ½kx²J
KEkinetic energy of the mass, ½mv²J
kspring constantN/m
Aamplitude — maximum displacementm
xdisplacement from equilibrium at the instant of interestm

The great trade: energy sloshing twice per cycle

Follow one cycle slowly. Released from rest at x = +A, the mass holds E entirely as potential energy. The spring pulls it inward; PE drains into KE, which peaks at the centre where PE (measured from equilibrium) is zero and the full E is motion. Overshooting, the mass climbs the other side, KE drains back into PE, and at x = −A the account is all potential again. The return journey repeats the trade. Two complete PE→KE→PE exchanges per cycle means the energy shares oscillate at twice the frequency of the motion itself — a fact with real consequences: a damper or a piezoelectric harvester attached to the oscillator gets two chances per cycle to skim energy off.

Averaged over a full cycle, the books split evenly: mean KE = mean PE = E/2. This is a special case of the virial theorem, and it is a powerful shortcut — if you know the average kinetic energy of any bound oscillator, from a vibrating molecule to a star pulsating, you know its total energy is twice that. Instantaneously, though, the split is lopsided toward whichever form the position dictates, following (x/A)² for PE. Halfway out (x = A/2) the split is not half-and-half but 25% PE, 75% KE — the square law concentrating potential energy near the extremes, where the oscillator also spends the least time.

Where does the mass enter? In the speed that a given KE implies. Two oscillators with the same k and A share E, but the lighter mass converts its KE share into higher speeds — v = √(2·KE/m) — and shorter periods. Energy sets the budget; mass sets the tempo of spending. That division of labour is why the formula sheet for SHM splits so cleanly into energy results (no m) and timing results (nothing but m and k).

PE KE PE + KE = E (flat line) at every moment — the shares mirror each other

How to use

  1. Enter the spring constant k in N/m (find it with the Spring Constant Solver if needed).
  2. Enter the amplitude A in metres — centre to turning point.
  3. Enter the displacement x where you want the audit, between −A and +A.
  4. Read E, PE and KE. Check the bookkeeping: PE + KE must equal E exactly; if it does not, an input slipped.

Worked examples

Example 1 — the standard audit. k = 100 N/m, A = 0.2 m, x = 0.1 m:
E = ½ × 100 × 0.2² = 2 J; PE = ½ × 100 × 0.1² = 0.5 J; KE = 2 − 0.5 = 1.5 J. Halfway out, the mass still holds three quarters of the energy as motion.

Example 2 — passing through the centre. The same oscillator at x = 0: PE = 0 J and KE = 2 J, all of it motion. If the mass is 0.5 kg, its speed there is v = √(2 × 2 / 0.5) = 2.83 m/s — the peak speed, recovered from pure energy bookkeeping.

Example 3 — a softer spring. k = 50 N/m, A = 0.1 m, x = 0.05 m: E = ½ × 50 × 0.01 = 0.25 J; PE = ½ × 50 × 0.0025 = 0.0625 J; KE = 0.1875 J. Same halfway geometry as Example 1, same 25/75 split — the ratio x/A decides the shares, the scale decides the joules.

Example 4 — where KE equals PE. k = 200 N/m, A = 0.3 m: E = ½ × 200 × 0.09 = 9 J. The shares balance where ½kx² = E/2, at x = A/√2 = 0.212 m, with PE = KE = 4.5 J each — the oscillator passes this point four times per cycle.

Example 5 — doubling the amplitude. Example 1's spring swung to A = 0.4 m: E = ½ × 100 × 0.16 = 8 J — four times the energy for twice the swing. The spring must also withstand twice the peak force, which is why amplitude limits are structural limits.

Example 6 — a bungee bounce. Model the taut cord as k = 80 N/m with A = 1.5 m: E = ½ × 80 × 2.25 = 90 J. At x = 1.0 m below equilibrium, PE = ½ × 80 × 1 = 40 J and KE = 50 J — the jumper is still moving briskly a metre into the stretch.

Oscillator energy in real life

Energy harvesting. Shoe-sole and bridge sensors harvest the KE share as the oscillator passes the centre, where motion is fastest. Knowing the split by position tells the designer where to place the piezoelectric element — at maximum strain for PE harvesting, at maximum speed for electromagnetic.

Trampoline and diving-board design. The board stores the diver's energy as PE at full flex and returns it as KE at release. E = ½kA² with the board's effective k and flex A predicts the launch energy — and the height it can buy.

Vehicle suspension bumps. Hitting a bump injects energy the damper must convert to heat. The audit — how much E at the expected amplitude — sizes the damper's thermal capacity on a mountain descent.

Molecular vibrations. A chemical bond is a spring with k of hundreds of N/m and amplitudes of picometres; E = ½kA² lands in the infrared photon range, which is why molecules absorb IR at their vibration frequencies — spectroscopy is this calculator at atomic scale.

Seismic isolation bearings. A building on soft bearings is an oscillator whose energy in a quake must go somewhere. The PE share at maximum drift sizes the bearings; the KE share at centre sizes the dampers that bleed it away.

Archery and catapults. A drawn bow is PE = ½kA² in wooden form. The arrow's muzzle energy is the KE share at the loose, minus losses — the same audit, with feathers.

A = 0.1 m A = 0.2 m same spring k = 100 N/m: double the amplitude, four times the energy (0.5 J → 2 J)

Damping: where the energy goes

The calculator's E is constant because the model has no friction. Real oscillators leak. Each cycle, air drag and internal friction convert a slice of the mechanical energy into heat, the amplitude decays, and E — proportional to A² — decays twice as fast in percentage terms: lose 10% of amplitude per cycle and you lose about 19% of energy. Engineers summarise the leak with the quality factor Q: the energy falls by a factor of e (about 2.72) roughly every Q radians of oscillation, so a bell (Q in the thousands) rings for minutes while a car suspension, its damper counted in, has an effective Q of order 1 and settles within a bounce or two. The energy audit on this page is the starting balance from which every damping calculation subtracts.

Deliberate damping is a design tool, not just a nuisance. A galvanometer needle, a bathroom scale, a skyscraper's tuned mass damper — all are oscillators whose energy must be removed at a controlled rate, fast enough to settle, slow enough not to overshoot into stiffness. Critical damping, the boundary case, returns the system to rest in the shortest possible time without oscillating, and it is defined entirely by how quickly it can drain exactly the E this calculator computes.

The same audit beyond springs

Nothing in the bookkeeping is really about springs. A pendulum trades gravitational PE for KE with the same twice-per-cycle rhythm; its total, mghmax, plays the role of ½kA². An LC circuit trades energy between the capacitor's electric field (the PE role, Q²/2C) and the inductor's magnetic field (the KE role, ½LI²), with the charge on the capacitor following the same cosine as a mass's displacement. Even a vibrating molecule and a pulsating star obey the pattern: a potential well, a kinetic flow, a constant sum. Learn the audit once, on the friendly spring, and you own it everywhere — the calculator's split-by-position idea, PE share = (displacement/maximum)², recurs whenever the restoring influence is proportional to displacement.

The universality has a boundary worth knowing: it rests on the potential being quadratic, PE ∝ x². Stiffen the spring progressively — as vehicle suspension bump stops and valve springs deliberately do — and the well deepens faster than x²; the shares then lean harder into PE near the extremes, the period shortens as amplitude grows, and the motion stops being simple harmonic. The audit still balances, but the neat (x/A)² table no longer applies.

From energy to force: what the spring must withstand

Energy numbers convert directly into the forces that break things. The peak spring force is Fmax = kA — for Example 1, 100 × 0.2 = 20 N — and it occurs exactly where PE = E, at the extremes. A designer choosing a spring therefore works backwards from this page: the application fixes the energy to be absorbed (a door slam, a bump, a recoil), the available travel fixes A, and k = 2E/A² follows. Halve the travel and k quadruples, and Fmax = 2E/A doubles — the arithmetic behind the harsh ride of short-travel suspensions and the gentle one of long-travel ones. Energy, amplitude and peak force are three faces of one budget; this calculator shows the first, and the other two are one multiplication away.

Quick reference: how the energy splits with position

Position x/APE shareKE share
0 (centre)0%100%
0.256.25%93.75%
0.5025%75%
0.71 (A/√2)50%50%
0.7556.25%43.75%
0.9081%19%
1.00 (extreme)100%0%

The table is universal — it holds for every spring oscillator ever built, because the shares depend only on x/A. Multiply the percentages by your E and the audit for any position is done without touching the calculator again.

One last consequence of the square law deserves emphasis because it inverts a common intuition: an oscillator spends most of its time near the extremes, where it moves slowly, yet most of its energy there is potential — while the fleeting centre crossing, over in an instant, is where the kinetic energy lives. Snapshots of an oscillator are therefore misleading twice over: the position you are likeliest to catch it in is the one where it is doing the least moving, and the position where it moves fastest is the one it vacates quickest.

Common mistakes

  • Putting the mass into E. E = ½kA² has no m. If your energy changes when you change the mass at fixed k and A, a wrong formula (usually ½mv² with v guessed) has crept in.
  • Measuring x from the wrong zero. x is displacement from equilibrium, not from the spring's unstretched end and not from the floor. On a vertical spring the equilibrium is the hanging rest position.
  • Using peak-to-peak swing as A. A is centre-to-extreme. Doubling A quadruples E, so this slip inflates the energy fourfold.
  • Expecting KE = PE at x = A/2. The split follows squares: at half amplitude PE is a quarter of E, not a half. Equality waits until x = A/√2 ≈ 0.71A.
  • Forgetting gravity on a vertical spring. The spring PE formula still works about equilibrium, but a full energy audit of a vertical oscillator should include gravitational PE — the two trade against each other so the ½kx²-about-equilibrium bookkeeping stays valid.

FAQ

Why is the total energy proportional to A²?
Because a spring's stored energy is ½kx². Double the amplitude and the energy becomes four times larger.

At what displacement is KE equal to PE?
When ½kx² = ½E, i.e. at x = A/√2 ≈ 0.71A.

Does the mass of the oscillator matter for the energy?
Not directly — E = ½kA² uses only k and A. The mass affects the period and speed, not the total energy.

How much of the cycle is spent with KE greater than PE?
KE exceeds PE whenever |x| < A/√2, which covers about half of each cycle — the oscillator passes the balance point four times per period and spends roughly 50% of its time KE-dominant.

Can I find the speed at x from this page's numbers?
Yes: v = √(2·KE/m). The calculator gives KE at your x; one square root with the mass turns it into the instantaneous speed.

What is the average KE over a full cycle?
Exactly E/2 — and the average PE is also E/2. The shares are unequal at almost every instant yet perfectly equal on average.

Does a pendulum follow the same energy rules?
Yes, with gravitational PE = mgh replacing ½kx². The total is constant, the split follows height, and KE = PE halfway up the height range — the same audit in different dress.

Why does the oscillation die away in real life if E is constant?
E is constant only in the frictionless model. Real systems leak energy to heat through damping, so A and E decay together — E falling as the square of the amplitude's decay.

How much energy does a car suspension handle?
A corner spring of k = 20,000 N/m compressed an extra 0.1 m stores ½ × 20,000 × 0.01 = 100 J — per bump, per corner, which the damper then turns into heat.

What if x is entered larger than A?
The position is unreachable: PE would exceed E and KE would come out negative — the calculator's way of saying the mass never gets there. Check whether A was entered peak-to-peak.

James Carter

James Carter

Physics Writer · Forces & Motion

James Carter creates and reviews our dynamics and oscillations calculators at CalcVIP. Every calculator is checked against hand-worked examples before it is published, so the formula, the diagram and the answer all agree.

View full profile & all calculators by Carter →