How Did The First Galaxies Form?
The observable universe holds somewhere between several hundred billion and two trillion galaxies, depending on which recent analysis you trust. NASA's 2016 Hubble study revised the count sharply upward, while a 2021 measurement from the New Horizons spacecraft pulled it back down. Whatever the final number, almost every star and planet we know about lives inside one of these gravitationally bound systems. Galaxies come in several distinct shapes, and astronomers now have a fairly clear picture of how the first ones formed and how they grew into the variety we see today.
Quick Take: The first galaxies formed within dark matter halos roughly 200 to 400 million years after the Big Bang. They were small, irregular, and built from short-lived stars made almost entirely of hydrogen and helium. Today's larger spirals and ellipticals are the result of billions of years of mergers.
The First Stars

The first stars, known as Population III stars, looked nothing like our Sun. Theory suggests they were enormous, often hundreds of solar masses and possibly up to a thousand, with surface temperatures hot enough to glow blue-white. They burned through their fuel in just a few million years before exploding as supernovae. None of them likely had planets. Big Bang nucleosynthesis produced only hydrogen, helium, and trace amounts of lithium, and you need heavier elements to build rocky worlds.
Inside any star, hydrogen fuses into helium through a chain of reactions. In Sun-like stars, the proton-proton chain dominates. Two protons collide; one converts into a neutron by emitting a positron and a neutrino, leaving deuterium. That deuterium then captures another proton to form helium-3. Finally, two helium-3 nuclei merge into helium-4, releasing two protons back into the mix. The energy released at each step flows outward as photons and holds the star up against its own gravity, a balance called hydrostatic equilibrium. This is the basic engine of nuclear fusion in stars.
Heavier elements come from later stages. When helium builds up in a star's core, the triple-alpha process kicks in. Two helium-4 nuclei briefly fuse into beryllium-8, an isotope so unstable it decays in about ten quadrillionths of a second. If a third helium-4 strikes the beryllium before it falls apart, the reaction produces stable carbon-12. Carbon, oxygen, and most of the elements that make up planets and people trace back to this narrow window inside dying stars.
Did You Know? The first Population III stars have never been directly observed, though the James Webb Space Telescope has spotted candidate signatures in extremely distant galaxies. Their telltale signal would be strong hydrogen and helium emission with no trace of heavier elements.
Modern cosmology places galaxy formation inside a framework called hierarchical structure formation. Dark matter, which makes up roughly 85 percent of the matter in the universe, clumped together first under its own gravity, forming halos. Ordinary gas then fell into those halos, cooled, and condensed into the first stars. The earliest galaxies were small, often containing only a few million stars, and they looked nothing like the tidy spirals and ellipticals we see now. They were lumpy, irregular, and packed closer together than galaxies are today, which set the stage for what came next.
Colliding and Merging Galaxies

Even small galaxies pull on each other through gravity, and in the dense early universe collisions were common. The word "collision" is a bit misleading. Individual stars almost never run into each other during a galactic merger because the spaces between them are vast. The interaction is more like two flocks of birds passing through each other, with gravity slowly winding them into a single system over hundreds of millions of years.
What does collide is gas. Giant molecular clouds, the cold reservoirs where new stars are born, slam into each other and compress, triggering bursts of star formation that can light up the merging galaxy as a starburst. By the time a merger settles, the resulting galaxy may hold millions of new stars and have used up much of its star-forming gas. Most large galaxies have been through this process more than once. The Milky Way has absorbed several smaller galaxies over its 13-billion-year life and is currently on a collision course with Andromeda, a merger expected to begin in roughly 4 to 5 billion years.
How Galaxy Shapes Formed

Astronomers sort galaxies along the Hubble sequence: ellipticals, lenticulars, spirals, and irregulars. Ellipticals are smooth, roughly oval clouds of mostly old stars with little gas left to form new ones. Lenticulars sit between ellipticals and spirals, with a disc but no obvious arms. Spirals, like the Milky Way, have a flattened rotating disc with arms tracing through it. Irregulars lack any clear symmetry. A separate label, "peculiar," is sometimes added for galaxies visibly distorted by interactions, though it describes a state more than a true class.
Spiral arms are the trickiest feature to explain. The leading model is density wave theory, first developed by C.C. Lin and Frank Shu in the 1960s. The arms are not fixed structures made of the same stars over time. They are pressure waves moving through the disc, like cosmic traffic jams. Stars and gas orbit the galactic center at one speed; the wave pattern rotates at another. As stars pass through an arm they slow briefly, gas gets compressed, new stars are triggered, and the bright young blue stars and pink emission nebulae that mark the arms eventually fade as the material moves on through. New stars then light up the next stretch of the wave. This is why arms always look young.
Ellipticals form mostly through major mergers of two roughly equal-mass spirals. The chaotic interaction scrambles the orderly disc rotation into random orbits and consumes the available gas, leaving a smooth, gas-poor remnant. Irregulars are often small galaxies that never had enough mass to settle into a clean shape, or larger galaxies disrupted by a recent close pass with a neighbor. The dwarf galaxies orbiting the Milky Way include several good examples.
What Galaxies Tell Us About the Universe
Mapping galaxy shapes, locations, and motions is how cosmologists test the larger story of the cosmos. The distribution of galaxies across the sky traces out the cosmic web, the dark matter scaffolding that organizes everything else. The light from the most distant galaxies, captured by Hubble and now Webb, lets us watch the early universe directly. Each new generation of telescope pushes that view further back, closer to the moment when the first stars switched on and the universe began to take the shape we live in today.
Final Thought: Galaxies are not just collections of stars. They are the engines of cosmic chemistry, the homes of every star and planet we know about, and the visible record of how matter organized itself out of the smooth aftermath of the Big Bang.