Calculate Mass of the Sun Using Kepler’s Third Law


Mass of the Sun Calculator (via Kepler’s Third Law)

An advanced tool to calculate the mass of the sun using Kepler’s third law based on an orbiting body’s parameters.


The time it takes for the smaller body to complete one orbit around the central body.


The average distance between the orbiting body and the central body. Default is 1 AU, the Earth-Sun distance.


Calculated Mass of the Sun (M):
1.989 × 1030 kg

Intermediate Values & Constants:

The formula used is M ≈ (4π²a³) / (Gp²), where the mass of the orbiting body is considered negligible.

Dynamic Chart: Orbital Period vs. Semi-Major Axis

A visual representation of Kepler’s Third Law (p² ∝ a³). The chart updates as you change the input values.

What is Kepler’s Third Law?

Kepler’s Third Law of Planetary Motion describes the relationship between the orbital period of a planet and its average distance from the star it orbits. The law states that the square of the orbital period (p²) is directly proportional to the cube of the semi-major axis (a³) of its orbit. This fundamental principle, derived by Johannes Kepler in the early 17th century, allows us to understand the scale of our solar system. When combined with Newton’s Law of Universal Gravitation, it becomes a powerful tool to calculate the mass of the sun using Kepler’s third law or any other central star in a system.

This calculator is designed for students, astronomers, and science enthusiasts who want a practical tool to explore this concept. By inputting the orbital data of a known planet or satellite, one can derive the mass of the central body it orbits, demonstrating a cornerstone of celestial mechanics. For our solar system, using the data for any planet (like Earth, Mars, or Jupiter) will yield a consistent value for the Sun’s mass, showcasing the law’s predictive power.

The Formula to Calculate the Mass of the Sun

Isaac Newton later refined Kepler’s empirical law, providing a physical explanation grounded in gravity. The generalized version of the formula is:

p² = (4π² / G(M + m)) × a³

However, because the mass of the Sun (M) is so much greater than the mass of an orbiting planet (m), we can simplify the equation by assuming (M + m) ≈ M. This leads to the version used in our calculator to calculate the mass of the sun using Kepler’s third law:

M ≈ (4π²a³) / (Gp²)

Variables Explained

Variable Meaning Unit (SI) Typical Range (for Solar System)
M Mass of the central body (the Sun) kilograms (kg) ~2 x 1030 kg
a Semi-major axis of the orbit meters (m) 5.8 x 1010 m (Mercury) to 4.5 x 1012 m (Neptune)
p Orbital period of the planet seconds (s) 7.6 x 106 s (Mercury) to 5.2 x 109 s (Neptune)
G Universal Gravitational Constant m³ kg⁻¹ s⁻² 6.67430 x 10-11
π Pi unitless ~3.14159

Practical Examples

Example 1: Using Earth’s Orbital Data

Let’s use Earth’s well-known orbital parameters to calculate the Sun’s mass.

  • Inputs:
    • Orbital Period (p): 1 Earth Year (approximately 365.25 days)
    • Semi-Major Axis (a): 1 Astronomical Unit (AU) (approximately 149.6 million km)
  • Calculation:
    1. Convert period to seconds: 1 year ≈ 3.156 x 107 s
    2. Convert semi-major axis to meters: 1 AU ≈ 1.496 x 1011 m
    3. Apply the formula: M ≈ (4 × π² × (1.496e11)³) / (6.674e-11 × (3.156e7)²)
  • Result: The calculated mass is approximately 1.989 x 1030 kg.

Example 2: Using Mars’ Orbital Data

To prove the law’s consistency, let’s try with Mars. For more details, you might consult a planetary data sheet.

  • Inputs:
    • Orbital Period (p): 1.88 Earth Years
    • Semi-Major Axis (a): 1.524 AU
  • Calculation:
    1. Convert period to seconds: 1.88 years ≈ 5.935 x 107 s
    2. Convert semi-major axis to meters: 1.524 AU ≈ 2.279 x 1011 m
    3. Apply the formula: M ≈ (4 × π² × (2.279e11)³) / (6.674e-11 × (5.935e7)²)
  • Result: The result remains approximately 1.99 x 1030 kg, demonstrating how any planet’s orbit in a system can be used.

How to Use This Kepler’s Third Law Calculator

Using this calculator is a straightforward process for anyone wanting to apply Kepler’s law.

  1. Enter Orbital Period: Input the time it takes for the planet or body to orbit the Sun into the “Orbital Period” field. You can use our orbital period calculator for help.
  2. Select Period Units: Choose the appropriate unit for your period value from the dropdown menu (e.g., Earth Days or Earth Years). The calculator handles the conversion automatically.
  3. Enter Semi-Major Axis: Input the average distance from the planet to the Sun.
  4. Select Distance Units: Choose the correct unit for your distance value (e.g., million km or Astronomical Units).
  5. Review the Results: The calculator will instantly update, showing the calculated mass of the Sun in kilograms. It also displays the intermediate values (period in seconds, distance in meters) used in the calculation, providing transparency. This method to calculate the mass of the sun using Kepler’s third law is highly effective.

Key Factors That Affect the Calculation

While the formula is robust, several factors can influence the accuracy of the result when you calculate the mass of the sun using Kepler’s third law.

  • Precision of Input Data: The accuracy of the calculated mass is directly dependent on the precision of the orbital period and semi-major axis measurements. Small errors in these inputs can lead to significant variations.
  • The Gravitational Constant (G): G is one of the most challenging physical constants to measure. The value used here (6.67430 x 10⁻¹¹ m³ kg⁻¹ s⁻²) is the 2018 CODATA recommended value, but it has a degree of uncertainty.
  • Mass of the Orbiting Body (m): Our calculator uses a simplified formula that assumes the planet’s mass is negligible. For very large planets orbiting smaller stars, the full formula (including `m`) would be needed for higher precision. For the Sun and its planets, this approximation is excellent.
  • Ellipticity of the Orbit: Kepler’s law uses the semi-major axis, which is the average distance. Real orbits are elliptical, but the law elegantly accounts for this by relating the period to this average, not the instantaneous, distance.
  • Perturbations from Other Bodies: The gravitational pull from other planets in the solar system causes minor disturbances (perturbations) in a planet’s orbit. These are not accounted for in the basic formula but are important for high-precision celestial mechanics, often requiring tools like an n-body simulation.
  • Relativistic Effects: For objects in very strong gravitational fields or moving at very high velocities (like Mercury’s orbit), Einstein’s theory of General Relativity provides corrections to Newtonian gravity. For most calculations, these effects are tiny but not zero.

Frequently Asked Questions (FAQ)

1. Why can we ignore the planet’s mass in the calculation?
The Sun’s mass (≈2 x 10³⁰ kg) is over 330,000 times that of Earth. This makes the planet’s contribution to the total mass (M+m) so small that ignoring it introduces a negligible error for most purposes.
2. Can this calculator be used for other stars?
Yes, absolutely. If you know the orbital period and semi-major axis of an exoplanet orbiting another star, you can input those values to calculate that star’s mass.
3. What is an Astronomical Unit (AU)?
An Astronomical Unit is defined as the average distance between the Earth and the Sun. It’s a convenient unit for measuring distances within our solar system. 1 AU is approximately 149.6 million kilometers or 93 million miles.
4. Does the shape (eccentricity) of the orbit matter?
Not for the final calculation of mass. Kepler’s Third Law elegantly connects the period to the *semi-major axis*, which is a measure of the orbit’s size, regardless of its eccentricity (how elliptical it is). You can learn more with our escape velocity calculator.
5. Where does the value for G come from?
The gravitational constant, G, is determined through very sensitive laboratory experiments, famously first performed by Henry Cavendish in 1798 using a torsion balance to measure the tiny gravitational force between lead spheres.
6. Why is the method to calculate the mass of the sun using Kepler’s third law so important?
It was the first reliable method humanity developed to “weigh” a celestial object. It works for stars, planets (by observing their moons), and even black holes, forming a basis for much of astrophysics.
7. What if an orbit is perfectly circular?
A circle is a special case of an ellipse with an eccentricity of zero. In this case, the semi-major axis is simply the radius of the circle, and the law works perfectly.
8. How accurate is the default result?
The default values (1 AU and 1 Year) are the basis for the definition of these units and are very close to the true values. The resulting mass of ~1.989 x 10³⁰ kg is the accepted value for the Sun’s mass, often called one “Solar Mass”.

Related Tools and Internal Resources

Explore more concepts in celestial mechanics and physics with our other calculators and articles.

© 2026. All Rights Reserved. A tool for educational purposes.



Leave a Reply

Your email address will not be published. Required fields are marked *