Thymus Gland: Function, T Cell Development, and Aging

The thymus is a small organ behind your breastbone that serves as the training ground for T cells, the white blood cells responsible for recognizing and attacking infections, cancers, and foreign tissues. Despite its modest size, the thymus performs one of the most consequential jobs in the immune system: it takes immature cells from the bone marrow and transforms them into a diverse army of defenders while weeding out any that would mistakenly attack your own body. What makes the thymus unusual is that it starts shrinking early in life, gradually replacing its working tissue with fat, which has led researchers to investigate whether reversing that decline could strengthen immunity in older adults.

Where It Sits and What It Looks Like

The thymus sits in the upper chest, just behind the sternum and in front of the heart, in a space called the anterior mediastinum. In a newborn it is relatively large compared to body size, sometimes weighing around 30 grams. It reaches its maximum size around puberty, after which it begins to shrink. The organ has two lobes, and each lobe is divided into smaller compartments called lobules. Within every lobule there are two distinct zones. The outer layer, known as the cortex, is densely packed with immature T cells undergoing the early stages of development, supported by a smaller number of specialized epithelial cells. The inner region, the medulla, contains larger, more mature T cells and a greater proportion of epithelial and other cell types that carry out later stages of quality control.

One feature that often surprises people is that the thymus has its own version of a security perimeter. The cortex maintains a blood-thymus barrier, a tight boundary between the bloodstream and the thymic tissue. Research in mice has shown that a protein called claudin-5, expressed in thymic blood vessels, is critical for establishing this barrier. When claudin-5 is absent, tracer molecules from the blood leak freely into the cortex, demonstrating that the barrier has broken down.1International Immunology. Selective expression of claudin-5 in thymic endothelial cells regulates the blood–thymus barrier and T-cell export This barrier likely exists to shield developing T cells from premature exposure to substances circulating in the blood, which could disrupt their education.

How the Thymus Trains T Cells

Immature cells arrive in the thymus from the bone marrow as precursors that carry no functional T cell receptor. Once inside the thymus, these precursors go through an elaborate sequence of gene rearrangement to generate a receptor, and then face two rounds of testing. The first round, called positive selection, happens in the cortex. Cells that can interact with self-molecules presented by cortical epithelial cells receive a survival signal; those that cannot are discarded. This step ensures that every T cell entering the bloodstream can, at minimum, recognize the body’s own tissue-labeling molecules, which it will later need to detect infected or abnormal cells. Researchers have proposed that the linkage between self-recognition and the ability to respond to foreign molecules is what allows a limited number of T cells to cover a vast range of unpredictable threats.2PubMed Central. Revisiting thymic positive selection and the mature T cell repertoire for antigen

The second round, negative selection, takes place mainly in the medulla and tackles the opposite problem. Any T cell whose receptor binds too strongly to the body’s own proteins is dangerous, because it could trigger an autoimmune attack once released. These overly self-reactive cells are either killed or converted into regulatory T cells that will suppress immune responses rather than provoke them. Both internal properties of the developing T cell and signals from the surrounding environment are required to make this culling work.3PubMed. The why and how of thymocyte negative selection

The AIRE Gene and Self-Antigen Display

A key puzzle in negative selection is how the thymus can test T cells against proteins they might encounter in distant organs like the pancreas, the eye, or the thyroid. The answer involves a gene called AIRE (Autoimmune Regulator). AIRE drives medullary epithelial cells to produce small amounts of proteins that are normally found only in specific tissues elsewhere in the body. This means developing T cells can be screened against, say, insulin or thyroglobulin right there in the thymus, without ever leaving the chest.4PubMed Central. AIRE in the thymus and beyond When AIRE does not function properly, the consequences are severe: both humans and mice with disrupted AIRE develop spontaneous autoimmune disease, because self-reactive T cells slip through unchecked.5PubMed Central. Aire and T cell development

Regulatory T Cells Born in the Thymus

Not every self-reactive T cell is simply destroyed. Some are redirected into becoming regulatory T cells, a specialized population whose job is to dampen excessive immune responses throughout the body. The thymus generates these cells using many of the same self-antigens involved in negative selection, and the process depends on signals from antigen-presenting cells within the thymic tissue as well as specific cytokines produced locally.6PubMed Central. Regulatory T Cell Development in the Thymus A healthy population of thymic-derived regulatory T cells is essential for preventing autoimmunity and maintaining immune balance in the rest of the body.

Why the Thymus Shrinks With Age

One of the most distinctive features of the thymus is that it begins involuting, or shrinking, well before old age. The process starts after puberty and continues steadily throughout life. Active thymic tissue is progressively replaced by fatty tissue, and the organ’s ability to produce new T cells drops accordingly. The decline in naive T cell output is thought to contribute to the narrower T cell diversity seen in older individuals, which has been linked to increased vulnerability to infections, autoimmune disease, and cancer.7PubMed Central. The effect of age on thymic function

What actually drives this involution involves several interacting factors. Hormonal shifts play a role, particularly the rise in sex steroids during puberty. Chronic, low-grade inflammation that accumulates with aging also contributes. These changes disrupt the communication between developing T cells and the thymic epithelial cells that support them, and that cross-talk is central to everything the thymus does.8PubMed Central. Age-related thymic involution: Mechanistic insights and rejuvenating approaches to restore immune function This is not a sudden collapse but a gradual erosion. Even in middle age, the thymus retains small islands of functional tissue, and some new T cells continue to be produced, just at a fraction of the childhood rate.

When the Thymus Goes Wrong

Because the thymus sits at the center of T cell development and self-tolerance, problems with it tend to have outsized consequences. Three categories of thymus-related disease come up most often in clinical medicine: developmental defects, tumors, and autoimmune conditions rooted in thymic dysfunction.

DiGeorge Syndrome

DiGeorge syndrome results from a deletion on chromosome 22 and causes the thymus to develop incompletely or, in rare cases, not at all. The resulting thymic hypoplasia impairs T cell development and maturation, leading to reduced T cell numbers, a restricted range of T cell receptors, and defects in regulatory T cells.9PubMed. From Thymic Hypoplasia to Immune Reconstitution: An Immunological Review of DiGeorge Syndrome The practical effects vary widely. Some individuals have mild immune deficiency and live relatively normal lives, while others face recurrent respiratory infections, a higher rate of autoimmune conditions, and poor responses to vaccination. Reduced antibody production and weak vaccine-specific responses can also occur, because T cells help orchestrate the antibody-producing arm of the immune system as well.10PubMed. Immune and Genetic Features of the Chromosome 22q11.2 Deletion (DiGeorge Syndrome)

Thymomas and Autoimmunity

Thymomas are tumors that arise from the epithelial cells of the thymus. They are uncommon, but what makes them medically distinctive is their strong association with autoimmune disease. Roughly 30% to 50% of patients with thymic epithelial tumors develop at least one autoimmune condition.11PubMed. Management of Autoimmune Conditions Associated With Thymic Epithelial Tumors Myasthenia gravis is the most common, but the list of associated conditions is strikingly broad, ranging from pure red cell aplasia and Good’s syndrome (a combined immunodeficiency) to neurological, dermatological, and endocrine autoimmune disorders.12PubMed Central. Autoimmune disorders and paraneoplastic syndromes in thymoma The prevailing explanation is that the tumor disrupts normal self-tolerance mechanisms, allowing self-reactive T cells to escape into the body.13PubMed Central. Thymoma and autoimmunity

The Thymus in Myasthenia Gravis

Myasthenia gravis deserves its own mention because the thymus is so central to the disease. In many patients with early-onset myasthenia gravis, the thymus shows a characteristic pattern called lymphofollicular hyperplasia, where the organ develops organized clusters of immune cells resembling what you would normally see in a lymph node. These hyperplastic thymuses display features of what immunologists call tertiary lymphoid organs: new blood vessel formation, overexpression of chemical signals that recruit immune cells from the periphery, and development of germinal centers where antibody-producing cells mature.14PubMed. Thymus involvement in early-onset myasthenia gravis Researchers have isolated T cells from myasthenic thymuses that specifically target the nicotinic acetylcholine receptor, the same molecule attacked in the disease, supporting the idea that the autoimmune response in myasthenia gravis is initiated within the thymus itself.15PubMed Central. Thymus in myasthenia gravis. Isolation of T-lymphocyte lines specific for the nicotinic acetylcholine receptor from thymuses of myasthenic patients This is why thymectomy, or surgical removal of the thymus, has been used as a treatment for myasthenia gravis for decades.

Viral Infections and the Thymus

The thymus is not immune to infection itself. Several viruses can infect the thymus directly, and when they do, the consequences extend beyond the organ. By inducing functional changes within the thymus, viral infections can alter the behavior of mature T cells circulating in the body.16PubMed Central. Insights into Thymus Development and Viral Thymic Infections HIV is the most well-known example. The virus can infect developing T cells and thymic epithelial cells, compounding the immune destruction it causes elsewhere. But other viruses, including cytomegalovirus and measles, have also been shown to affect the thymus. In children, thymic damage from infection can be particularly consequential because the organ is still actively building the T cell repertoire. This is one reason severe viral infections in early life can leave lasting marks on immune function.

Sex Hormones and the Thymus

The relationship between sex hormones and the thymus runs deep. Rising levels of androgens and estrogens during puberty are considered one of the main triggers for the onset of thymic involution. But the interplay is most dramatic during pregnancy. Pregnancy causes a major, though temporary, shrinkage of the thymus, driven by progesterone. Research in mice has demonstrated that this is not just a side effect but appears to be functionally important: mice transplanted with a thymus lacking the progesterone receptor had smaller litters and more failed pregnancies compared to those with a normal thymus.17Scientific Reports. Sex hormones have pervasive effects on thymic epithelial cells The implication is that suppressing thymic function during pregnancy helps prevent the mother’s immune system from rejecting the fetus, which carries foreign paternal proteins. After delivery, the thymus bounces back. The cortical epithelial cells appear to have a high renewal capacity that allows females to recover adequate thymic function quickly in the postpartum period.

Beyond puberty and pregnancy, there is a broader hormonal circuitry at work. Cytokine production and the thymus’s own hormonal output are influenced by hormones from the pituitary and other endocrine glands. In return, peptides produced within the thymus can modulate hormonal production elsewhere in the body, creating a two-way feedback loop between the immune system and the endocrine system.18Endocrine Reviews. Neuroendocrine Control of Thymus Physiology This cross-talk helps explain why immune function shifts so noticeably during hormonal transitions like puberty, pregnancy, and menopause.

Efforts to Regenerate or Rebuild the Thymus

Given that thymic shrinkage contributes to the weakening of immunity with age, there has been growing interest in strategies to regenerate or replace the organ. Several approaches are now being explored. Some target the hormonal drivers of involution directly: blocking sex steroids can partially reverse thymic atrophy in animal models, and growth hormone and its downstream mediator IGF-1 have shown promise in stimulating thymic regrowth. Cytokine-based therapies using interleukin-7 and interleukin-22 aim to boost T cell development within existing thymic tissue.19PubMed Central. Thymus: the next (re)generation More recent work has expanded the toolkit to include mTOR inhibitors (drugs that modulate cellular metabolism and aging pathways), stem cell and gene therapies, and tissue engineering.20PubMed. Thymus regeneration in countering immunosenescence: Mechanisms, strategies and future perspectives

On the tissue-engineering front, researchers have reported creating artificial human thymus tissue from induced pluripotent stem cells. By combining stromal cells derived from these stem cells with scaffolds made from extracellular matrix material, they built three-dimensional organoids capable of supporting T cell development in the lab.21PubMed Central. A tissue-engineered artificial human thymus from human iPSCs to study T cell immunity This kind of platform is still primarily a research tool rather than a clinical therapy, but it opens the door to generating T cells outside the body for patients whose own thymus has been removed, destroyed by disease, or diminished by age. For conditions like DiGeorge syndrome, where the thymus never developed properly, the possibility of transplanting engineered thymic tissue could eventually offer a path to immune reconstitution that does not exist today.

The Thymus Across the Animal Kingdom

The thymus is not a mammalian invention. It appears across all jawed vertebrates, from sharks and bony fish to birds and mammals, making it one of the oldest dedicated immune organs in existence. In bony fish like zebrafish and trout, the thymus is typically a paired organ located near the gills rather than in the chest, but it performs the same fundamental job of T cell education.22PubMed Central. Revisiting the Teleost Thymus: Current Knowledge and Future Perspectives Even lampreys, which are jawless fish and among the most ancient surviving vertebrates, appear to have a primitive thymus-like structure, providing strong evidence that T cells and the thymus co-evolved very early in vertebrate history.23PubMed. Evolution of thymus organogenesis

This evolutionary conservation tells us something about how important the organ’s function is. Adaptive immunity, the ability to recognize and remember specific pathogens, depends on having a diverse and self-tolerant population of T cells, and the thymus is the only organ that has evolved to produce one. Invertebrates, which lack a thymus entirely, rely on innate immune defenses that are effective but cannot adapt to new threats with the same precision. The appearance of the thymus in early vertebrates likely marked a turning point in the arms race between hosts and pathogens, enabling the kind of targeted, long-lasting immune responses that make vaccination and immunological memory possible.