How does an MRI machine work?

A magnet 30,000 times stronger than Earth's, a radio that listens to the hydrogen in your body, and a Fourier transform that turns echoes into a picture. An MRI scanner is a superconducting magnet: coils of niobium-titanium wire bathed in liquid helium at about −269 °C, carrying current with no resistance.

A magnet 30,000 times stronger than Earth's, a radio that listens to the hydrogen in your body, and a Fourier transform that turns echoes into a picture. Take an MRI scanner apart in 3D and make T1 and T2 contrast yourself.

MRIClearOpened 25 Jul 202614 min to playFree · no sign-up

In 60 seconds

  1. A giant magnet that never switches off

    An MRI scanner is a superconducting magnet: coils of niobium-titanium wire bathed in liquid helium at about −269 °C, carrying current with no resistance. It makes a field of 1.5 or 3 tesla, 30,000 to 60,000 times Earth's, inside a tunnel about 70 cm wide.

  2. Your hydrogen nuclei are tiny magnets

    Each hydrogen nucleus is a spinning proton that acts like a bar magnet. In the scanner a tiny excess, about 5 in a million at 1.5 T, lines up with the field, and every one of them wobbles at the Larmor frequency: 42.58 MHz per tesla, or 63.9 MHz at 1.5 T.

  3. A radio pulse, then an echo

    A burst of radio waves at exactly that frequency tips the spins sideways, and as they spin they broadcast a faint radio signal. It fades as the spins drift out of step (T2) while they slowly realign with the field (T1). Different tissues do this at different rates, and the timing of the pulses, TR and TE, decides which tissues look bright.

  4. Tilting the field to find position

    Gradient coils make the field slightly stronger on one side, so each position sings at its own frequency. Each echo fills one line of k-space, and a Fourier transform turns the full grid into the picture. The coils flex as they switch, which makes the loud knocking.

  5. No X-rays, but the magnet is always on

    MRI uses no ionising radiation. Its dangers are steel objects pulled into the bore, implants that can move or heat up, and radio heating, which is kept under set limits. Everyone is screened before going in, and in an emergency the magnet can be quenched, venting its helium up a pipe.

  6. It can watch the brain work

    fMRI detects the extra oxygen-rich blood that flows to busy brain areas, diffusion MRI follows water along nerve fibres, and angiography lights up flowing blood. MRI is best for soft tissue; CT is quicker and better for bone and emergencies.

Laws at work here

The history

From an Irish physicist's wobbling charges in 1897 to 11.7-tesla images of the living brain.

Read the full history
  1. 1938Resonance in a beam of molecules
  2. 1950The spin echo
  3. 1973The first MR image
  4. 1980The first useful patient scan
  5. 2003A Nobel Prize, and a protest
  6. 2024The strongest human MRI

The full explanation

MRIClear, chapter by chapter

Chapter 1

Inside an MRI scanner

A giant magnet that is always on, three coils that tilt its field, and a radio.

An MRI scanner is a huge magnet with a tunnel through it, called the bore. It is about 70 cm wide. You lie on a table that slides you in.

The magnet is made of coils of niobium-titanium wire. Cooled in liquid helium to about 4 K (−269 °C), the wire becomes a superconductor: current flows round it with no resistance at all, so the magnet stays on day and night without a power supply. The helium sits in a giant vacuum flask, the cryostat, and a cold head on top keeps it from boiling away. A clinical magnet makes 1.5 or 3 tesla, roughly 30,000 to 60,000 times Earth's field.

Inside the magnet sit three gradient coils (x, y and z) that tilt the field slightly so the scanner can tell where signals come from. Inside those is the RF body coil, a radio antenna that sends pulses and listens for echoes. A smaller head coil listens closely to your head.

The whole room is a Faraday cage lined with copper, so that taxi radios and FM stations don't leak in. A quench pipe runs to the roof, ready to vent helium gas safely.

Try “Inside the scanner” in the interactive model →

Chapter 2

Your body is full of tiny magnets

Hydrogen nuclei line up, very slightly, and wobble at a radio frequency.

About two thirds of the atoms in your body are hydrogen, mostly in water and fat. The nucleus of a hydrogen atom is a single proton, and a proton behaves like a tiny spinning bar magnet.

Normally these little magnets point every which way, so they cancel out. Put them in a strong field, B₀, and slightly more of them settle pointing along it than against it. Only slightly: at 1.5 T the excess is about 5 in every million. But a millilitre of water holds about 67,000 billion billion protons, so even that tiny excess adds up to a measurable net magnetisation.

The protons don't just line up. Like a spinning top leaning in gravity, each one precesses: it wobbles round the field direction. The wobble rate is the Larmor frequency, and it is set by the field: f = 42.58 MHz per tesla × B₀. That is 63.9 MHz at 1.5 T and 127.7 MHz at 3 T, right among FM radio and aircraft radio.

Try “Spinning protons” in the interactive model →

Chapter 3

A radio pulse, and an echo

Knock the spins over, listen as they fade and recover. Timing sets the contrast.

The scanner sends a short burst of radio waves, an RF pulse, at exactly the Larmor frequency. The spins soak it up, like a swing pushed in time, and their net magnetisation tips over by 90°. Now it spins sideways, and a spinning magnet makes a radio signal in the coil. That is the MR signal.

It doesn't last. Neighbouring spins feel slightly different fields, so they drift out of step and fan out: the signal fades. That is T2 decay. Meanwhile the magnetisation slowly grows back along the field: that is T1 recovery. A second, 180° pulse flips the fan over so the spins catch up with each other and briefly line up again: a spin echo.

Every tissue has its own T1 and T2. Fat recovers fast; the fluid round your brain (CSF) is slow to recover and slow to fade. The operator picks the repetition time TR and the echo time TE. Short TR and short TE make a T1-weighted image: fat bright, fluid dark. Long TR and long TE make a T2-weighted one: fluid bright.

Try “Pulse and echo” in the interactive model →

Chapter 4

How the scanner knows where

Tilt the field, and frequency tells you position. Then a Fourier transform.

If the field were the same everywhere, every proton would sing at the same frequency and the scanner couldn't tell where anything was. So three gradient coils add a gentle slope to the field: a little stronger on one side, a little weaker on the other.

First a gradient along the bore picks one slice: only protons whose frequency matches the RF pulse get tipped over. Then, while the echo is read, a frequency-encoding gradient makes the left side sing lower and the right side higher, like keys on a piano. A brief phase-encoding gradient, different every time, twists the spins up and down the picture.

Each echo fills one line of a grid called k-space. It doesn't look like a body at all. After 128 or 256 lines, a Fourier transform turns it into the picture. The centre of k-space holds the overall brightness and contrast; the edges hold the fine detail.

Switching the gradients on and off thousands of times a second makes the coils shove against the magnet's field (a Lorentz force), so they flex and bang. That's the loud knocking, often above 100 dB, which is why you get earplugs or headphones.

Try “Finding position” in the interactive model →

Chapter 5

The magnet is always on

No X-rays, but a field strong enough to turn a steel cylinder into a missile.

MRI uses no ionising radiation: no X-rays, nothing that can damage DNA. Its risks come from the magnet and the radio waves, and hospitals manage them with strict rules.

The magnet is always on, even at night. Near the bore the field changes very steeply, and anything made of iron or ordinary steel gets yanked in: the projectile effect. A steel oxygen cylinder can fly across the room. So everyone is screened before going in, and equipment is labelled MR Safe, MR Conditional or MR Unsafe. Some pacemakers, implants and metal fragments can move, heat up or stop working, so doctors check each one first.

The radio pulses deposit a little heat in your body. The scanner watches the SAR (specific absorption rate) and keeps it under limits set by the IEC 60601-2-33 standard: 2 W/kg averaged over the whole body in normal mode, and 4 W/kg in first-level mode, which needs closer watching.

In an emergency the magnet can be quenched: its coils are made to stop superconducting, the stored energy heats the helium, and it boils off as a huge cloud of gas that the quench pipe carries out through the roof.

Try “Is it safe?” in the interactive model →

Chapter 6

Watching the brain work

Blood oxygen, water on the move, and flowing blood, all without X-rays.

The same scanner can do far more than take still pictures.

fMRI watches the brain work. Active brain cells need more oxygen, and blood rushes in with more than they use. Blood's haemoglobin is slightly magnetic when it has given up its oxygen, and not when it carries it. So a busy area gets a little brighter, by a few percent, a few seconds later. This is the BOLD signal, discovered by Seiji Ogawa in 1990.

Diffusion MRI measures how far water molecules wander in a few thousandths of a second. In white matter, water moves more easily along nerve fibres than across them, so a computer can trace the brain's wiring: tractography. Diffusion scans also spot a stroke within minutes.

MR angiography makes flowing blood bright, often without any injected dye, to show arteries and aneurysms.

MRI is the best tool for soft tissue: brain, spinal cord, joints, ligaments and many tumours. CT is better and much faster for bone, bleeding after an accident and the lungs, and it takes seconds instead of many minutes.

Try “What MRI can see” in the interactive model →

Test yourself

Frequently asked

Why is the magnet’s wire kept in liquid helium?

So it becomes a superconductor with zero resistance. At about 4 K, niobium-titanium superconducts. The current flows forever without a power supply.

How strong is a 1.5 T scanner compared with Earth’s magnetic field?

About 30,000 times. Earth’s field is about 50 microtesla, so 1.5 T is about 30,000 times stronger.

Why is the scanner room lined with copper?

To keep outside radio signals from spoiling the faint MRI signal. MRI signals are radio waves in the same range as FM radio. The Faraday cage keeps outside radio out.

What in your body does a standard MRI scan detect?

Hydrogen nuclei (protons), mostly in water and fat. Hydrogen is everywhere in soft tissue, and each nucleus is a tiny magnet.

What is the Larmor frequency of protons in a 3 T scanner?

About 128 MHz. 42.58 MHz per tesla × 3 T ≈ 127.7 MHz.

At 1.5 T, roughly how many extra protons in a million line up with the field?

About 5. Body heat jostles them. Only a few per million win, but there are so many protons that it adds up.

What does the 90° RF pulse do?

Tips the net magnetisation sideways so it gives off a radio signal. Tipped sideways, the magnetisation spins round the field and induces a signal in the coil.

On a T2-weighted scan, what does fluid such as CSF look like?

Bright. CSF has a very long T2, so it still has plenty of signal at a long TE.

Why does the signal fade after the pulse?

Spins drift out of step and cancel each other (T2). Each spin feels a slightly different field, so they fan out and their signals cancel.

How do gradient coils tell the scanner where a signal came from?

They make the field vary with position, so frequency depends on position. A sloping field gives each position its own Larmor frequency, like keys on a piano.

You keep only the centre of k-space. What does the picture look like?

Blurry, but with the right brightness and contrast. The centre holds the broad shapes and contrast; the fine detail lives at the edges.

What makes the loud knocking in an MRI scanner?

Gradient coils flexing as their current is switched in the strong field. Current in a magnetic field feels a force. Switched fast, the coils vibrate like a loudspeaker.

Does an MRI scan use ionising radiation like X-rays?

No: it uses a magnetic field and radio waves. MRI uses a strong magnet and radio waves, which don’t damage DNA the way X-rays can.

Why must a steel oxygen cylinder never go into the scanner room?

The magnet is always on and can pull it in with great force. Near the bore, the steep field can pull steel with many times its own weight.

What comes out of the quench pipe during a quench?

Helium gas from the boiling liquid helium. The magnet’s energy boils the liquid helium, and the pipe vents the gas safely outside.

What does the BOLD signal in fMRI actually measure?

Changes in blood oxygen near active brain areas. Deoxygenated haemoglobin is slightly magnetic. Extra oxygen-rich blood reaching busy areas changes the signal.

How does diffusion MRI trace nerve fibres?

Water moves more easily along fibres than across them. The direction water spreads most shows the direction of the fibres.

Which is usually better for a broken bone after a road accident?

CT. CT is fast and shows bone and bleeding clearly. MRI is best for soft tissue.

Words worth knowing

Tesla
The unit of magnetic field strength. Earth's field is about 0.00005 T; hospital scanners are 1.5 or 3 T.
Superconductor
A material that, when cold enough, carries current with zero resistance, so the magnet stays on without a power supply.
Precession
The wobble of a spinning proton round the direction of the magnetic field.
Larmor frequency
How fast protons precess: 42.58 MHz for every tesla of field.
RF pulse
A short burst of radio waves at the Larmor frequency that tips the spins over.
T1 and T2
How quickly magnetisation grows back along the field (T1) and how quickly the sideways signal fades (T2). Every tissue has its own.
Gradient coils
Three coils that make the field vary with position, so the scanner can tell where each signal came from.
k-space
The grid of raw echo data. A Fourier transform turns it into the image.
BOLD
Blood-oxygen-level-dependent signal: the change fMRI uses to see which brain areas are working.

Fork it. Teach with it.

This box is plain HTML, CSS and JavaScript, with no build step and no accounts. Run it yourself and it sends nothing anywhere. The code is MIT. The words, images and videos are CC BY 4.0, so you can reuse them anywhere if you credit “Glassbox, glassbox.how/e/mriclear”.

git clone https://github.com/bdeeps/mriclear.git

Built with three.js (MIT), Geist, Instrument Serif (SIL OFL 1.1).

←→ previous / next box · / search

Would you like to see the full page, with the interactive model?