Kepler's Third Law Calculator
Kepler's third law calculator in the harmonic ratio form — no mass, no G. Solve orbital period from distance, or distance from period, in AU and years.
Kepler's Third Law Calculator
Background.
This calculator applies Kepler's third law in its original harmonic form: the square of an orbital period is proportional to the cube of the semi-major axis, T² ∝ a³. Give it one orbit you already know around some central body — Earth's, by default — and it will convert any second orbit around that same body between period and distance, in either direction. It needs no mass, no gravitational constant, and no SI conversion at all, because the constant of proportionality is supplied entirely by your reference orbit.
That mass-free framing is deliberate, and it is what separates this page from the Orbital Period calculator elsewhere in this category. The Orbital Period page implements Newton's generalisation, T = 2π√(a³/G(M+m)), which requires the central mass in kilograms and works in metres and seconds. Kepler published the harmonic law in 1619, sixty-eight years before Newton explained why it holds; the law itself never mentions mass. If you know the central mass and want SI units, use Orbital Period. If you know one orbit and want another — which is the ordinary classroom and observing case — this is the faster and more accurate route, because a ratio between two orbits cancels most of the uncertainty that a mass-based calculation carries.
Units are declared and fixed. Distances are astronomical units, where 1 AU = 149 597 870 700 m exactly by the IAU's 2012 definition. Periods are Julian years of exactly 365.25 days, or 31 557 600 seconds. The Kepler constant k = T²/a³ therefore has units of yr² AU⁻³ and takes the value 1 for an idealised massless body orbiting the Sun. The calculator reports k explicitly so you can see at a glance whether your reference orbit really is heliocentric: enter Jupiter's moons or a binary star and k will not be 1, and the note beside the results will say so.
The results also carry an important warning that belongs beside the number rather than buried in an FAQ. The harmonic law is exact only when both orbiting bodies are negligible in mass next to the central one. The full Newtonian relation is T² = 4π²a³/G(M+m), so a ratio between two orbits leaves behind a factor of √((M+m_reference)/(M+m_target)). For Mars, whose mass is about 3 × 10⁻⁷ of the Sun's, that factor is invisible. For Jupiter, whose mass is about 1/1048 of the Sun's, it is not: feeding Jupiter's 11.862615-year period into this calculator against an Earth reference returns a semi-major axis of 5.201354 AU, whereas JPL's fitted value is 5.202887 AU. The 0.029 % shortfall is not an arithmetic error — it is precisely the mass term the harmonic law omits, and multiplying by (1 + m/M)^(1/3) = 1.000318 recovers 5.203009 AU. Wherever the two orbiting bodies have comparable masses, as in a binary star, the harmonic form should not be used at all.
A second output makes the same physics work for you. Because a reference orbit fixes k, it also fixes the central mass: M = 4π²a³/(GT²). The calculator reports that implied mass both in kilograms and as a multiple of the solar mass. The solar-mass ratio is the more trustworthy of the two, since the gravitational constant cancels out of it entirely and G is the least precisely known constant in physics at 22 parts per million. This is, in outline, how astronomers weigh stars they will never visit: observe a companion's period and separation, and the central mass follows.
Every figure quoted on this page comes from JPL's Solar System Dynamics tables and NIST's CODATA 2022 adjustment, both retrieved in July 2026, and every number in the worked example below is the calculator's own output rather than a remembered value.
What is kepler's third law calculator?
Kepler's third law — the harmonic law, or law of harmonies — states that for every body orbiting the same central mass, the square of the orbital period divided by the cube of the semi-major axis is the same number. Kepler announced it on 15 May 1618 and published it in Harmonices Mundi in 1619, deriving it purely from Tycho Brahe's observational record with no theory of gravity behind it.
Written as a ratio between two orbits it becomes T₁²/T₂² = a₁³/a₂³, which is the form implemented here. Written with a single constant it becomes T² = k·a³, where k depends only on the central body. Choosing astronomical units and Julian years makes k equal to 1 for the solar system, which is why introductory astronomy quotes the law as simply T² = a³ — that is not a different law, it is the same law in a unit system chosen to hide the constant.
The semi-major axis a is half the long axis of the ellipse, equal to the average of the closest and farthest distances from the focus. It is not the same as the instantaneous distance, and the law is indifferent to eccentricity: a circular orbit and a violently elongated cometary orbit with the same semi-major axis have exactly the same period. The period T here is the sidereal period, measured against the fixed stars, not the synodic period seen from a moving Earth.
How to use this calculator.
- Choose whether you are solving for the orbital period or for the semi-major axis.
- Enter the reference orbit — a body whose period and distance you already know, orbiting the SAME central object. Earth's values are pre-filled.
- Enter the one quantity you do know about the target orbit: its semi-major axis in AU, or its period in Julian years.
- Read the answer in years and days, or in AU and kilometres.
- Check the reported Kepler constant k. A value near 1 yr² AU⁻³ confirms a heliocentric system; anything else means your reference orbit is around a different body.
- Read the implied central mass if you want the reference orbit's other payoff — this is how a star or planet gets weighed from an orbit.
- Read the regime note before trusting the last digits: if the target body's mass is more than about a thousandth of the central mass, apply the (1 + m/M)^(1/3) correction described below.
The formula.
The calculator does two things. First it forms the Kepler constant from your reference orbit, k = T_ref²/a_ref³, in units of yr² AU⁻³. With Earth's values of a_ref = 1.00000261 AU and T_ref = 1.0000174 yr this gives k = 1.0000269701, close to but not exactly the textbook 1 — the difference is real, and it exists because the 'Earth' orbit tabulated by JPL is the orbit of the Earth–Moon barycentre and its period is set by GM_Sun plus GM_Earth plus GM_Moon, not GM_Sun alone.
Then it inverts whichever relation you asked for. Solving for the period gives T = √(k·a³); solving for the distance gives a = (T²/k)^(1/3). Both are exact algebraic inversions of one another, so feeding an answer back in returns the original input — a property the test suite checks explicitly with Saturn's orbit.
ROUNDING STAGE. Nothing is rounded part-way through. All arithmetic runs at 40 significant digits in a dedicated high-precision decimal context, and rounding happens once, at the moment a result is returned: 10 decimal places for periods, axes and k, and 12 significant digits for kilometres and masses, because those span many orders of magnitude and a fixed decimal place would flatten a small orbit to zero. If you compare a day figure against a year figure you may see a difference in the eleventh digit; that is the display rounding, not the computation.
SIGNIFICANT FIGURES. The inputs govern the output. JPL's semi-major axes are given to nine significant figures and its tabulated periods to eight, so results are meaningful to roughly seven or eight figures at best, and to fewer than that whenever the target body's mass is not negligible. Quoting the tenth decimal place of an answer is display precision, not accuracy.
INVALID DOMAIN. Every input must be strictly positive. A zero reference semi-major axis makes k = T²/a³ divide by zero; a zero reference period makes k = 0, and the inverse solve (T²/k)^(1/3) then has no answer. A negative or zero target value describes an unbound parabolic or hyperbolic trajectory, which has no period at all. In each case the calculator raises a labelled error against the offending field rather than returning NaN or infinity.
APPROXIMATION REGIME. Two-body Newtonian gravity, both orbiting bodies negligible next to the central one, no perturbations from other planets, no general-relativistic correction. Mercury's perihelion precesses by 43 arcseconds per century for relativistic reasons, but its period is unaffected at this precision. The regime that genuinely fails is comparable masses: for a binary star, the harmonic ratio form is simply the wrong tool, and the Newtonian form with the total mass must be used instead.
A worked example.
How long is a year on Mars? Take Earth as the reference orbit: JPL gives its semi-major axis as 1.00000261 AU and its sidereal period as 1.0000174 years. The Kepler constant is therefore k = 1.0000174² ⁄ 1.00000261³ = 1.0000269701 yr² AU⁻³. Mars's semi-major axis is 1.52371034 AU, whose cube is 3.53752… AU³. Multiply by k and take the square root: T = √(1.0000269701 × 1.52371034³) = 1.8808730272 years. Converted at the exact Julian year of 365.25 days, that is 686.9888731884 days, and Mars's mean distance is 227 943 822.428 km. Now check it against a source that never used this law. JPL's Planetary Physical Parameters table lists Mars's sidereal orbital period as 1.8808476 years, or 686.9795859 days, from a numerical fit to the DE440 ephemeris. The harmonic law overshoots by 0.0093 days — about thirteen minutes over a Martian year, a relative error of 1.35 × 10⁻⁵. That residual is exactly what the theory predicts it should be: the ratio form drops the mass term, and Earth and Mars are not equally massive. The same reference orbit also weighs the Sun. M = 4π²a³/(GT²) with a = 1.00000261 AU and T = 1.0000174 yr gives 1.98843135 × 10³⁰ kg, or 1.0000108 solar masses on JPL's own GM_Sun. The 11-part-per-million excess is the Earth–Moon system's own mass showing up in the answer, precisely as the physics requires.
Frequently asked questions.
How is this different from the Orbital Period calculator?
Why is the Kepler constant 1.0000269701 and not exactly 1?
Does the law work for elliptical orbits, or only circles?
Can I use it for moons of Jupiter or satellites of Earth?
Where exactly does the harmonic law break down?
Which year and which AU does the calculator use?
What is the sidereal period, and is that what I get?
How does this weigh a star?
Why does the calculator refuse a zero or negative input?
Do relativity or planetary perturbations change the answer?
References& sources.
- [1]Kepler, J. (1619). Harmonices Mundi, Liber V, Caput III — the original statement of the harmonic law. Print/bibliographic reference; no authoritative free full-text URL is offered here rather than linking a scan of uncertain provenance.
- [2]Newton, I. (1687). Philosophiae Naturalis Principia Mathematica, Book I, Proposition XV and Book III, Proposition IV — the generalisation that introduces the mass term this page deliberately omits. Print/bibliographic reference.
- [3]NASA JPL Solar System Dynamics, 'Approximate Positions of the Planets' (Standish & Williams), Table 1: Keplerian elements and rates referred to the mean ecliptic and equinox of J2000, valid 1800–2050. Source of every semi-major axis and eccentricity used on this page. Independent, open access. Retrieved 2026-07-29.
- [4]NASA JPL Solar System Dynamics, 'Planetary Physical Parameters', main planetary table, column 'Sidereal Orbital Period (y)'. Source of the independently fitted periods used to check the worked example (Mars 1.8808476 y; Jupiter 11.862615 y). Independent, open access. Retrieved 2026-07-29.
- [5]NASA JPL Solar System Dynamics, 'Astrodynamic Constants': astronomical unit 149 597 870 700 m (IAU 2012), heliocentric gravitational constant GM_Sun = 1.327 124 400 412 794 19 × 10²⁰ m³ s⁻² from ephemeris DE440 (Park et al. 2021). Independent, open access. Retrieved 2026-07-29.
- [6]NIST, CODATA 2022 recommended value of the Newtonian constant of gravitation: G = 6.674 30(15) × 10⁻¹¹ m³ kg⁻¹ s⁻², relative standard uncertainty 2.2 × 10⁻⁵. Independent, open access. Retrieved 2026-07-29.
- [7]NASA Science, 'Mars Facts' (page editor Stephen Carney, updated 10 July 2026): 'A year on Mars lasts 669.6 sols, which is the same as 687 Earth days.' Used only as an editorial sanity check on the worked example, not as a numerical source. Independent, open access. Retrieved 2026-07-29.
In this category
Embed
Quanta Pro
Paid features are coming later.
- All 682 calculators remain free
- No billing is enabled