Planetary mass is determined through orbital dynamics: a planet's mass is inferred from the gravitational perturbations it produces on its host star (radial velocity) or on transiting planet timing. For moons, orbital velocities of satellites yield the primary body's mass. Combining mass with radius (from transit photometry) enables determination of mean density, providing strong constraints on planetary composition and internal structure.
You already know from Kepler's third law that orbital period and semi-major axis are related to the total mass of a gravitationally bound system. Planetary mass determination is the art of inverting this relationship — using observed orbital motions to solve for the mass that produces them. The challenge is that planets are faint and small compared to their host stars, so we almost never weigh a planet directly. Instead, we measure the gravitational effects it produces on things we *can* observe.
The most common technique uses radial velocity measurements of the host star. As a planet orbits, the star responds with a reflex motion around the barycenter. The amplitude of the star's velocity wobble depends on the planet's mass, the orbital period, and the inclination of the orbit to our line of sight. From the Doppler data alone, you get M sin i — a minimum mass. If the planet also transits (meaning the orbit is nearly edge-on, so sin i ≈ 1), the inclination ambiguity vanishes and you recover the true mass. For systems with multiple transiting planets, transit timing variations offer an independent mass measurement: gravitational interactions between planets shift transit times by detectable amounts, and modeling those shifts reveals the masses involved without any spectroscopic data at all.
For bodies in our own solar system, mass determination is more direct. A planet's mass can be measured by tracking the orbit of a natural satellite — apply Kepler's third law to the moon's orbit and you solve for the planet's mass. Spacecraft flybys offer similar precision: the trajectory deflection of a probe passing near a planet is governed entirely by the planet's gravitational field, yielding mass to high accuracy. This is how we first obtained precise masses for Mercury and Pluto, which lack large natural satellites.
The real scientific payoff comes when you combine mass with radius. A transit gives you the planet's radius from the depth of the brightness dip; radial velocity or timing variations give you the mass. Dividing mass by volume yields mean density, and density is the single most powerful discriminator of composition. A density near 5.5 g/cm³ suggests a rocky, Earth-like interior. A density below 1.5 g/cm³ points to a thick hydrogen-helium envelope — a gas giant or sub-Neptune. Intermediate densities might indicate water-rich worlds or rocky cores with modest atmospheres. Without mass, a transit radius alone cannot distinguish a dense rocky super-Earth from a puffy mini-Neptune of the same size, which is why mass determination is the essential second measurement that turns a detected planet into a characterized world.