This interactive redshift and Doppler shift simulation shows a light source emitting expanding wavefronts while moving toward or away from a fixed observer, stretching the waves into redshift or compressing them into blueshift, with a live spectral-line diagram tracking the shift.
A moving source emits circular wavefronts at regular intervals. Because the source shifts position between emissions, wavefronts bunch up ahead of it (shorter wavelength, blueshift) and spread out behind it (longer wavelength, redshift) — exactly the effect behind the change in pitch of a passing ambulance siren, applied to light instead of sound.
Drag source velocity negative for an approaching source (blueshift) or positive for a receding one (redshift), and watch the spectral line slide left or right of the rest-frame reference line. Adjust emission frequency to change the wave spacing, and toggle the spectrum panel on or off. The mode button relabels the same picture as either simple relative-motion Doppler shift or (simplified) cosmological redshift.
Cosmological redshift, which stretches the light from distant galaxies, is not caused by galaxies moving through space like this simulation shows — it is caused by the expansion of space itself stretching the light's wavelength while it travels. The two effects look mathematically similar at low speeds but are physically distinct.
The Redshift & Doppler Shift Visualizer illustrates how motion changes the observed wavelength of light. When a source of waves moves relative to an observer, each successive wave crest is emitted from a slightly different position, so wave crests bunch together ahead of the source and spread apart behind it. For light, this shows up as a shift of spectral lines: toward blue for an approaching source, toward red for a receding one, following the relativistic Doppler formula z = √((1+v/c)/(1−v/c)) − 1 for recession velocity v.
Expanding circular wavefronts emitted from a moving source, visually compressed in the direction of motion and stretched behind it, alongside a spectral bar showing a reference "rest" line and the shifted "observed" line moving in real time as velocity changes.
The velocity slider ranges from −0.9c (fast approach) to +0.9c (fast recession); frequency changes how many wavefronts are emitted per second. The mode button swaps the on-screen label between framing this as ordinary relative-motion Doppler shift or as a simplified stand-in for cosmological redshift, and the spectrum toggle shows or hides the spectral-line panel.
Astronomers distinguish three redshift mechanisms: the classic Doppler effect from relative motion through space (what this simulation animates directly), cosmological redshift from the expansion of space itself stretching the path of light between galaxies, and gravitational redshift from light climbing out of a strong gravitational field.
Redshift is the stretching of a light wave's wavelength toward the red end of the spectrum, making its observed wavelength longer than its emitted wavelength. It happens when a source recedes from an observer (Doppler redshift), when space itself expands between the source and observer (cosmological redshift), or when light climbs out of a strong gravitational field (gravitational redshift).
Simple Doppler shift arises from a source's motion through space relative to an observer, exactly like the pitch change of a passing siren. Cosmological redshift arises from the expansion of space itself stretching a photon's wavelength as it travels across billions of light-years, even if the emitting galaxy has little peculiar motion of its own. The two produce mathematically similar formulas at low speeds but describe different physical mechanisms.
Astronomers compare the wavelengths of known spectral lines — sharp absorption or emission features produced by specific atoms and ions — in a star or galaxy's spectrum against their known laboratory (rest-frame) wavelengths. The fractional shift, z = (observed − rest)/rest, directly gives the redshift, from which velocity or (for cosmological redshift) distance can be inferred using Hubble's law.
Redshift means the observed wavelength is longer than emitted (colours shift toward red), typically from a receding source or expanding space. Blueshift means the observed wavelength is shorter (colours shift toward blue), from an approaching source. Most distant galaxies show redshift because the universe is expanding, but some very nearby galaxies, like Andromeda, show blueshift because their local gravitational motion toward us outweighs the cosmic expansion.
The simulation allows velocities up to 0.9c purely to make the relativistic Doppler formula's effects clearly visible; real astrophysical sources such as stars and galaxies typically move at speeds far below this. Some jets from black holes and neutron stars, however, do reach a substantial fraction of the speed of light, making relativistic Doppler beaming and shifting directly relevant to their observed appearance.