What Does the Thymus Do? Immune Training Explained

The thymus is a small organ in your chest that trains your immune system to fight infections without attacking your own body. It does this by producing and educating T-cells, a type of white blood cell that’s central to your immune defense. Without a functioning thymus, your body would either be unable to fight off infections or would turn its immune system against its own tissues.

Where the Thymus Sits

The thymus is located directly behind your breastbone, in an area called the mediastinum. It sits in front of the heart’s protective sac and behind the sternum, with the great blood vessels and trachea running just behind it. In some people, the upper portion extends upward toward the thyroid gland in the neck. It’s a two-lobed organ that meets near the top of the breastbone, and each lobe is divided into an outer layer (the cortex) and an inner layer (the medulla), each with a distinct role in T-cell development.

How the Thymus Trains Your Immune System

The thymus is essentially a boot camp for T-cells. Immature immune cells produced in bone marrow travel to the thymus, where they go through a rigorous two-step screening process. Only cells that pass both tests are released into the bloodstream. The rest, roughly 95% of them, are destroyed.

The first test is called positive selection. Here, developing T-cells must prove they can recognize molecules on your own cells. If a T-cell’s receptor can’t interact with these molecules at all, it’s useless for immune defense and dies from lack of stimulation. Think of it as checking whether a new recruit can even hold a weapon.

The second test, negative selection, is more ruthless. T-cells that react too strongly to the body’s own proteins are eliminated. Specialized cells in the thymus’s inner layer display a wide sampling of normal body proteins, and any T-cell that attacks them aggressively is killed within hours through a rapid self-destruct process. The difference between passing and failing is remarkably slim: the binding strength of a T-cell that gets destroyed is barely higher than one that’s allowed to survive. This razor-thin threshold is what keeps your immune system both effective and safe.

Some T-cells fall into a middle zone, binding to self-proteins with moderate intensity. Rather than being killed, these cells are converted into regulatory T-cells, a special class that actively suppresses immune attacks against your own tissues. This is one of the thymus’s most important contributions: it doesn’t just remove dangerous cells, it creates a dedicated peacekeeping force.

Once T-cells pass both checkpoints, they respond to a chemical signal that guides them out of the thymus and into the bloodstream. If cells leave too early, before selection is complete, they can trigger autoimmune disease.

Hormones the Thymus Produces

Beyond its immune training role, the thymus functions as an endocrine gland. It produces several hormones that support immune function throughout the body. Thymopoietin fuels the production of T-cells and signals the pituitary gland to release other hormones. Thymosin and thymulin help generate specialized types of T-cells. A substance called thymic humoral factor helps keep the broader immune system functioning properly. These hormones circulate through the bloodstream and influence immune activity far beyond the thymus itself.

How the Thymus Changes With Age

The thymus is at its largest during puberty, when it weighs between 20 and 50 grams. After that, it steadily shrinks in a process called involution. The functional tissue that produces and trains T-cells is gradually replaced by fat cells, beginning as early as the first year of life and continuing at a rate of about 3% per year throughout adulthood. By later life, the thymus may weigh only 5 to 15 grams, and much of that is fatty tissue rather than active immune tissue.

This shrinkage is one reason older adults have weaker immune responses. The thymus produces fewer new T-cells as it declines, meaning the body relies increasingly on its existing supply of mature T-cells rather than generating fresh ones. It still works, just at a fraction of its youthful capacity.

What Happens Without a Thymus

People born without a thymus, a condition called congenital athymia, have a severe immune deficiency. They typically have fewer than 50 naive T-cells per cubic millimeter of blood, while their B-cells and natural killer cells remain at normal levels. This leaves them dangerously vulnerable to bacterial, viral, and fungal infections, often within the first few months of life. Pneumonia and gastrointestinal infections are especially common, along with life-threatening opportunistic infections that a healthy immune system would easily handle.

Paradoxically, having no thymus also leads to autoimmune problems. Without proper T-cell screening, the few T-cells that do develop outside the thymus can expand uncontrollably and attack the body’s own organs. Patients often develop a characteristic rash, liver inflammation, and intestinal damage. Autoimmune thyroid disease and certain blood disorders are also common. The thymus, it turns out, is just as important for preventing the immune system from being overly aggressive as it is for making it effective.

Congenital athymia is most often associated with complete DiGeorge syndrome, a genetic condition that disrupts development of several structures in the chest and neck. A rarer cause is a deficiency in a specific gene (FOXN1) needed for thymus formation.

The Thymus and Myasthenia Gravis

The thymus plays a central role in a condition called myasthenia gravis, which causes progressive muscle weakness. In most patients with this disease, the thymus is abnormal. About 9 out of 10 show an overgrowth of immune tissue in the thymus, and some develop a thymus tumor called a thymoma.

The connection comes down to a case of mistaken identity. The thymus contains muscle-like cells that produce a protein also found at the junction between nerves and muscles. In myasthenia gravis, the thymus appears to mistakenly train T-cells to attack this protein. Research on thymus tissue from myasthenia gravis patients found that all 10 samples in one study contained T-cells specifically targeting the nerve-muscle junction protein, while only 3 of those same patients had similar reactive T-cells in their blood. This suggests the thymus itself is where the autoimmune response begins.

Thymus Transplantation

For children born without a thymus, transplantation is an option that can rebuild the immune system. Donor thymus tissue comes from infants under 9 months old (typically tissue removed during unrelated heart surgery), and remarkably, matching blood type or tissue type between donor and recipient isn’t required.

Outcomes are encouraging: over 70% of transplant recipients survive. New naive T-cells typically appear 3 to 5 months after the procedure, and recipients can eventually stop taking preventive antibiotics and supplemental immune proteins. The most common complications afterward are infections during the waiting period before the new thymus takes effect, along with thyroid problems and other autoimmune conditions. It remains an investigational treatment, but for children who would otherwise face life-threatening infections from infancy, it can be transformative.