🌍 Orbital Period Calculator (Kepler's Third Law)
Enter a distance from the Sun in astronomical units (AU) to calculate the orbital period in years, using Kepler's Third Law (T² = a³ for solar orbits).
Kepler’s third law in its simplest form
For anything going round the Sun, the square of the period equals the cube of the semi-major axis, provided you measure period in years and distance in astronomical units:
T² = a³ so T = a^1.5
T in years, a in AU (1 AU = the Earth–Sun distance)
Earth is the calibration point: a = 1 gives T = 1. Mars at 1.524 AU returns 1.8814 years, or 687 days. Jupiter at 5.204 AU gives 11.87 years, Neptune at 30.07 AU gives 164.89 years, and Mercury at 0.387 AU comes back as 0.2408 years — 87.9 days. Years are converted to days at 365.25 days each, and results print to six significant figures.
What to feed it
- Use the semi-major axis, not today’s distance. For a near-circular orbit they are much the same; for Halley’s Comet, which swings from 0.59 AU to 35 AU, only the semi-major axis of 17.8 AU gives the right answer of 75.1 years.
- The Sun is baked in. The full law is T² = 4π²a³ ÷ GM, and the tidy T² = a³ version only holds because M is one solar mass. A moon of Jupiter or a satellite of Earth needs the full equation with its own central mass.
- Eccentricity does not matter. Two objects sharing a semi-major axis share a period, however differently shaped their orbits.
Frequently asked questions
How long is a year on Mars?
687 days. Mars sits at 1.524 AU, and 1.524^1.5 is 1.8814 Earth years.
What distance gives a two-year orbit?
Work the law backwards: a = T^(2/3), so a two-year period needs 1.587 AU. That is just outside Mars and well inside the asteroid belt.
Does this work for moons and satellites?
Not as written. The T² = a³ shortcut is fixed to the Sun’s mass. For a moon of Jupiter or a spacecraft round the Earth you need T = 2π√(a³ ÷ GM) with that body’s mass in place of the Sun’s.