ForHosting KIT · Engineering & construction

Pendulum length calculator

Tell it the swing time you want and get the string length: a 2-second period under 9.81 m/s² needs just under 1 m. Useful before cutting string or rod for a clock or metronome. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Period
2
Gravity
9.81
You get
Length
0.9939608115
T over 2pi
0.3183098862
Four pi sq
39.4784176044
T squared
4

A simple pendulum is an ideal mass on a massless string swinging under constant gravity. Rearranged for design work, the length you need for a target period is L equals g times the square of T over two pi. Students check homework clocks and metronomes; teachers and auto-graders need a deterministic oracle; lab engineers size suspension lengths before cutting string or rod stock. This calculator accepts period in seconds and gravity in metres per second squared, returns length in metres with intermediate factors for audit, and rejects non-positive period so bad timing specs never become a silent NaN. Non-positive gravity is also rejected because the model cannot produce a physical length.

How simple-pendulum length follows from the period formula

Start from the small-angle equation of motion for a point mass suspended by a fixed length under uniform gravity. Linearizing sin theta to theta yields simple harmonic motion with angular frequency omega equal to the square root of g over L. The oscillation period is therefore T equals two pi over omega, which expands to T equals two pi times the square root of L over g.

Solving for length is a single algebraic rearrangement: isolate the square root, divide both sides by two pi, square both sides, then multiply by g to obtain L equals g times the square of T over two pi, equivalently L equals g times T squared over four pi squared. The result is independent of the bob mass in the ideal model, which is why classroom labs often measure g from period and length rather than from mass.

Period must be a finite positive number of seconds; zero and negative values fail with invalid input because they are not oscillation periods. Gravity must likewise be finite and positive so length stays physical. This page intentionally uses the small-angle approximation only; large-angle elliptic integrals, physical pendulums with extended bodies, and air drag corrections are separate search intents and separate landings.

What you send and what you get back

Send two required finite numbers under the fields period and gravity. Period is the desired full-cycle time T in seconds and must be strictly greater than zero. Gravity is local gravitational acceleration g in metres per second squared and must also be strictly greater than zero; use about nine point eight one for Earth surface work, or a measured lab value when precision matters.

Classic textbook checks include a two-second period under nine point eight one metres per second squared near one metre of length, and a one-second period under the same g near one quarter metre. Keep units consistent across a multi-step lab: if you measure g in centimetres per second squared you must convert to metres per second squared before calling, or scale the length result accordingly after, so the numeric product still matches the SI interpretation your report claims.

Where pendulum length calculators show up in real work

Secondary-school and introductory university physics courses assign period-to-length drills, clock-pendulum sizing, and local-g labs that rearrange the same formula; a single trusted oracle speeds grading and demo setup. Museum and exhibit designers size long-period Foucault and demonstration pendulums from a target beat before ordering suspension hardware. Robotics and mechanism labs convert desired swing timing into arm or string length for passive dynamic walkers and low-frequency sensors as a first filter before full multibody dynamics.

Sports science and playground safety staff estimate suspension lengths for swings and trapezes from a preferred period under local gravity. If you later need period from a known length, large-angle period corrections, physical-pendulum equivalent length, or damped free decay, treat those as separate search intents and landings rather than overloading this pendulum length calculator page.

Homework and lab answer keys

Compute required simple-pendulum length L from target period T and local g so students and auto-graders share one closed-form ground truth in metres.

Clock and metronome sizing

Convert a desired beat period under Earth gravity into suspension length before cutting string or rod stock for classroom clocks.

Exhibit and mechanism design

Size demonstration or passive-swing lengths from a target period and site gravity without re-deriving L = g(T/2π)² each time.

What formula does this pendulum length calculator use?

Mass does not appear in the ideal model.

What happens if period is zero or negative?

Oscillation period T must be a finite number greater than zero seconds.

Which gravity value should I use?

Use local g in m/s². About 9.81 m/s² is standard for Earth-surface homework; labs may pass a measured value. Gravity must be positive.

Does this include large-angle corrections?

No. This page uses the small-angle approximation only. Large-angle elliptic integrals and physical-pendulum models are separate problems and landings.

What does it cost?

The browser tool is free and runs locally.

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.

POSThttps://api.kit.forhosting.com/mech/pendulum-length

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.

curl -X POST https://api.kit.forhosting.com/mech/pendulum-length \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"period":2,"gravity":9.81}'
{
  "period": 2,
  "gravity": 9.81
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "mech.pendulum_length",
  "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.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

For small angles the period depends only on length and gravity: T equals two pi times the square root of L over g.

How simple-pendulum length follows from the period formula

The calculator evaluates the closed form in deterministic floating-point arithmetic: no random seeds, no wall-clock timestamps, no network calls, and no model drift, so identical inputs always produce identical JSON.

What you send and what you get back

Missing fields, non-numeric strings, NaN, Infinity, non-positive period, and non-positive gravity fail with invalid_input and are not charged. On success the response echoes cleaned period and gravity, provides length as the primary SI result in metres, exposes t_over_2pi as T divided by two pi, four_pi_sq as four pi squared, and t_squared as T squared so you can verify either algebraic form by hand, includes a units hint object naming seconds, metres per second squared, and metres, sets method to simple_pendulum_length_from_period, formula to L equals g times open parenthesis T over two pi close parenthesis squared, and approximation to small_angle for honest scope. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.

Where pendulum length calculators show up in real work

Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Read the full KIT documentation →