A web made of nothing but gravity
Zoom out far enough and the universe stops looking like a random scatter of galaxies and starts looking like a sponge. Galaxies cluster along thin filaments, filaments meet at dense nodes, filaments bound broad sheets, and in between sit huge, nearly empty voids tens to hundreds of megaparsecs across. This pattern is called the cosmic web, and it needs no special ingredient to form - plain Newtonian gravity acting on a nearly uniform gas of matter for 13.8 billion years is enough.
The seed is set at recombination, about 380,000 years after the Big Bang, when the cosmic microwave background freezes in tiny density fluctuations of about one part in 100,000. Regions fractionally denser than average pull in slightly more matter through gravity, so the imbalance grows - a runaway process called gravitational instability. Dark matter, which interacts only through gravity, starts clustering almost immediately, while ordinary (baryonic) matter is delayed until it decouples from radiation.
Pancakes, filaments, and why order matters
In the 1970s Yakov Zeldovich showed that the earliest stage of collapse is well described by letting each patch of matter free-fall along straight lines set by the initial gravitational potential. Because real density fields are almost never perfectly spherical, collapse along the shortest axis of a lumpy overdensity happens first: a blob flattens into a pancake, pancakes intersect to form filaments (a second axis has now collapsed), and filaments intersect to form dense nodes - the future sites of galaxy clusters, where all three axes have collapsed. Voids are simply regions that started slightly underdense and have been losing matter to their denser surroundings ever since.
Zeldovich approximation, comoving position at time t: x(t) = q + D(t) * psi(q) q initial (Lagrangian) position on a uniform grid psi(q) displacement field, set by the gradient of the initial potential D(t) linear growth factor - small early on, grows as the universe ages collapse happens first along the axis where psi's gradient is steepest -> sheet, then filament, then node, in that order
N-body simulations: turning particles into a web
Once collapse goes nonlinear there is no clean formula, so cosmologists run N-body simulations: billions of tracer particles, each representing a clump of dark matter, pushed forward by every other particle's gravity plus the overall expansion of space. A direct pairwise force sum costs O(n squared) per step, hopeless at billions of particles, so production codes use tree codes (grouping distant particles and summing their pull as one term, the same trick Barnes-Hut uses) or particle-mesh methods (depositing mass on a grid and solving for the potential with an FFT), or a hybrid of both - TreePM, the method behind simulations such as Millennium and IllustrisTNG. The demo on this page keeps the idea but shrinks the scale: a few thousand particles, direct gravity, no expansion term, so the same qualitative sequence plays out in seconds instead of gigayears.
Ordinary matter follows, then lights up
Dark matter outnumbers ordinary matter roughly five to one and dominates the gravity that builds the scaffold. Gas falls into the potential wells that scaffold creates, shock-heats as it does, and pools at the nodes and along the filaments - which is why galaxies and galaxy clusters sit exactly where the web is densest. Deep galaxy surveys such as the Sloan Digital Sky Survey trace out a web that mirrors dark-matter-only simulations almost structure for structure, one of the strongest pieces of evidence that gravity plus dark matter is basically the right picture of how structure formed.
Reading the web today
Modern surveys classify every point in space into one of four web environments - void, sheet, filament, node - typically by counting how many eigenvalues of the local tidal tensor are positive, since that tells you how many axes have already collapsed there. A galaxy's web environment correlates strongly with its properties: cluster and filament galaxies tend to be older, redder and starved of gas, while void galaxies stay bluer and keep forming stars - a relationship still being unpicked as one of the livelier questions in observational cosmology.
Frequently asked questions
Is the cosmic web actually made of visible strands?
The filaments are real concentrations of galaxies and gas, but they are far too faint and diffuse to see in a single photograph. The pattern only becomes visible by plotting the measured positions of hundreds of thousands of galaxies from a redshift survey, which is how it was first mapped in the 1980s.
Why do voids keep growing instead of staying empty?
A void starts out only slightly underdense, not empty. Because it has less matter than average, its local gravity is weaker than the cosmic average pull, so its interior expands faster than the universe as a whole and matter drains toward the denser walls around it - a slow-motion effect that widens the void over billions of years.
Does dark energy affect how the web looks today?
Yes. Once dark energy began dominating the expansion, roughly five billion years ago, it suppressed further gravitational growth. New structure stopped forming as efficiently, and the accelerated expansion of the voids froze the web's large-scale pattern into something close to its present shape.
Try it live
Everything above runs in your browser — open Cosmic Web and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Cosmic Web simulation