The HLA-B27 gene has a strong connection with autoimmune disorders. Still, you can carry this variant and maintain flawless health. Knowing your genes and applying personalized health tips makes all the difference – read on and learn how to hack your “autoimmunity gene.”

We have a more personalized version of this blog post. Check out our post on the SelfDecode blog.

What is HLA-B27?

The HLA System

The human leukocyte antigen (HLA) system is a group of human genes encoding the major histocompatibility complex (MHC) proteins, or HLAs. This system has three groups or classes; HLA-B genes, along with HLA-A and HLA-C, belong to the class I [1].

HLAs are proteins or antigens on the surface of white blood cells. They help flag and remove external components that may cause infection. HLA-B antigens bring bacterial or viral proteins from the inside to the cell surface so T-lymphocytes can detect and kill the infected cell [2].

They also have anti-cancer effects and play a role in organ transplant rejection [3, 1].

HLA genes come in many different forms or variants, which enable fine-tuning of your immune system. Their diversity can be a double-edged sword, however, as some types increase the risk of autoimmune disorders [4].

The HLA genes encode proteins (antigens) that bring external components to the surface of white blood cells, enabling your immune system to detect and destroy them.

HLA-B27 Antigen

The HLA-B27 antigen supports antiviral immune response by “flagging” peptides from viruses – such as influenza, HIV, and Epstein-Barr – and presenting them to T-killer cells [5].

The gene for HLA-B27 has over 100 variations. Despite the beneficial roles, HLA-B27 is strongly associated with a group of autoimmune joint disorders known as spondyloarthritis (SpA) [6, 7].

The most common variations associated with autoimmunity are [8]:

  • HLA-B*27:05 (Caucasians/whites)
  • HLA-B*27:04 (Chinese)
  • HLA-B*27:02 (Mediterranean)

On the other hand, HLA-B*27:06 seems to reduce the risk [9].

HLA-B27 enables an antiviral immune response, but certain subtypes also raise the risk of autoimmune disorders.


The prevalence of HLA-B27 varies from 50% in some Indian populations to almost zero in Australian Aborigines. About 6% of the US population carries this variant, which is more common among white people [10].

HLA-B27 and Autoimmune Diseases

Ankylosing Spondylitis (AS)

As mentioned, HLA-B27 greatly increases the risk of certain autoimmune diseases, such as [11]:

  • Psoriasis
  • Ankylosing spondylitis (spine deformation)
  • IBD (inflammatory bowel disease), in combination with spondylitis
  • Reactive arthritis (Reiter’s syndrome) – inflammation of joints, urethra, and eyes

These conditions have a common name spondyloarthritis, the main one being ankylosing spondylitis (AS). In AS, inflammation gradually fuses spine vertebrae, causing back pain and limited movement. It usually affects young men [12, 13].

Doctors treat AS with drugs such as NSAIDs and TNF-inhibitors, but their effectiveness is limited. Besides HLA-B27, other genetic and environmental factors are involved [14, 15, 2].

HLA-B27 raises the risk of autoimmune disorders known under the name spondyloarthritis. The main one is ankylosing spondylitis, which causes spine inflammation and chronic back pain.

What Is The Risk?

The connection between HLA-B27 and ankylosing spondylitis (AS) is among the strongest in the HLA system: 90–95% of all AS patients have this variant. For other conditions, the prevalence ranges between 50-90% [2].

Does this mean almost everyone with HLA-B27 will get AS or another autoimmune disease? Not at all!

Approximately 1.3% European HLA-B27 carriers have AS, though Caucasian (white) ethnicity and the presence of a family member with AS increase the risk 16-20 times [16, 17].

Over 50% of people with anterior uveitis (eye inflammation) have this variant, but only 1% of all HLA-B27 carriers develop uveitis [18].

In other words, HLA-B27 raises the risk of the above disorders, but many more factors contribute and decide which carriers will get them. That’s where our personalized lifestyle and dietary recommendations kick in – stay tuned for the details!

Between 50 and 95% of spondyloarthritis patients have the HLA-B27 variant, but many other factors are involved. You can cut the risk with specific dietary and lifestyle changes.


Despite the well-known connection, it’s still not clear how HLA-B27 provokes autoimmunity. According to the main theories, the error probably occurs in [19, 20, 21, 5]:

  1. The way it binds and presents peptides to T-killer cells: upon activation, T-killer cells can mistakenly flag all HLA-B27 fragments as foreign peptides and attack them
  2. The biochemical properties (structure) of HLA-B27 itself: it can misfold in such a way that causes intracellular inflammation and triggers an immune response

Whatever the root cause, inflammation is the chief mechanism in autoimmune disorders [22].

HLA-B27 Test

Who Should Test?

You may want to do an HLA-B27 test if you [23, 24]:

  • Have chronic pain, stiffness, and inflammation in your joints
  • Have painful eye inflammation (uveitis)
  • The above symptoms began your early adulthood (the 20s or 30s)

Your doctor will order HLA tests if you’re undergoing organ or tissue transplantation [25].

Genetic Variants

The following genetic variants (SNPs) will help determine the chance you’re carrying HLA-B27 [26, 27, 15, 28, 29]:

  • rs4349859 ( “A” allele correlates with HLA-B27, “G” doesn’t)
  • rs13202464 (“G” allele correlates with HLA-B27, “A” doesn’t)
  • rs116488202 (“T” allele correlates with HLA-B27, “C” doesn’t)

Carrying two alleles of HLA-B27 (homozygosity) doesn’t increase your risk of autoimmune diseases, compared with one allele [16].

Please note: To confirm the presence of this variant and detect the exact subtype, you may want to do the HLA-B27 blood test.

Other tests

The following tests and lab markers can help detect inflammation and diagnose an autoimmune disease [30, 31, 32, 33]:

If you’ve started experiencing joint pain and stiffness in early adulthood, you may want to test for the HLA-B27 variant and check lab markers of autoimmunity and inflammation.

Autoimmunity Triggers

As mentioned, HLA-B27 is just a link in the chain of risk factors that contribute to spondyloarthritis; scientists have discovered other genes and triggers.


Besides the major player, HLA-B27, other HLA variants may contribute to ankylosing spondylitis; these include HLA-B60 and HLA-DR1 [34, 35].

Variations in non-HLA genes associated with ankylosing spondylitis include [36, 37, 38, 39, 40]:

We have compiled a list of genetic traits associated with ankylosing spondylitis.

Microbiome and Infections

A solid body of evidence voices the role of the microbiome in spondyloarthritis [41, 42, 43].

Microbial infections can trigger autoimmune disorders by disturbing the gut probiotics, the guardians of your immunity. Reactive arthritis (previously known as Reiter’s syndrome) is associated with the following infections [44, 45, 46]:

  • Salmonella
  • Shigella
  • Yersinia
  • Chlamydia
  • Mycobacteria
  • Klebsiella

Klebsiella infection is a crucial trigger of autoimmune joint and gut disorders, especially in HLA-B27 carriers [47, 48].


Other factors that may contribute to autoimmune diseases include:

  • C-section delivery [49]
  • Antibiotics [50, 51]
  • Environmental toxins [52]
  • Sleep deprivation [53, 54]
  • Stress [55]

Besides HLA-B27, factors that contribute to autoimmunity include other genes, microbiome impairment, toxins, sleep deprivation, stress, and persistent infections.


Do you belong to a fraction of people with the HLA-B27 variant? Instead of desperately concluding that autoimmunity “runs in your family,” you can hack your genes with personalized dietary and lifestyle changes.


You might be fueling inflammation and autoimmune disorders with your diet! The Lectin Avoidance Diet has a powerful program to help you detect and eliminate foods that are pro-inflammatory for you (hint: it’s not just about lectins).

Given the role of the microbiome and bacterial infections in autoimmunity triggered by HLA-B27, make sure to boost your gut health by:

Klebsiella is one of the autoimmunity triggers, and it thrives on sugar and starch. To cut your risk of infection, reduce the intake of sweets and refined carbs [56, 57, 58].

Zinc and copper-rich foods such as organ meats, seafood, seeds, and cocoa will support your immune system, reduce inflammation, and improve gut health [59, 60, 61].

Intermittent or other types of fasting can stimulate autophagy and combat autoimmunity [62, 63].

Try The Lectin Avoidance Diet; cut back on sugar and starch; eat foods rich in probiotics, prebiotics, zinc, and copper; practice intermittent or other types of fasting.


To keep inflammation in check and prevent autoimmune disorders, try to:


The following supplements may help with ankylosing spondylitis and autoimmunity in general by supporting your immune system and reducing inflammation:

Additional Resources

To get personalized and step-by-step guidance, check out SelfDecode Wellness Reports; they cover inflammation, sleep, fitness, and other essential topics for health optimization.

SelfDecode is a sister company of SelfHacked. The proceeds from your purchase of this product are reinvested into our research and development, in order to serve you better. Thank you for your support.

Click here to subscribe


1 Star2 Stars3 Stars4 Stars5 Stars
(1 votes, average: 1.00 out of 5)

FDA Compliance

The information on this website has not been evaluated by the Food & Drug Administration or any other medical body. We do not aim to diagnose, treat, cure or prevent any illness or disease. Information is shared for educational purposes only. You must consult your doctor before acting on any content on this website, especially if you are pregnant, nursing, taking medication, or have a medical condition.