🌍 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

The orbiting body is assumed to be negligibly light beside the Sun. That is true of every planet, asteroid and comet — Jupiter, the heaviest, is under a thousandth of a solar mass — so the error stays in the fourth decimal.

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.