What Is a Spectrograph and How Does It Work?

A spectrograph is an instrument that splits light into its individual wavelengths and records the resulting pattern, called a spectrum. Think of it as a far more precise version of what happens when sunlight passes through a raindrop to create a rainbow, except a spectrograph captures that rainbow in fine detail and preserves it for analysis. Scientists use spectrographs to figure out what things are made of, how hot they are, how fast they’re moving, and how far away they are.

How a Spectrograph Works

Every spectrograph does the same basic job in three steps: it collects light, spreads that light out by wavelength, and records the result. The spreading is the key part. When white light hits a dispersing element (either a prism or a diffraction grating), each wavelength bends by a slightly different amount, fanning the light out into a full spectrum of colors. A diffraction grating works by acting as a set of extremely fine, equally spaced slits. Light waves passing through these slits interfere with each other in a pattern that depends on wavelength, sending each color off at a distinct angle.

Prisms were the original tool for this job, but modern instruments almost exclusively use diffraction gratings because they offer more control over resolution and efficiency. Some instruments use a hybrid called a grism, which is a grating bonded to a prism, allowing light to pass straight through while still being dispersed.

Once the light is spread out, the spectrograph records the pattern on a detector. In the 1800s, that detector was a photographic plate. Today it’s typically a digital sensor similar to the one in a camera, but optimized for scientific precision. The recorded spectrum shows which wavelengths are present and how bright each one is, and that information is surprisingly rich.

Spectrograph vs. Spectrometer vs. Spectroscope

These three terms overlap and often get used interchangeably, but they have distinct meanings. A spectroscope is the simplest version: it lets you look at a spectrum with your eyes but doesn’t record it. A spectrometer is a broader term for any instrument that measures some property of light as a function of wavelength. A spectrograph specifically separates incoming light by wavelength and records the resulting spectrum on a multichannel detector. In practice, when someone says “spectrometer” in a modern lab or observatory, they’re usually talking about a device that also records the data, which makes it functionally a spectrograph.

What a Spectrum Actually Reveals

Every chemical element absorbs and emits light at specific wavelengths, like a fingerprint. When you spread starlight into a spectrum, you see dark lines at the exact wavelengths where elements in the star’s atmosphere have absorbed light. Hydrogen leaves one pattern, iron another, calcium another. By matching those lines to known patterns measured in laboratories on Earth, astronomers can identify what a star is made of without ever visiting it. The same lines also reveal temperature and density: hotter gas produces different line patterns than cooler gas, and denser gas broadens the lines in characteristic ways.

This principle works far beyond astronomy. In a chemistry lab, heating an unknown substance causes it to emit light at wavelengths unique to its elements. A spectrograph captures those wavelengths and identifies what’s in the sample. The brightness of each emission line is proportional to the concentration of that element, so the instrument can also tell you how much of each element is present, not just what’s there.

Measuring Speed and Distance With Light

One of the most powerful things a spectrograph can do is measure motion. When an object emitting light moves away from you, its light waves get stretched to longer (redder) wavelengths. When it moves toward you, the waves compress to shorter (bluer) wavelengths. This is the Doppler effect, the same phenomenon that makes a siren’s pitch drop as an ambulance drives past.

Astronomers measure this by comparing the positions of spectral lines from a distant star or galaxy to the positions those same lines occupy when measured in a lab on Earth. The amount of shift tells you how fast the object is moving toward or away from you. For distant galaxies, this shift (called redshift) also reveals distance. Edwin Hubble discovered that the farther a galaxy is from Earth, the faster it’s receding, a relationship now known as Hubble’s law. By measuring redshift with a spectrograph and plugging that value into Hubble’s equation, astronomers can estimate how far away a galaxy is. This technique is foundational to our understanding of the expanding universe.

Types of Spectrograph Designs

Not all spectrographs are built the same way, and different designs suit different tasks.

  • Echelle spectrographs use a special grating with wide, steeply angled grooves combined with a second dispersing element (usually a prism) that spreads the spectrum in two dimensions. This lets them capture a very broad range of wavelengths at high resolution in a single exposure, making them the fastest and most sensitive spectroscopic technology currently available. They’re the design of choice for both high-end analytical lab instruments and major astronomical observatories.
  • Fiber-fed spectrographs use optical fibers to carry light from a telescope or sampling point to the spectrograph itself, which can sit in a separate, temperature-controlled room. This decoupling improves stability and allows the spectrograph to be much larger and more precise than one mounted directly on a moving telescope.
  • Integral field spectrographs capture spectra from every point across a two-dimensional area simultaneously, building a data cube where each pixel in an image has its own full spectrum. This is useful for mapping the composition or velocity of extended objects like galaxies or nebulae.

Spectrographs in Space

The James Webb Space Telescope carries a near-infrared spectrograph called NIRSpec that covers wavelengths from 0.6 to 5.3 micrometers, a range spanning visible red light through the mid-infrared. NIRSpec can operate at three resolving powers (roughly 100, 1,000, and 2,700), letting astronomers choose between a broad overview of an object’s spectrum and a detailed look at specific features. One of its most innovative components is a micro-shutter assembly: a grid of tiny shutters that can individually open or close, allowing the instrument to take spectra of up to hundreds of objects in a single observation.

Space-based spectrographs have a huge advantage over ground-based ones because Earth’s atmosphere absorbs many wavelengths of light, especially in the infrared and ultraviolet. Putting a spectrograph above the atmosphere gives access to the full electromagnetic spectrum.

Everyday and Industrial Uses

Spectrographs aren’t limited to telescopes. Portable versions are now used across a surprising range of fields. In food safety, portable Raman spectrometers can identify bacterial contamination in meat, with researchers achieving up to 100% accuracy in classifying common strains like Bacillus, Pseudomonas, and E. coli. The technique is non-destructive and fast, making on-site screening practical in ways that traditional lab methods aren’t.

Environmental monitoring uses spectroscopic methods to detect heavy metals in water at extraordinarily low concentrations. Mercury ions in tap water, for example, have been detected at parts-per-trillion levels, two orders of magnitude below the toxicity threshold set by the U.S. Environmental Protection Agency. In geology, mining, metallurgy, and medicine, atomic spectroscopy techniques built on the same core principle (splitting light by wavelength and reading the result) are standard tools for identifying and quantifying elements in samples.

A Brief Origin Story

Isaac Newton famously used a prism to split sunlight into colors in 1666, but he missed something important: he shone light from the full solar disk through a round hole, which blurred fine details. In 1802, William Wollaston noticed dark lines in the solar spectrum but recorded only seven of them. It was Joseph von Fraunhofer, starting around 1814, who mapped the solar spectrum in real detail, measuring the positions of 324 out of roughly 500 visible dark lines. He labeled the most prominent ones with letters, a naming system still in use today.

Fraunhofer also built the first diffraction grating in 1821, made from 260 closely spaced parallel wires. Using it, he became the first person to measure the actual wavelengths of specific colors and spectral lines. That combination of precise measurement and recorded data made Fraunhofer’s work the foundation of modern spectroscopy, and every spectrograph built since follows the same fundamental logic he pioneered.