Skip to content

units.astro

astronomy units like light-years, parsecs and solar masses

Units for astronomy, from the astronomical unit and light-year to the parsec, and the mass of the Earth, Jupiter and the Sun.

kind units
length au; ly, lightyear, lightyears; pc, parsec, parsecs; light_second, light_seconds; light_minute, light_minutes; light_hour, light_hours
mass earth_mass, earth_masses; jupiter_mass, jupiter_masses; solar_mass, solar_masses
time yr_julian; yr_tropical
energy foe, foes
power solar_luminosity
1
# a light-year in astronomical units
2
1 ly to au63241.1 au
3
# the Sun in Earth masses
4
1 solar_mass to earth_mass332954 earth_mass
5
# light from the Sun
6
1 au / 1 light_second499.005
Example outputCtrl+Enter to run

Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.