The idea: a weight on a string

Hang a small heavy bob on a light string of length L, pull it aside by an angle θ₀ and let go. Gravity pulls it back towards the bottom, it overshoots, and it swings back and forth. For small swings the angle from the vertical is

θ(t) = θ₀ · cos(ωt + φ)        ω = √(g / L)

a plain cosine wave. Only two things set how fast it swings: the length L and the gravity g. The mass is not in the formula, and neither is how far you pulled it.

A pendulum hanging from a pivot, string length L at angle θ from the vertical. The weight mg of the bob is split into mg·cos θ along the string and mg·sin θ along the arc, pointing back to the bottom. The arc from the bottom to the bob has length s = L·θ.
Only the part of the weight along the arc, m·g·sin θ, pulls the bob back; the string cancels the rest.

Each number has one job:

numberwhat it changes
L (length)the speed: T grows like √L
g (gravity)the speed: T shrinks like 1/√g
m (mass)nothing about the swing: it cancels
θ₀ (amplitude)how far it swings; for small θ₀ not the period
φ (phase)where in the swing the clock starts: θ(0) = θ₀·cos φ

ω, f and T: three names for one speed

The period T is the time for one full swing, there and back. The frequency f is how many full swings fit in one second. The angular frequency ω is how many radians the cosine turns per second; one swing is one turn of 2π. So they are tied together:

ω = 2π·f = 2π / T        f = 1 / T = ω / 2π        T = 1 / f = 2π / ω
nameunitL = 1 m, Earthbigger means
period Ts2.006 sslower
frequency fHz = 1/s0.498 Hzfaster
angular frequency ωrad/s3.13 rad/sfaster

Setting one of them on the page fixes the other two. The pendulum itself only has L and g to turn, so the page keeps g and solves for L: L = g / ω² = g·T² / 4π². That is how a pendulum clock is tuned: you move the bob up or down the rod. (Demo 7: set f, then ω: f = 0.4 Hz needs L ≈ 1.553 m, ω = 2.5 rad/s needs L ≈ 1.570 m. Demo 4: set T = 3 s needs L ≈ 2.236 m.)

Where ω = √(g/L) comes from

The bob moves on a circle of radius L, so its distance along the arc from the bottom is s = L·θ. The string pulls straight towards the pivot and does no work along the arc. Of the weight m·g, only the part along the arc, m·g·sin θ, pushes the bob back. Newton's law along the arc:

m · L · θ″ = − m · g · sin θ

For small angles sin θ ≈ θ (θ in radians: sin 15° = 0.2588, 15° = 0.2618 rad, 1% apart). Then

θ″ = − (g / L) · θ

which says: the acceleration is proportional to how far you are from the bottom, pointing back. The functions whose second derivative is −ω² times themselves are the cosines cos(ωt + φ), with ω² = g/L. That is simple harmonic motion, the same equation as a mass on a spring with ω² = k/m.

Why the mass cancels

m appears on both sides of m·L·θ″ = −m·g·sin θ. A bob twice as heavy is pulled back twice as hard, but it is also twice as hard to speed up, so it swings exactly the same. (Galileo is said to have noticed this; it is the same reason all things fall alike in a vacuum.) On the page the bob only gets bigger. (Demo 3: mass has no effect)

This is different from a spring: there the force k·x does not grow with m, so a heavier mass swings slower, ω = √(k/m). See Spring Oscillator.

Length and gravity

Both sit under a square root, T = 2π√(L/g). Four times the length doubles the period; nine times the length triples it. (Demo 1: 2.25× longer string: L 1 → 2.25 m, T 2.006 → 3.009 s, × 1.5; in the time blue makes 5 swings the grey pendulum makes 7.5. Demo 6: sweep L: T/√L stays 2π/√g ≈ 2.006.)

where (L = 1 m)g (m/s²)T (s)× Earth
Moon1.624.942.46
Mars3.713.261.63
Earth9.812.011
Jupiter (cloud tops)24.791.260.63

(Demo 2: on the Moon.) Turned around, a pendulum measures g: time it and g = 4π²·L / T².

A seconds pendulum takes exactly 1 s for each one-way swing, so T = 2 s. On Earth that needs L = g·T²/4π² = 9.81·4/39.48 ≈ 0.994 m, which is why tall grandfather clocks are about a metre long inside. (The page keeps L ≥ 1 m, so it tunes to T = 3 s instead in Demo 4.)

θ₀ and φ: size and start, not speed

θ₀ multiplies the cosine, so it sets how far the bob swings: the curve gets taller, the peaks stay where they were. The maximum speed at the bottom grows with it: v = L·ω·θ₀ (θ₀ in radians), 0.82 m/s at the start. φ slides the curve in time: θ(0) = θ₀·cos φ. φ = 0 starts at the far right, φ = π at the far left, φ = −π/2 starts at the bottom moving right. Neither changes ω, f or T in the small-angle formula.

Big swings are slower

sin θ is smaller than θ, and the gap grows with the angle, so a wide swing is pulled back less than the formula says and takes longer. The page also solves the full equation θ″ = −(g/L)·sin θ step by step (RK4 with 2 ms steps, like Euler's Method but more accurate) and draws it in pink. The exact period is

T = T₀ · (1 + θ₀²/16 + 11·θ₀⁴/3072 + …)        T₀ = 2π√(L/g), θ₀ in radians
The ratio T/T₀ plotted against the amplitude θ₀ from 0° to 90°: the exact curve rises from 1 to 1.18, the approximation 1 + θ₀²/16 stays close until about 40° and then falls below. Marked: 15° gives 1.004, 30° gives 1.017, 60° gives 1.073.
Up to about 20° the small-angle period is within 1%; at 60° the real swing is 7.3% slower.
θ₀true T / T₀error of the formula
5°1.00050.05%
15°1.00430.4%
30°1.01741.7%
60°1.07327.3%
90°1.180318%

(Demo 5: big swing θ₀ = 60°: after ten blue swings the pink pendulum is about 246° of a swing behind, two thirds of a swing. Demo 8: at 45° the lag after twenty swings is about 277°.) A pendulum clock keeps good time because its swing is small and, more importantly, always the same size.

In the Ballistic Pendulum a bullet starts the swing, and the height it reaches measures the bullet's speed.

A satellite also trades kinetic for potential energy as it climbs and falls, but it falls around the planet instead of back and forth: see Orbital Motion.

The same g decides how a thrown ball flies: on the Moon (g = 1.6) a throw goes about 6 times as high and as far, in about 6 times as long; see Projectile Motion.

The pull along the path is mg·sinθ on a ramp too, and the mass cancels there as well: A Block on a Ramp.

Hang a second pendulum from the bob and small swings split into two normal modes while big ones turn chaotic: see The Double Pendulum: Normal Modes and Chaos.

What the page leaves out

Friction and air drag, which make the swings die out (see Damped Oscillation); a physical pendulum (a swinging rod or any rigid body, T = 2π√(I/(m·g·d))); the mass of the string and the size of the bob; a pushed or driven pendulum and resonance; swings over the top; and the double pendulum, whose motion is chaotic. The page keeps L between 1 and 2.5 m, θ₀ up to 60°, and a swing to at most 20 periods; the time axis grows to fit them.