What Is an X-Ray? How It Works and What It Shows

An X-ray is a type of imaging that uses electromagnetic radiation to create pictures of structures inside your body. It’s the most common and widely available diagnostic imaging tool in medicine, used billions of times each year worldwide to detect everything from broken bones to lung infections. The process is fast, painless, and typically takes between 5 and 30 minutes.

How X-Rays Create an Image

X-rays are a form of energy on the electromagnetic spectrum, similar to visible light but with much shorter wavelengths (between 0.03 and 3 nanometers). Those tiny wavelengths give X-rays the ability to pass through soft materials that visible light cannot penetrate.

When an X-ray beam is aimed at your body, different tissues absorb different amounts of that energy. Dense structures like bone absorb most of the radiation and appear white on the final image. Air-filled spaces like your lungs absorb very little, so they show up black. Soft tissues like muscle, fat, and organs fall somewhere in between, appearing in varying shades of gray. The final image is essentially a shadow map showing where X-rays passed through freely and where they were blocked.

The contrast you see on an X-ray depends on two things: how dense a structure is and how thick it is. A thin piece of metal and a thick section of bone might both appear bright white, for different reasons. This is why X-rays are excellent at distinguishing bone from soft tissue but less useful for telling one soft tissue from another.

What X-Rays Are Used to Diagnose

Bone injuries are the most familiar reason for an X-ray, but the technology is used across nearly every area of medicine:

  • Bone X-rays detect fractures, dislocated joints, arthritis, bone infections, and signs of bone cancer.
  • Chest X-rays look for lung infections like pneumonia, fluid buildup, and congestive heart failure. They’re one of the first tests ordered when someone has chest pain, shortness of breath, or a persistent cough.
  • Abdominal X-rays help evaluate parts of the digestive system and can identify kidney stones or bladder stones.
  • Spine X-rays check for arthritis, scoliosis, and other conditions affecting the vertebrae.
  • Dental X-rays reveal cavities, gum disease, and problems below the gum line that a visual exam would miss.
  • Mammograms are specialized breast X-rays that screen for irregularities that could indicate breast cancer.
  • Head X-rays can identify skull fractures from injuries and conditions affecting skull bone development.

When Contrast Agents Are Needed

Standard X-rays struggle to show soft organs and blood vessels clearly because those tissues absorb radiation at similar rates. To solve this, doctors sometimes use contrast agents, substances that temporarily block X-rays and make specific structures stand out on the image.

Barium-sulfate compounds are the most common contrast material for imaging the digestive tract. You either swallow a barium drink or receive it as an enema, depending on whether the upper or lower digestive tract needs to be examined. The barium coats the lining of the esophagus, stomach, or intestines and makes those structures appear bright white on the X-ray.

Iodine-based contrast materials serve a broader range of purposes. They can be injected into veins or arteries to highlight blood vessels during angiograms, or used to visualize fluid spaces in the spine. In some situations, iodine-based agents are substituted for barium when imaging the digestive tract.

What to Expect During the Procedure

Most X-rays require little to no preparation. You’ll likely be asked to wear a hospital gown and remove jewelry, watches, eyeglasses, and any other metal objects that could interfere with the image. A technologist will position you correctly, which might mean standing in front of the X-ray machine, sitting, or lying on a table. You’ll be asked to hold still for a few seconds while the image is captured, since any movement can blur the picture.

A standard X-ray is completely painless. The entire process, from walking in to walking out, typically takes 5 to 30 minutes depending on how many images are needed and which body part is being examined. If contrast material is involved, the exam takes longer. Fluoroscopy, a type of real-time X-ray that uses contrast to watch how structures move (like barium traveling through your digestive tract), can take 30 minutes to two hours.

Radiation Exposure and Safety

X-rays do involve exposure to ionizing radiation, but the dose from a single diagnostic X-ray is very small. A standard chest X-ray delivers about 0.1 millisieverts of radiation, roughly equivalent to 10 days of the natural background radiation you absorb just from living on Earth. Dental X-rays deliver even less.

For pregnant women, the concern about fetal radiation exposure often comes up. The American College of Obstetricians and Gynecologists states that, with few exceptions, the radiation dose from diagnostic X-rays is much lower than the level associated with fetal harm. When an X-ray is medically necessary during pregnancy, it should not be withheld. Doctors can also coordinate with radiologists to modify techniques and reduce the total dose when possible.

Digital vs. Film X-Rays

Traditional X-rays captured images on photographic film that had to be chemically developed in a darkroom, a process that was slow and sometimes produced inconsistent image quality. Modern digital radiography has largely replaced film. Digital systems use electronic sensors instead of film, displaying images on a computer screen almost instantly. This eliminates waiting time, lets doctors manipulate the image (adjusting brightness or zooming in on a specific area), and makes it easy to share images electronically with specialists.

Digital systems also reduce radiation exposure. Advanced software optimizes the dose needed for each image, delivering less radiation while maintaining diagnostic quality. The shift from film to digital is one of the most significant improvements in X-ray technology since its invention.

X-Rays Outside of Medicine

X-ray technology extends well beyond hospitals. Manufacturers use industrial X-rays to inspect the internal structure of materials without cutting them open. Gas and oil pipelines, metal welds, boilers, vehicle parts, and aircraft components are all routinely X-rayed to detect hidden flaws that could lead to failure. These industrial systems are powered by electricity, so they only produce X-rays when switched on, and they generate very clear images of dense materials. Airport security scanners are another familiar application, using low-dose X-rays to screen luggage for prohibited items.