In astronomy, metallicity is the abundance of elements present in an object that are heavier than hydrogen and helium. Most of the normal physical matter in the Universe is either hydrogen or helium, and astronomers use the word "metals" as a convenient short term for "all elements except hydrogen and helium". This word-use is distinct from the conventional chemical or physical definition of a metal as an electrically conducting solid. Stars and nebulae with relatively high abundances of carbon, nitrogen, oxygen, and neon are called "metal-rich" in astrophysical terms, even though all of those elements are non-metals in chemistry.
The presence of heavier elements hails from stellar nucleosynthesis, the theory that the majority of elements heavier than hydrogen and helium in the Universe (metals, hereafter) are formed in the cores of stars as they evolve. Over time, stellar winds and supernovae deposit the metals into the surrounding environment, enriching the interstellar medium and providing recycling materials for the birth of new stars. It follows that older generations of stars, which formed in the metal-poor early Universe, generally have lower metallicities than those of younger generations, which formed in a more metal-rich Universe.
Observed changes in the chemical abundances of different types of stars, based on the spectral peculiarities that were later attributed to metallicity, led astronomer Walter Baade in 1944 to propose the existence of two different populations of stars.  These became commonly known as Population I (metal-rich) and Population II (metal-poor) stars. A third stellar population was introduced in 1978, known as Population III stars.    These extremely metal-poor stars were theorized to have been the "first-born" stars created in the Universe.
Astronomers use several different methods to describe and approximate metal abundances, depending on the available tools and the object of interest. Some methods include determining the fraction of mass that is attributed to gas versus metals, or measuring the ratios of the number of atoms of two different elements as compared to the ratios found in the Sun.
Stellar composition is often simply defined by the parameters X, Y and Z. Here X is the mass fraction of hydrogen, Y is the mass fraction of helium, and Z is the mass fraction of all the remaining chemical elements. Thus
In most stars, nebulae, H II regions, and other astronomical sources, hydrogen and helium are the two dominant elements. The hydrogen mass fraction is generally expressed as , where is the total mass of the system, and is the mass of the hydrogen it contains. Similarly, the helium mass fraction is denoted as . The remainder of the elements are collectively referred to as "metals", and the metallicity—the mass fraction of elements heavier than helium—can be calculated as
|Hydrogen mass fraction|
|Helium mass fraction|
Due to the effects of stellar evolution, neither the initial composition nor the present day bulk composition of the Sun is the same as its present-day surface composition.
The overall stellar metallicity is conventionally defined using the total iron content of the star, being the easy element to measure with spectral observations in the visible spectrum (even though oxygen is the most abundant heavy element – see metallicities in HII regions below). The abundance ratio is the common logarithm of the ratio of a star's iron abundance compared to that of the Sun and is calculated thus: 
where and are the number of iron and hydrogen atoms per unit of volume respectively. The unit often used for metallicity is the dex, contraction of "decimal exponent". By this formulation, stars with a higher metallicity than the Sun have a positive common logarithm, whereas those more dominated by hydrogen have a corresponding negative value. For example, stars with a [Fe/H] value of +1 have 10 times the metallicity of the Sun (101); conversely, those with a [Fe/H] value of −1 have 1⁄10, while those with a [Fe/H] value of 0 have the same metallicity as the Sun, and so on.  Young Population I stars have significantly higher iron-to-hydrogen ratios than older Population II stars. Primordial Population III stars are estimated to have metallicity less than −6, a millionth of the abundance of iron in the Sun.   The same notation is used to express variations in abundances between other individual elements as compared to solar proportions. For example, the notation "[O/Fe]" represents the difference in the logarithm of the star's oxygen abundance versus its iron content compared to that of the Sun. In general, a given stellar nucleosynthetic process alters the proportions of only a few elements or isotopes, so a star or gas sample with certain [/Fe] values may well be indicative of an associated, studied nuclear process.
Astronomers can estimate metallicities through measured and calibrated systems that correlate photometric measurements and spectroscopic measurements (see also Spectrophotometry). For example, the Johnson UVB filters can be used to detect an ultraviolet (UV) excess in stars,  where a smaller UV excess indicates a larger presence of metals that absorb the UV radiation, thereby making the star appear "redder".    The UV excess, δ(U−B), is defined as the difference between a star's U and B band magnitudes, compared to the difference between U and B band magnitudes of metal-rich stars in the Hyades cluster.  Unfortunately, δ(U−B) is sensitive to both metallicity and temperature: if two stars are equally metal-rich, but one is cooler than the other, they will likely have different δ(U−B) values  (see also Blanketing effect  ). To help mitigate this degeneracy, a star's B−V color can be used as an indicator for temperature. Furthermore, the UV excess and B−V color can be corrected to relate the δ(U−B) value to iron abundances.   
Other photometric systems that can be used to determine metallicities of certain astrophysical objects include the Strӧmgren system,   the Geneva system,   the Washington system,   and the DDO system.  
At a given mass and age, a metal-poor star will be slightly warmer. Population II stars' metallicities are roughly 1/1000 to 1/10 of the Sun's ([Z/H] = −3.0 to −1.0), but the group appears cooler than Population I overall, as heavy Population II stars have long since died. Above 40 solar masses, metallicity influences how a star will die: outside the pair-instability window, lower metallicity stars will collapse directly to a black hole, while higher metallicity stars undergo a Type Ib/c supernova and may leave a neutron star.
A star's metallicity measurement is one parameter that helps determine whether a star has planets and the type of planets, as there is a direct correlation between metallicity and the type of planets a star may have. Measurements have demonstrated the connection between a star's metallicity and gas giant planets, like Jupiter and Saturn. The more metals in a star and thus its planetary system and proplyd, the more likely the system may have gas giant planets and rocky planets. Current models show that the metallicity along with the correct planetary system temperature and distance from the star are key to planet and planetesimal formation. For two stars that have equal age and mass but different metallicity, the less metallic star is bluer. Among stars of the same color, less metallic stars emit more ultraviolet radiation. The Sun, with 8 planets and 5 known dwarf planets, is used as the reference, with a [Fe/H] of 0.00.     
Young, massive and hot stars (typically of spectral types O and B) in H II regions emit UV photons that ionize ground-state hydrogen atoms, knocking electrons and protons free; this process is known as photoionization. The free electrons can strike other atoms nearby, exciting bound metallic electrons into a metastable state, which eventually decay back into a ground state, emitting photons with energies that correspond to forbidden lines. Through these transitions, astronomers have developed several observational methods to estimate metal abundances in HII regions, where the stronger the forbidden lines in spectroscopic observations, the higher the metallicity.   These methods are dependent on one or more of the following: the variety of asymmetrical densities inside HII regions, the varied temperatures of the embedded stars, and/or the electron density within the ionized region.    
Theoretically, to determine the total abundance of a single element in an HII region, all transition lines should be observed and summed. However, this can be observationally difficult due to variation in line strength.   Some of the most common forbidden lines used to determine metal abundances in HII regions are from oxygen (e.g. [O II] λ = (3727, 7318, 7324) Å, and [O III] λ = (4363, 4959, 5007) Å), nitrogen (e.g. [NII] λ = (5755, 6548, 6584) Å), and sulfur (e.g. [SII] λ = (6717,6731) Å and [SIII] λ = (6312, 9069, 9531) Å) in the optical spectrum, and the [OIII] λ = (52, 88) μm and [NIII] λ = 57 μm lines in the infrared spectrum. Oxygen has some of the stronger, more abundant lines in HII regions, making it a main target for metallicity estimates within these objects. To calculate metal abundances in HII regions using oxygen flux measurements, astronomers often use the R23 method, in which
where is the sum of the fluxes from oxygen emission lines measured at the rest frame λ = (3727, 4959 and 5007) Å wavelengths, divided by the flux from the Hβ emission line at the rest frame λ = 4861 Å wavelength.  This ratio is well defined through models and observational studies,    but caution should be taken, as the ratio is often degenerate, providing both a low and high metallicity solution, which can be broken with additional line measurements.  Similarly, other strong forbidden line ratios can be used, e.g. for sulfur, where 
- Abundance of the chemical elements
- Cosmos Redshift 7, a galaxy that reportedly contains Population III stars
- Frozen star (hypothetical star)
- Galaxy formation and evolution
- GRB 090423, the most distant seen, presumably from a low-metallicity progenitor
- Metallicity distribution function
- Stellar classification
- Stellar evolution
- Stellar population
- Baade, Walter (1944). "The Resolution of Messier 32, NGC 205, and the central region of the Andromeda Nebula". Astrophysical Journal. 100: 121–146. Bibcode: 1944ApJ...100..137B. doi: 10.1086/144650.
- Rees, M.J. (1978). "Origin of pregalactic microwave background". Nature. 275 (5675): 35–37. Bibcode: 1978Natur.275...35R. doi: 10.1038/275035a0. S2CID 121250998.
- White, S.D.M.; Rees, M.J. (1978). "Core condensation in heavy halos - A two-stage theory for galaxy formation and clustering". Monthly Notices of the Royal Astronomical Society. 183 (3): 341–358. Bibcode: 1978MNRAS.183..341W. doi: 10.1093/mnras/183.3.341.
- J. L. Puget; J. Heyvaerts (1980). "Population III stars and the shape of the cosmological black body radiation". Astronomy and Astrophysics. 83 (3): L10–L12. Bibcode: 1980A&A....83L..10P.
- Asplund, Martin; Grevesse, Nicolas; Sauval, A. Jacques; Scott, Pat (2009). "The Chemical Composition of the Sun". Annual Review of Astronomy & Astrophysics. 47 (1): 481–522. arXiv: 0909.0948. Bibcode: 2009ARA&A..47..481A. doi: 10.1146/annurev.astro.46.060407.145222. S2CID 17921922.
- Matteucci, Francesca (2001). The Chemical Evolution of the Galaxy. Astrophysics and Space Science Library. 253. Springer Science & Business Media. p. 7. ISBN 978-0792365525.
- John C. Martin. "What we learn from a star's metal content". New Analysis RR Lyrae Kinematics in the Solar Neighborhood. Archived from the original on June 29, 2016. Retrieved September 7, 2005.
- Sobral, David; Matthee, Jorryt; Darvish, Behnam; Schaerer, Daniel; Mobasher, Bahram; Röttgering, Huub J. A.; Santos, Sérgio; Hemmati, Shoubaneh (4 June 2015). "Evidence for Pop III-like stellar populations in the most luminous Lyman-α emitters at the epoch of re-ionisation: Spectroscopic confirmation". The Astrophysical Journal. 808 (2): 139. arXiv: 1504.01734. Bibcode: 2015ApJ...808..139S. doi: 10.1088/0004-637x/808/2/139. S2CID 18471887.
- Overbye, Dennis (17 June 2015). "Astronomers report finding earliest stars that enriched the cosmos". New York Times. Retrieved 17 June 2015.
- Johnson, H. L.; Morgan, W. W. (May 1953). "Fundamental stellar photometry for standards of spectral type on the revised system of the Yerkes spectral atlas". The Astrophysical Journal. 117: 313. Bibcode: 1953ApJ...117..313J. doi: 10.1086/145697. ISSN 0004-637X.
- Roman, Nancy G. (December 1955). "A Catalogue of High-Velocity Stars". The Astrophysical Journal Supplement Series. 2: 195. Bibcode: 1955ApJS....2..195R. doi: 10.1086/190021. ISSN 0067-0049.
- Sandage, A. R.; Eggen, O. J. (1959-06-01). "On the Existence of Subdwarfs in the (MBol, log Te)-Diagram". Monthly Notices of the Royal Astronomical Society. 119 (3): 278–296. Bibcode: 1959MNRAS.119..278S. doi: 10.1093/mnras/119.3.278. ISSN 0035-8711.
- Wallerstein, George; Carlson, Maurice (September 1960). "Letter to the Editor: on the Ultraviolet Excess in G Dwarfs". The Astrophysical Journal. 132: 276. Bibcode: 1960ApJ...132..276W. doi: 10.1086/146926. ISSN 0004-637X.
- Wildey, R. L.; Burbidge, E. M.; Sandage, A. R.; Burbidge, G. R. (January 1962). "On the Effect of Fraunhofer Lines on u, b, V Measurements". The Astrophysical Journal. 135: 94. Bibcode: 1962ApJ...135...94W. doi: 10.1086/147251. ISSN 0004-637X.
- Schwarzschild, M.; Searle, L.; Howard, R. (September 1955). "On the Colors of Subdwarfs". The Astrophysical Journal. 122: 353. Bibcode: 1955ApJ...122..353S. doi: 10.1086/146094. ISSN 0004-637X.
- M., Cameron, L. (June 1985). "Metallicities and Distances of Galactic Clusters as Determined from UBV Data – Part Three – Ages and Abundance Gradients of Open Clusters". Astronomy and Astrophysics. 147. Bibcode: 1985A&A...147...47C. ISSN 0004-6361.
- Sandage, A. (December 1969). "New subdwarfs. II. Radial velocities, photometry, and preliminary space motions for 112 stars with large proper motion". The Astrophysical Journal. 158: 1115. Bibcode: 1969ApJ...158.1115S. doi: 10.1086/150271. ISSN 0004-637X.
- Carney, B. W. (October 1979). "Subdwarf ultraviolet excesses and metal abundances". The Astrophysical Journal. 233: 211. Bibcode: 1979ApJ...233..211C. doi: 10.1086/157383. ISSN 0004-637X.
- Laird, John B.; Carney, Bruce W.; Latham, David W. (June 1988). "A survey of proper-motion stars. III - Reddenings, distances, and metallicities". The Astronomical Journal. 95: 1843. Bibcode: 1988AJ.....95.1843L. doi: 10.1086/114782. ISSN 0004-6256.
- Strömgren; Bengt (1963). "Quantitative Classification Methods". Basic Astronomical Data: Stars and Stellar Systems: 123. Bibcode: 1963bad..book..123S.
- L., Crawford, D. (1966). "Photo-Electric Hbeta and U V B Y Photometry". Spectral Classification and Multicolour Photometry. 24: 170. Bibcode: 1966IAUS...24..170C.
- N., Cramer; A., Maeder (October 1979). "Luminosity and T EFF determinations for B-type stars". Astronomy and Astrophysics. 78: 305. Bibcode: 1979A&A....78..305C. ISSN 0004-6361.
- D., Kobi; P., North (November 1990). "A new calibration of the Geneva photometry in terms of Te, log g, (Fe/H) and mass for main sequence A4 to G5 stars". Astronomy and Astrophysics Supplement Series. 85: 999. Bibcode: 1990A&AS...85..999K. ISSN 0365-0138.
- Geisler, D. (1986). "The empirical abundance calibrations for Washington photometry of population II giants". Publications of the Astronomical Society of the Pacific. 98 (606): 762. Bibcode: 1986PASP...98..762G. doi: 10.1086/131822. ISSN 1538-3873.
- Geisler, Doug; Claria, Juan J.; Minniti, Dante (November 1991). "An improved metal abundance calibration for the Washington system". The Astronomical Journal. 102: 1836. Bibcode: 1991AJ....102.1836G. doi: 10.1086/116008. ISSN 0004-6256.
- Claria, Juan J.; Piatti, Andres E.; Lapasset, Emilio (May 1994). "A revised effective-temperature calibration for the DDO photometric system". Publications of the Astronomical Society of the Pacific. 106: 436. Bibcode: 1994PASP..106..436C. doi: 10.1086/133398. ISSN 0004-6280.
- James, K. A. (May 1975). "Cyanogen Strengths, Luminosities, and Kinematics of K Giant Stars". The Astrophysical Journal Supplement Series. 29: 161. Bibcode: 1975ApJS...29..161J. doi: 10.1086/190339. ISSN 0067-0049.
- Ji Wang. "Planet-Metallicity Correlation - The Rich Get Richer". Caltech.
- Fischer, Debra A.; Valenti, Jeff (2005). "The Planet‐Metallicity Correlation". The Astrophysical Journal. 622 (2): 1102. Bibcode: 2005ApJ...622.1102F. doi: 10.1086/428383.
- Wang, Ji; Fischer, Debra A. (2013). "Revealing a Universal Planet-Metallicity Correlation for Planets of Different Sizes Around Solar-Type Stars". The Astronomical Journal. 149 (1): 14. arXiv: 1310.7830. Bibcode: 2015AJ....149...14W. doi: 10.1088/0004-6256/149/1/14. S2CID 118415186.
- Ray Sanders (9 April 2012). "When Stellar Metallicity Sparks Planet Formation". Astrobiology Magazine.
- Vanessa Hill; Patrick François; Francesca Primas (eds.). "The G star problem". From Lithium to Uranium: Elemental Tracers of Early Cosmic Evolution. pp. 509–511. (Proceedings of the International Astronomical Union Symposia and Colloquia, IAU S228)
- Kewley, L. J.; Dopita, M. A. (September 2002). "Using Strong Lines to Estimate Abundances in Extragalactic HiiRegions and Starburst Galaxies". The Astrophysical Journal Supplement Series. 142 (1): 35–52. arXiv: astro-ph/0206495. Bibcode: 2002ApJS..142...35K. doi: 10.1086/341326. ISSN 0067-0049. S2CID 16655590.
- Nagao, T.; Maiolino, R.; Marconi, A. (2006-09-12). "Gas metallicity diagnostics in star-forming galaxies". Astronomy & Astrophysics. 459 (1): 85–101. arXiv: astro-ph/0603580. Bibcode: 2006A&A...459...85N. doi: 10.1051/0004-6361:20065216. ISSN 0004-6361. S2CID 16220272.
- Peimbert, Manuel (December 1967). "Temperature Determinations of H II Regions". The Astrophysical Journal. 150: 825. Bibcode: 1967ApJ...150..825P. doi: 10.1086/149385. ISSN 0004-637X.
- Pagel, B. E. J. (1986). "Nebulae and abundances in galaxies". Publications of the Astronomical Society of the Pacific. 98 (608): 1009. Bibcode: 1986PASP...98.1009P. doi: 10.1086/131863. ISSN 1538-3873.
- Henry, R. B. C.; Worthey, Guy (August 1999). "The Distribution of Heavy Elements in Spiral and Elliptical Galaxies". Publications of the Astronomical Society of the Pacific. 111 (762): 919–945. arXiv: astro-ph/9904017. Bibcode: 1999PASP..111..919H. doi: 10.1086/316403. ISSN 0004-6280. S2CID 17106463.
- Kobulnicky, Henry A.; Kennicutt, Jr., Robert C.; Pizagno, James L. (April 1999). "On Measuring Nebular Chemical Abundances in Distant Galaxies Using Global Emission‐Line Spectra". The Astrophysical Journal. 514 (2): 544–557. arXiv: astro-ph/9811006. Bibcode: 1999ApJ...514..544K. doi: 10.1086/306987. ISSN 0004-637X. S2CID 14643540.
- Grazyna, Stasinska (2004). "Abundance determinations in HII regions and planetary nebulae". In C. Esteban; R. J. Garcia Lopez; A. Herrero; F. Sanchez (eds.). Cosmochemistry. The melting pot of the elements. Cambridge Contemporary Astrophysics. Cambridge University Press. pp. 115–170. arXiv: astro-ph/0207500. Bibcode: 2002astro.ph..7500S.
- Peimbert, Antonio; Peimbert, Manuel; Ruiz, Maria Teresa (December 2005). "Chemical Composition of Two HII Regions in NGC 6822 Based on VLT Spectroscopy". The Astrophysical Journal. 634 (2): 1056–1066. arXiv: astro-ph/0507084. Bibcode: 2005ApJ...634.1056P. doi: 10.1086/444557. ISSN 0004-637X. S2CID 17086551.
- Pagel, B. E. J.; Edmunds, M. G.; Blackwell, D. E.; Chun, M. S.; Smith, G. (1979-11-01). "On the composition of H II regions in southern galaxies – I. NGC 300 and 1365". Monthly Notices of the Royal Astronomical Society. 189 (1): 95–113. Bibcode: 1979MNRAS.189...95P. doi: 10.1093/mnras/189.1.95. ISSN 0035-8711.
- Dopita, M. A.; Evans, I. N. (August 1986). "Theoretical models for H II regions. II - The extragalactic H II region abundance sequence". The Astrophysical Journal. 307: 431. Bibcode: 1986ApJ...307..431D. doi: 10.1086/164432. ISSN 0004-637X.
- McGaugh, Stacy S. (October 1991). "H II region abundances - Model oxygen line ratios". The Astrophysical Journal. 380: 140. Bibcode: 1991ApJ...380..140M. doi: 10.1086/170569. ISSN 0004-637X.
- Pilyugin, L. S. (April 2001). "On the oxygen abundance determination in HII regions". Astronomy & Astrophysics. 369 (2): 594–604. arXiv: astro-ph/0101446. Bibcode: 2001A&A...369..594P. doi: 10.1051/0004-6361:20010079. ISSN 0004-6361. S2CID 54527173.
- Kobulnicky, Henry A.; Zaritsky, Dennis (1999-01-20). "Chemical Properties of Star‐forming Emission‐Line Galaxies atz=0.1–0.5". The Astrophysical Journal. 511 (1): 118–135. arXiv: astro-ph/9808081. Bibcode: 1999ApJ...511..118K. doi: 10.1086/306673. ISSN 0004-637X. S2CID 13094276.
- Diaz, A. I.; Perez-Montero, E. (2000-02-11). "An empirical calibration of nebular abundances based on the sulphur emission lines". Monthly Notices of the Royal Astronomical Society. 312 (1): 130–138. arXiv: astro-ph/9909492. Bibcode: 2000MNRAS.312..130D. doi: 10.1046/j.1365-8711.2000.03117.x. ISSN 0035-8711.
- Shaver, P. A.; McGee, R. X.; Newton, L. M.; Danks, A. C.; Pottasch, S. R. (1983-09-01). "The galactic abundance gradient". Monthly Notices of the Royal Astronomical Society. 204 (1): 53–112. Bibcode: 1983MNRAS.204...53S. doi: 10.1093/mnras/204.1.53. ISSN 0035-8711.
- Afflerbach, A.; Churchwell, E.; Werner, M. W. (1997-03-20). "Galactic Abundance Gradients from Infrared Fine‐Structure Lines in Compact HiiRegions". The Astrophysical Journal. 478 (1): 190–205. Bibcode: 1997ApJ...478..190A. doi: 10.1086/303771. ISSN 0004-637X.
- Pagel, J.; Bernard, E. (1997). Nucleosynthesis and Chemical Evolution of Galaxies. Cambridge University Press. p. 392. Bibcode: 1997nceg.book.....P. ISBN 978-0521550611.
- Balser, Dana S.; Rood, Robert T.; Bania, T. M.; Anderson, L. D. (2011-08-10). "H Ii Region Metallicity Distribution in the Milky Way Disk". The Astrophysical Journal. 738 (1): 27. arXiv: 1106.1660. Bibcode: 2011ApJ...738...27B. doi: 10.1088/0004-637X/738/1/27. ISSN 0004-637X. S2CID 119252119.
- Salvaterra, R.; Ferrara, A.; Schneider, R. (2004). "Induced formation of primordial low-mass stars". New Astronomy. 10 (2): 113–120. arXiv: astro-ph/0304074. Bibcode: 2004NewA...10..113S. CiteSeerX 10.1.1.258.923. doi: 10.1016/j.newast.2004.06.003. S2CID 15085880.
- A. Heger; S. E. Woosley (2002). "The Nucleosynthetic Signature of Population III". Astrophysical Journal. 567 (1): 532–543. arXiv: astro-ph/0107037. Bibcode: 2002ApJ...567..532H. doi: 10.1086/338487. S2CID 16050642.
- Page 593-In Quest of the Universe Fourth Edition Karl F. Kuhn Theo Koupelis. Jones and Bartlett Publishers Canada. 2004. ISBN 0-7637-0810-0
- Bromm, Volker; Larson, Richard B. (2004). "The First Stars". Annual Review of Astronomy and Astrophysics. 42 (1): 79–118. arXiv: astro-ph/0311019. Bibcode: 2004ARA&A..42...79B. doi: 10.1146/annurev.astro.42.053102.134034. S2CID 119371063.