Space · Orbits

Orbital period calculator.

Enter the average orbital distance and the star mass to get the length of the year.

Kepler's third lawAU, km or milesChecked 8 October 2026

Advertisement

Inputs

Use 1 for the Sun. A star twice as massive as the Sun is 2.

Orbital period

Enter a semi-major axis.

Kepler's third law in practice

Kepler's third law says the square of an orbital period is proportional to the cube of the semi-major axis. In solar units it reduces to P² = a³ / M, with P in years, a in AU and M in solar masses. The tool uses the exact form P = 2π √(a³ / GM) with the Sun's GM of 1.327124 x 10²⁰ m³/s² from NASA JPL, scaled by the star mass you enter.

Worked example. Jupiter's mean distance from the Sun is 778.5 million km (5.204 AU). The tool gives 4,336 days, or 11.87 years. NASA's Jupiter fact sheet lists a sidereal orbit period of 4,332.6 days, so the gap is about 3.5 days. About 2.1 of those come from ignoring Jupiter's own mass (0.0954 percent of the Sun's mass changes the period by about 0.048 percent); the rest is rounding in the distance and pull from other planets. For Earth, 1 AU returns 365.26 days.

The law assumes the orbiting body is much lighter than the star, so it suits planets, asteroids and comets. For two stars of similar mass, add both masses.

Frequently asked questions

How long is a year on a planet 4 AU from the Sun?

P = √(4³) = 8 years, since 4³ = 64 and √64 = 8.

What is the semi-major axis?

Half the longest width of an elliptical orbit. For a near-circular orbit it is simply the orbit radius.

Does eccentricity change the period?

No. For a given semi-major axis and central mass the period is the same however elongated the ellipse is.

Can I use it for moons around a planet?

Yes. Enter the planet’s mass as a fraction of the Sun’s in the star-mass box. From NASA’s masses, Jupiter is about 0.00095 Suns. The moon’s own mass is neglected.

Sources

Checked

Runs entirely in your browser. Nothing you type is sent or stored.

Scope

Two-body approximation with the orbiting mass neglected. Real orbits are perturbed by other bodies.

Advertisement
Advertisement