The Sun is the star at the center of the Solar System. The Earth and other matter (including other planets, asteroids, meteoroids, comets and dust) orbit the Sun, which by itself accounts for more than 99% of the solar system's mass. Energy from the Sun—in the form of insolation from sunlight—supports almost all life on Earth via photosynthesis, and drives the Earth's climate and weather.
About 74% of the Sun's mass is hydrogen, 25% is helium, and the rest is made up of trace quantities of heavier elements. The Sun has a spectral class of G2V. "G2" means that it has a surface temperature of approximately 5,500 K, giving it a white color, which, because of atmospheric scattering, appears yellow. Its spectrum contains lines of ionized and neutral metals as well as very weak hydrogen lines. The "V" suffix indicates that the Sun, like most stars, is a main sequence star. This means that it generates its energy by nuclear fusion of hydrogen nuclei into helium and is in a state of hydrostatic balance, neither contracting nor expanding over time. There are more than 100 million G2 class stars in our galaxy. Because of logarithmic size distribution, the Sun is actually brighter than 85% of the stars in the Galaxy, most of which are red dwarfs.
The Sun orbits the center of the Milky Way galaxy at a distance of approximately 25,000 to 28,000 light-years from the galactic center, completing one revolution in about 225–250 million years. The orbital speed is 217 km/s, equivalent to one light-year every 1,400 years, and one AU every 8 days.
The Sun is a third generation star, whose formation may have been triggered by shockwaves from a nearby supernova. This is suggested by a high abundance of heavy elements such as gold and uranium in the solar system; these elements could most plausibly have been produced by endergonic nuclear reactions during a supernova, or by transmutation via neutron absorption inside a massive second-generation star.
Sunlight is the main source of energy near the surface of Earth. The solar constant is the amount of power that the Sun deposits per unit area that is directly exposed to sunlight. The solar constant is equal to approximately 1,370 watts per square meter of area at a distance of one AU from the Sun (that is, on or near Earth). Sunlight on the surface of Earth is attenuated by the Earth's atmosphere so that less power arrives at the surface—closer to 1,000 watts per directly exposed square meter in clear conditions when the Sun is near the zenith. This energy can be harnessed via a variety of natural and synthetic processes—photosynthesis by plants captures the energy of sunlight and converts it to chemical form (oxygen and reduced carbon compounds), while direct heating or electrical conversion by solar cells are used by solar power equipment to generate electricity or to do other useful work. The energy stored in petroleum and other fossil fuels was originally converted from sunlight by photosynthesis in the distant past.