31 trillion kilometers!
A parsec is a unit of distance used in astronomy, equal to about 3.26 light-years, or 30.9 trillion kilometers. A light-year is the distance light travels in one year. The parsec is defined by an angle: it is the distance from which the gap between Earth and the Sun would look one arcsecond wide, where an arcsecond is 1/3,600 of a degree.
The International Astronomical Union (IAU), which sets the units astronomers use, defines the parsec through the astronomical unit (au). One au is exactly 149,597,870,700 meters, about 150 million kilometers, and is close to the average distance from Earth to the Sun. A parsec is the distance at which 1 au appears to span an angle of one arcsecond.
An arcsecond is a very small angle. A degree is divided into 60 arcminutes, and each arcminute into 60 arcseconds. A basketball about 50 kilometers (31 miles) away would look about one arcsecond wide.
From this definition, a parsec is exactly 648,000 divided by pi astronomical units. That is about 206,265 au.
The parsec comes from the way astronomers measure distances to nearby stars. As Earth travels around the Sun, a nearby star seems to shift slightly against more distant stars behind it. A finger held in front of the face does the same when it is viewed with one eye and then the other. This apparent shift is called parallax.
Astronomers measure a star's position, then measure it again six months later, when Earth is on the other side of its orbit. A star's distance in parsecs is 1 divided by its parallax angle in arcseconds, so a star with a parallax of half an arcsecond is 2 parsecs away. Even the nearest star shows a parallax of less than one arcsecond.
Such small angles are hard to measure. Earth's atmosphere blurs starlight, so telescopes on the ground struggle with parallaxes smaller than about 0.01 arcsecond, which limits them to stars within about 100 parsecs. Telescopes in space do much better. The third data release of the European Space Agency's Gaia mission, released in 2022, includes parallaxes for about 1.46 billion objects.
Because distance in parsecs follows so directly from parallax, many astronomers prefer to measure distances in parsecs. The IAU notes that the parsec is the usual unit for studying the structure of the Milky Way, and that the light-year appears mostly in popular writing.
For larger distances, astronomers add the same prefixes used with meters. A kiloparsec is 1,000 parsecs, a megaparsec is a million and a gigaparsec is a billion. The Andromeda Galaxy, about 2.5 million light-years from Earth, is about 0.77 megaparsecs away.