Simple pendulum calculator
A 1 m pendulum under standard gravity, 9.80665 m/s², takes about 2 s for one full cycle. Enter the length from pivot to centre of mass and the local gravity to get the small-angle period in seconds and the frequency in hertz. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Length
- 1
- Gravity
- 9.80665
- Period
- 2.0064092926
- Frequency
- 0.4984027953
A simple pendulum is an ideal point mass hanging from a massless string or rod that swings under constant gravity. For small angles the motion is simple harmonic, and the oscillation period depends only on length and gravitational acceleration — not on mass and not on amplitude. Use it for laboratory expected values, classroom checks, hanging-prop timing, and any script that needs a deterministic small-angle period without a spreadsheet.
What the small-angle simple pendulum computes
A simple pendulum is an idealization: a point mass, often called the bob, attached to a massless inextensible string or rigid rod that is free to swing in a vertical plane about a fixed pivot. Starting from Newton’s second law in angular form, the restoring torque is minus m g L times the sine of the angular displacement, the moment of inertia about the pivot is m L squared, and the equation of motion is the second derivative of theta plus (g/L) times sin(theta) equals zero. That equation is nonlinear.
The small-angle approximation replaces sin(theta) with theta itself, which is accurate when the maximum angular displacement is a few degrees, because theta in radians is then nearly equal to its sine. The linearized equation is simple harmonic motion with angular frequency omega equal to the square root of g over L. Mass cancels: a heavier bob does not change the ideal period.
Amplitude also drops out of the linearized model, which is why a classroom stopwatch experiment that stays near the vertical can compare many different starting angles against the same predicted T. This calculator evaluates that closed form only. It does not integrate the full nonlinear pendulum, does not apply elliptic-integral corrections for large swings, and does not model a physical pendulum whose mass is distributed along a bar.
Those problems need different inputs and different formulas. Length L is the distance from the pivot to the centre of mass, in metres. Gravitational acceleration g is the local value in metres per second squared.
The returned period is in seconds, which is the quantity a stopwatch, a game timer, or a sensor firmware loop actually waits for.
Inputs, units, and the period in seconds
Both must be strictly greater than zero. A zero or negative length is the error this product is built around: there is no physical simple pendulum with non-positive L, and the square-root expression is not defined for L less than or equal to zero. A zero or negative gravity is likewise rejected, because dividing by g would be undefined or would send the motion into an unphysical regime.
Frequency in hertz is also reported as one over the period, which is useful when a timer or animation loop is specified in cycles per second rather than seconds per cycle. A one-metre pendulum under standard Earth gravity of 9.80665 metres per second squared has a period of about two seconds; that pair is a useful sanity check when wiring a client. Convert centimetres or inches to metres before calling.
Convert g-force multiples to absolute metres per second squared.
Where a simple pendulum calculator is used
Physics teachers and laboratory assistants use a simple pendulum calculator to prepare the expected period before students time ten swings with a stopwatch and compute percent error against theory. Game and animation engineers need a transparent period when a hanging lamp, wrecking ball, or metronome should feel physically plausible at a given rope length and world gravity. Instrumentation groups compare measured zero-crossing times against the ideal T to flag extra damping, a wrong effective length, or a mis-set gravity constant in firmware.
Keep requests small, pin the rounded period in tests, and you get a reproducible textbook baseline for homework, LMS plugins, and edge workers without standing up a numerical ODE solver. Failed validation does not consume balance. The calculator will not correct large-amplitude data for you; if your experiment swings through tens of degrees, compare the small-angle prediction with the measured period and treat the difference as the finite-amplitude correction you set out to study.
What you can do with it
Prepare a lab answer key
Teachers enter pivot-to-bob length and the room’s g to print the expected small-angle period students should approach with a stopwatch.
Time a hanging prop in a scene
Animators set rope length and world gravity so a hanging lamp or wrecking ball completes each swing in a physically honest number of seconds.
FAQ
How is the simple-pendulum period computed from length and gravity?
The primary result is the period in seconds; frequency in hertz is 1/T.
Which units should I send for length and gravity?
Length is metres from the pivot to the centre of mass. Gravity is metres per second squared. Convert centimetres, inches, or g-force multiples before calling.
Why does a non-positive length fail?
A zero or negative length is not a physical pendulum length, and √(L/g) is not defined for L ≤ 0.
Does mass or starting angle change the result?
Not in this model. Mass cancels, and the small-angle linearization drops amplitude, so only length and gravity remain. Large swings need a different formula.
How large can the swing be?
Keep it to a few degrees. The period comes from the small-angle approximation, which is accurate only while the angle in radians is close to its sine; large swings need corrections this calculator does not apply.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/phys/simple-pendulum \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"length":1,"gravity":9.80665}'const res = await fetch("https://api.kit.forhosting.com/phys/simple-pendulum", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"length": 1,
"gravity": 9.80665
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/phys/simple-pendulum",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"length": 1,
"gravity": 9.80665
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/phys/simple-pendulum", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"length":1,"gravity":9.80665}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"length":1,"gravity":9.80665}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/phys/simple-pendulum", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"length": 1,
"gravity": 9.80665
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "phys.simple_pendulum",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This calculator applies the closed-form result T equals two pi times the square root of length over gravity and returns the period in seconds as structured JSON. Length must be strictly positive; a zero or negative length is rejected with invalid_input and is not billed.
What the small-angle simple pendulum computes
One full cycle therefore takes a period T equal to two pi over omega, which is T = 2π √(L/g).
Inputs, units, and the period in seconds
Send two required finite numbers. length is the pendulum length in metres; aliases length_m and L are accepted so a laboratory notebook that already labels the column L does not need a rename. gravity is the gravitational acceleration in metres per second squared; aliases gravity_m_s2 and g are accepted. A missing field, an empty string, a non-numeric token, NaN, or Infinity fails with invalid_input naming the field, and that failure is not billed. On success the JSON echoes length and gravity after stable twelve-decimal rounding, returns period in seconds as the primary result, and restates the formula T = 2π √(L/g) so a client can print the identity next to the number. A successful item is billed at the published $0.002.
Where a simple pendulum calculator is used
Because each successful call is a single analytic item priced at $0.002, batch scripts can recompute tables of periods across a range of lengths or planetary gravities without a subscription or a model cost. Prefer this endpoint when the search intent is the simple pendulum itself — the small-angle period from L and g — rather than the inverse problem of finding the length that produces a target period, the energy split at an angle, or the conical pendulum that travels in a horizontal circle. Those related tools answer different queries and should not cannibalize this landing.
Integration use cases
Check a measured encoder period
Firmware authors compare a counted zero-crossing interval with T = 2π √(L/g) to catch a wrong effective length or a mis-set gravity constant.
Technical questions
What does a successful API request cost?
A successful item is billed at $0.002. The on-page browser runner is free. Invalid input does not consume balance.