Galaxies

How Do Galaxies Form? From Dark Matter Halos to Spiral Arms (Explained Simply)

On a truly dark night, far from city lights, the sky doesn’t just show you stars — it shows you a river of them. That hazy band stretching overhead is the Milky Way, our own galaxy, seen edge-on from the inside. It holds hundreds of billions of stars, and it is just one of the trillions of galaxies scattered across the observable universe.

Here is the part that stops me in my tracks every time: 13.8 billion years ago, there wasn’t a single galaxy anywhere. No stars, no spirals, no glowing ellipticals. Just hot gas and invisible dark matter, spread thin across an expanding universe. So how did we get from that to this?

The question of how galaxies form sounds simple, but it is really asking something much bigger: how did the universe build cities of billions of stars out of almost nothing? The answer turns out to be surprisingly readable. It involves invisible scaffolding, gas that had to cool down before it could shine, violent cosmic collisions, and a few surprises that the James Webb Space Telescope dropped on astronomers only recently. Let’s walk through the whole story.

The short answer: Galaxies form when ordinary gas falls into clumps of invisible dark matter, cools down, and collapses to ignite the first stars. After that, they keep growing for billions of years by pulling in fresh gas and merging with other galaxies — a process that is still going on today, including in our own Milky Way.

What Does It Actually Mean When We Say a Galaxy “Forms”?

Here is something textbooks sometimes gloss over: no one has ever watched a galaxy form. Not even the James Webb Space Telescope. What astronomers actually see are snapshots — baby galaxies as they looked billions of years ago, mid-sized ones halfway through their lives, and ancient giants that have been sitting quietly for most of cosmic history. Formation is something we piece together from those snapshots, the way you might reconstruct a person’s whole life from a shoebox of photographs taken decades apart.

And unlike a person, a galaxy doesn’t have a birthday. The first galaxies didn’t switch on like light bulbs. They assembled — gas clump by gas clump, star by star, merger by merger — over hundreds of millions of years. When astronomers say the first galaxies “formed,” they generally mean the point at which small clumps of gas and stars had gathered enough mass to look like something we would recognize as a galaxy: a self-contained family of stars, gas, dust, and dark matter, all held together by gravity.

How Galaxies Form, Step by Step

If you want the whole story in miniature before we unpack it, here it is:

  1. Tiny density ripples. Moments after the Big Bang, matter wasn’t perfectly smooth — some patches were very slightly denser than others.
  2. Dark matter collapses first. Gravity amplified those ripples, and invisible dark matter collapsed into clumps called halos — the scaffolding everything else would be built on.
  3. Gas falls in and cools. Ordinary hydrogen and helium gas sank into those halos, radiated away its heat, and condensed.
  4. Stars ignite. The cooled gas fragmented into stars, and a protogalaxy lit up for the first time.
  5. Mergers and feeding. The young galaxy kept growing by pulling in more gas and colliding with neighboring galaxies, building the spirals and ellipticals we see today.

That is the skeleton of the story. Now let’s put flesh on it — starting with the strangest ingredient of all: the one nobody can see.

What Are Galaxies Made Of?

Before we talk about building a galaxy, it helps to know the parts list — because a galaxy is mostly made of things you can’t see.

Component Approximate share of a galaxy’s mass Its job
Dark matter About 85% Invisible scaffolding — its gravity holds everything together
Stars A few percent Produce the light we see; forge heavier elements in their cores
Gas (mostly hydrogen) Varies by galaxy type The raw material that new stars are made from
Dust A tiny fraction Dims and reddens starlight; helps gas cool and form molecules
Supermassive black hole A millionth of the mass, roughly Can heat surrounding gas and throttle star formation

Two things are worth noticing here. First, the stars — the part we actually see — are a minority shareholder. The dark matter outweighs all the ordinary matter in the universe by roughly five to one, and it dominates the mass of every galaxy. Second, a galaxy is not just a pile of stars. It is a system: gravity, gas physics, and feedback all pushing against each other in a delicate balance.

New to vocabulary like “dark matter halo” or “redshift”? 9bio.co.uk publishes beginner-friendly guides that break down science basics in plain language — a good companion read if any term here feels unfamiliar.

What Is Dark Matter’s Role in Galaxy Formation?

Here is the part that still amazes me: the most important ingredient in galaxy formation is something no one has ever directly detected. Dark matter doesn’t shine, absorb, or reflect light. We know it exists because its gravity betrays it — galaxies spin far too fast to hold together with only the gravity of their visible stars, and clusters of galaxies bend light far more than their visible mass should allow.

In the early universe, ordinary matter couldn’t easily collapse under its own gravity. It was hot, and it was tangled up with light itself — photons kept pushing the gas apart. Dark matter had no such problem. A few hundred thousand years after the Big Bang, it began collapsing under its own weight, gathering into enormous, roughly spherical clumps that astronomers call dark matter halos.

Those halos became gravitational wells — deep dips in the fabric of space that ordinary gas couldn’t resist. Hydrogen and helium slid down into them like rainwater running into a valley. Without dark matter, computer simulations show, galaxies wouldn’t have formed nearly as quickly as they did. The invisible scaffolding had to come first; the visible galaxy was built inside it.

Dark Matter Halos: The Invisible Scaffolding

It helps to picture a halo not as a solid object but as a cloud of invisible mass, far larger than the galaxy it hosts — the Milky Way’s halo stretches hundreds of thousands of light-years beyond its visible disk. Everything the galaxy will ever become starts as a trickle of gas falling into that well. The halo’s gravity also dictates the galaxy’s rotation speed and holds on to gas that would otherwise drift away. In a very real sense, dark matter is the reason galaxies exist as stable, long-lived structures instead of dissolving back into the cosmic fog.

Illustration of a young galaxy forming inside a glowing dark matter halo with streams of cold gas flowing inward.
An artist’s impression of a young galaxy forming at the center of an invisible dark matter halo, with cold gas streaming in along cosmic filaments. Astronomers believe this process — gas falling into a dark matter ‘well’ and cooling — is how the first galaxies were born.

How Does Hot Gas Cool Down Enough to Make Stars?

Gas falling into a dark matter halo has a problem: it arrives hot. As it slides down the gravitational well, it picks up speed and heats up — and hot gas has pressure, which pushes outward and resists further collapse. It’s like trying to squeeze a fully inflated balloon. For a galaxy to form, the gas has to dump that heat into space. Astronomers call this radiative cooling: the gas glows (mostly in X-rays and ultraviolet light), and that glow carries energy away.

The early universe made this harder, because the first gas was pristine — just hydrogen and helium, which are terrible at cooling. Star formation in the very first halos was slow and inefficient. But once the first stars formed and exploded, they seeded the gas with heavier elements — what astronomers call “metals” — and metals are superb radiators. Each generation of stars made the next generation easier to form. Galaxy formation, in a sense, bootstrapped itself.

The First Stars Were Nothing Like Our Sun

The first generation of stars — astronomers call them Population III stars — were born from metal-free gas and were probably monsters: tens or even hundreds of times the mass of our Sun, burning blisteringly hot and dying within a few million years in spectacular supernova explosions. Those explosions scattered carbon, oxygen, iron, and other heavy elements into the surrounding gas. Every atom of iron in your blood was forged in a star like that, or in one of its descendants. Without those first violent generations, gas would never have cooled efficiently enough to build galaxies full of small, long-lived stars like our Sun.

As the cooled gas settled toward the center of the halo, one more piece of physics took over: angular momentum. The gas always had a tiny bit of rotation, and as it contracted, that rotation sped up — the same way a figure skater spins faster when she pulls her arms in. The result was a flat, spinning disk of gas: the birthplace of spiral galaxies like our own.

Why Do Galaxies Come in Different Shapes?

Look at any deep-space image and you’ll notice galaxies come in wildly different shapes. In 1926, Edwin Hubble sorted them into a sequence that astronomers still use today: elegant spirals with sweeping arms, smooth ellipticals that look like glowing footballs, and ragged irregulars with no defined shape at all.

A galaxy’s shape is really a record of its history. Spirals are the ones that had a relatively calm life — gas settled into a disk and kept forming stars steadily. Ellipticals are the survivors of violence: they are what you get when galaxies collide and merge, scrambling neat disks into round, puffy swarms of old stars with little gas left for new ones. Irregulars are usually galaxies caught mid-disturbance, often tugged out of shape by a close encounter with a neighbor.

Comparison illustration showing spiral, elliptical, and irregular galaxy types side by side in deep space.
The three main galaxy types: a spiral galaxy with sweeping arms, a smooth elliptical galaxy, and a patchy irregular galaxy. A galaxy’s shape is a record of its history — calm disk-building versus violent mergers.

The Hubble Tuning Fork — Still Useful After a Century

Hubble arranged his types into a diagram shaped like a tuning fork, with ellipticals on the handle splitting into barred and unbarred spirals on the prongs. He originally thought it might be an evolutionary sequence — that galaxies aged from one type into another. That turned out to be wrong, but the classification itself stuck, because it captures something real: the connection between a galaxy’s shape, its stellar population, and the kind of life it has lived.

Spiral galaxies Elliptical galaxies Irregular galaxies
Shape Flat disk with spiral arms Round or oval blob, no disk No defined shape
Star formation Ongoing — new stars still being born Mostly finished — old stars dominate Often bursty and chaotic
Gas and dust Plenty Very little Usually plenty
Typical neighborhood Isolated regions and small groups Dense galaxy clusters Often near larger galaxies
How it got that way Gas settled into a rotating disk Built by major mergers that scrambled the disk Disturbed by collisions or close encounters

How Do Spiral Galaxies Get Their Arms?

Of all the sights in the universe, few beat a grand-design spiral — two perfect arms curling around a glowing core. But what actually draws those arms? The leading idea is the density wave theory: the arms are not fixed structures but slow-moving traffic jams. Gas and stars orbit the galactic center, pile up as they pass through the wave, and the compressed gas lights up with new star formation — which is why the arms glow so blue with young, hot stars.

And what sets those waves in motion? Often, a gravitational nudge. When a disk galaxy absorbs a smaller companion, the interaction can stir the disk into developing arms — the kind of graceful spirals we associate with galaxies like the Milky Way. Our own galaxy, by the way, is a barred spiral: it has a straight bar of stars running through its center, with the arms unwinding from the bar’s ends. The majority of spiral galaxies share this barred structure, so in that respect the Milky Way is perfectly ordinary.

How Do Galaxies Grow and Change Over Time?

Galaxy formation doesn’t end when the first stars ignite — that is just the opening chapter. The standard picture, called hierarchical formation, says galaxies grow from the bottom up: small dark matter halos collapse first and merge into progressively larger ones, and the galaxies inside them merge along with them. This merging is not ancient history. It is happening right now, all over the universe, and it has been happening for 13 billion years.

But mergers are only part of the story. Surprisingly, most galaxies get the bulk of their mass not from collisions but from quietly drinking in fresh gas from the space between galaxies — the intergalactic medium. Cold streams of hydrogen flow along invisible filaments and rain down onto the galaxy, fueling steady star formation. A galaxy is less like a finished building and more like a city that keeps annexing suburbs and importing supplies.

Illustration of two spiral galaxies colliding and merging, with tidal tails of stars and bursts of new star formation.
When two galaxies collide, gravity stretches them into long tidal tails while shock waves trigger bursts of new star formation. The Milky Way has survived several such mergers — and will eventually merge with Andromeda.

The Cosmic Web: Where Galaxies Are Born

Zoom out far enough and galaxies aren’t scattered randomly at all. They trace a vast cosmic web — enormous filaments of dark matter and gas meeting at dense nodes, with enormous empty voids in between. Galaxies form preferentially at the nodes and along the filaments, exactly where the web’s gravity funnels gas together. This web-like pattern is one of the great predictions of the standard cosmological model, and modern sky surveys have mapped it in stunning detail: the universe really is built like a sponge, and galaxies are the bright knots in its foam.

There was one more hurdle in the early days. Before about a billion years after the Big Bang, the universe was filled with neutral hydrogen gas that blocked ultraviolet light like a thick fog. The intense radiation from the first generations of stars burned through that fog — stripping electrons from hydrogen atoms in an era astronomers call reionization — and made the universe transparent for the first time. Only then could starlight travel freely across billions of light-years to reach telescopes like the ones we use today.

What Stops a Galaxy From Growing Forever?

If galaxies spend billions of years pulling in gas and merging, why aren’t they all enormous? Because galaxies have brakes — astronomers call it feedback.

The brakes come in two flavors. First, stellar feedback: massive stars explode as supernovae, and their blast waves can heat or even blow gas clean out of a small galaxy, choking off further star formation. Second, black hole feedback: the supermassive black hole at a galaxy’s center, when it is actively feeding, can unleash jets and radiation so powerful they heat the surrounding gas and stop it from cooling into new stars. This is why many giant ellipticals are “red and dead” — full of old red stars, with no gas left to make new ones.

Feedback is the reason galaxy formation is self-regulating rather than runaway. A galaxy that forms stars too furiously triggers the very explosions and outflows that shut star formation down. The Milky Way sits in a comfortable middle ground: still forming stars, but at a calm, sustainable pace.

What Is the James Webb Telescope Teaching Us About Galaxy Formation?

Just when astronomers thought they had the timeline of galaxy formation sorted out, the James Webb Space Telescope started rewriting it. Because Webb sees in infrared light, it can peer back to the universe’s first billion years — an era previous telescopes could barely glimpse. And what it found was startling: galaxies that existed just 300 million years after the Big Bang, already showing more structure and complexity than the models predicted for such an early epoch.

Some of those early galaxies initially looked impossibly massive — so large, so soon, that simulations couldn’t account for them, and a few researchers wondered whether the standard model of cosmology itself needed fixing. Then a closer look, using Webb’s Cosmic Evolution Early Release Science survey, told a subtler story: supermassive black holes in some of these galaxies were making them appear brighter — and therefore more massive — than they really are. As the study’s lead author put it, we are still seeing more galaxies than predicted, but none so massive that they “break” the universe.

This is science working exactly as it should: a bold new instrument, a genuine surprise, careful follow-up, and a refined picture. The emerging lesson is that galaxy assembly in the early universe ran faster than our first models assumed — but the models are catching up. If you enjoy following discoveries like these as they unfold, the plain-language science explainers on Daily Scope 67 keep up with stories from astronomy and beyond in the same accessible style.

What Will Happen to Our Own Galaxy?

The Milky Way is roughly 13.6 billion years old — almost as old as the universe itself — and it got here the same way every other galaxy did: by merging. Our galaxy has devoured smaller companions throughout its life, and the evidence is still visible in faint streams of stars wrapped around it like ribbons. Galaxy formation isn’t something that happened to the Milky Way long ago. It is its autobiography.

And the story isn’t over. The Andromeda Galaxy — our large spiral neighbor, about 2.5 million light-years away — is drifting toward us, and in roughly 4.5 billion years the two will collide and merge. Before you panic: the stars themselves will almost certainly not hit each other. Galaxies are mostly empty space, and the two systems will pass through each other, gravitationally tangling over billions of years before settling into a single giant elliptical galaxy that astronomers have nicknamed “Milkomeda.”

By then, our Sun will be swelling into a red giant anyway — but that is a story for another article. The point is that galaxy formation is not a chapter that closed in the ancient past. It is the ongoing business of the universe, and we are living inside one of its construction sites.

Frequently Asked Questions About Galaxy Formation

How long does it take for a galaxy to form?

There is no single answer, because formation is gradual. The first clumps of stars and gas began assembling a few hundred million years after the Big Bang, and a recognizable young galaxy could emerge within roughly a billion years. But growth never really stops — galaxies keep pulling in gas and merging for their entire lives, which can span 10 billion years or more.

When did the first galaxies form?

The earliest galaxies we have observed date to roughly 300 million years after the Big Bang, thanks to the James Webb Space Telescope. Astronomers suspect even earlier, fainter ones are waiting to be found — Webb keeps pushing that frontier further back with every deep survey.

Can new galaxies still form today?

Small dwarf galaxies can still assemble in quiet corners of the universe, but the era of building giant new galaxies from scratch is largely over — most of the raw material has already been gathered into existing galaxies. What continues today is growth by merger and gas accretion: old galaxies eating, drinking, and evolving, rather than brand-new ones being born.

How many galaxies are in the observable universe?

One widely cited estimate puts the number at around 2 trillion — far more than the hundreds of billions astronomers once guessed. Most of them are faint dwarf galaxies too dim for even our best telescopes to see individually. Every deep image Webb takes seems to find more of them hiding in the dark.

What happens when two galaxies collide?

Despite the dramatic name, galactic collisions are slow-motion events. The two galaxies pass through each other over hundreds of millions of years, gravity stretching them into long tidal tails while shock waves trigger bursts of new star formation. Eventually they settle into a single, usually elliptical, galaxy. Individual stars almost never collide — the distances between them are simply too vast.

Will the Milky Way really merge with Andromeda?

Yes — the two galaxies are on a collision course, and the merger will begin in roughly 4.5 billion years. The result will be a giant elliptical galaxy, sometimes nicknamed “Milkomeda.” Our solar system will likely be flung into a new orbit, but the Sun and Earth will survive the encounter itself — by then, the Sun’s own evolution into a red giant will be the bigger concern.

Do all galaxies have supermassive black holes?

Almost every large galaxy astronomers have examined hosts a supermassive black hole at its center — including our Milky Way, whose central black hole (Sagittarius A*) weighs about 4 million times the mass of the Sun. Strangely, the black hole’s mass is closely tied to the mass of the galaxy around it, which suggests black holes and galaxies grew up together, regulating each other through feedback.

Final Thoughts: The Universe Is Still Building

So, how do galaxies form? They condense out of the dark — literally. Invisible dark matter clumps first, ordinary gas falls in and cools, stars ignite, and then billions of years of merging, feeding, and feedback sculpt the result into the spirals, ellipticals, and irregulars that fill our telescopes.

What I find most remarkable is that none of this is finished. Somewhere out there right now, two galaxies are mid-collision, a stream of cold gas is raining onto a young disk, and a first generation of stars is lighting up a cloud that has been dark since the dawn of time. The universe has been building galaxies for 13 billion years — and it shows no sign of stopping.

The next time you look up at the Milky Way’s hazy band, remember what you’re really seeing: a construction site, 13.6 billion years in the making, still very much under construction.

Read Also: What Happens Inside a Black Hole? Journey Past the Event Horizon (Explained Simply)

Awais
Written by

Awais

Admin & Lead Curator, Astronomy 101

Awais is the founder, chief administrator, and lead science curator of Astronomy 101 (astronomy101.co.uk). Dedicated to making space science and astronomical observing accessible to learners worldwide, Awais oversees the research, computational tools, and editorial integrity of all publications across the platform.

Explore This Topic

Galaxies Hub

Dive into our complete collection of tutorials, observations, and deep dives for this subject.

View All Guides →

1 Comment

Join the Discussion

Your email address will not be published. Required fields are marked *

Featured on LaunchBuff