Bacteria living on your skin are almost certainly the reason. Your apocrine sweat glands, concentrated in areas like the armpits and groin, secrete an odorless fluid that skin bacteria feast on and convert into sulfur-containing compounds with a distinctly onion-like smell. Showering washes away surface bacteria and old sweat, but the microbes responsible for the odor live deep enough in hair follicles and skin folds that they bounce back within hours, and the cycle starts again.
The Sulfur Compounds Behind the Onion Smell
The smell is not actually coming from your sweat. Apocrine glands produce a milky, odorless secretion that contains water-soluble precursor molecules. These precursors sit harmlessly on the skin until bacteria get to them. When researchers collected apocrine secretion directly from volunteers and then exposed it to bacteria taken from armpit skin, they found the bacteria converted those precursors into volatile acids, confirming that the odor is a byproduct of bacterial metabolism, not the sweat itself.1Journal of Chemical Ecology. An investigation of human apocrine gland secretion for axillary odor precursors
The most pungent molecules in this process are sulfur compounds, especially a thioalcohol called 3-sulfanyl-3-methyl-hexan-1-ol. Sulfur is the element that makes garlic, onions, and leeks smell the way they do, and these bacterial waste products share that same sharp, allium-like quality. Alongside the sulfur compounds, bacteria also produce carboxylic acids such as 3-methyl-2-hexenoic acid and 3-hydroxy-3-methyl-hexanoic acid, which add a more sour or “sweaty” note. Interestingly, these particular acids have not been found in other species and appear to be unique to human body odor.2PubMed Central. The specific biochemistry of human axilla odour formation viewed in an evolutionary context
One bacterial species stands out as the biggest contributor. Staphylococcus hominis, which thrives in human armpits, uses two enzymes to snip apart the odorless precursor molecule and release a thioalcohol called 3M3SH, a potent sulfur compound your nose detects at extremely low concentrations.3PubMed. Discovery of a C-S lyase inhibitor for the prevention of human body malodor formation So when you catch a whiff of onions from your own body, what you’re actually smelling is the metabolic output of bacteria that specialize in breaking sulfur bonds.
Why Showering Only Gives Temporary Relief
If the smell comes from bacteria, you might assume scrubbing them away should solve the problem. It helps, but the fix is temporary because bacteria don’t just sit on the skin surface waiting to be rinsed off. Many of the microbes responsible for body odor reside inside hair follicles, where soap and water have limited reach. Research on how showering affects the body’s microbiome found that certain microbial communities, especially those living in and around hair follicles, remain remarkably stable even after washing, because the follicle itself acts as a protected reservoir.4PubMed Central. Understanding the microbial basis of body odor in pre-pubescent children and teenagers
Within hours of a shower, the surviving bacteria in those follicles repopulate the skin surface. Meanwhile, fresh apocrine secretion begins flowing again, especially if you’re physically active or under stress. The combination of renewed precursor supply and a quickly rebounding bacterial population means the onion smell can return well before your next shower. This is also why antibacterial soaps sometimes work better than regular soap for body odor: they reduce the bacterial population a bit more aggressively, buying extra time before the smell comes back.
There’s another piece to this puzzle. Odor-causing compounds can also accumulate in the body from diet, the specific composition of your skin’s bacterial community, and even from reduced clearance by the liver and kidneys.5PubMed Central. Microbiota and Malodor-Etiology and Management A shower addresses what’s on the skin surface, but it does nothing about odorants still circulating inside the body or about to be secreted from within.
When Your Diet Makes Things Worse
If the onion smell gets noticeably stronger after certain meals, the food itself may be contributing. Garlic, onions, shallots, leeks, and other members of the allium family are rich in sulfur-containing compounds. When you eat them, your body metabolizes those compounds, and some of the volatile byproducts are excreted not just in your breath but also through your sweat and urine.6PubMed Central. Quantification of Volatile Metabolites Derived From Garlic (Allium sativum) in Human Urine So even if the bacterial side of the equation stayed the same, eating a garlic-heavy dinner can push more sulfur-containing molecules through your skin, layering an extra onion-like note onto the odor your bacteria are already producing.
Cruciferous vegetables like broccoli, cauliflower, and cabbage contain sulfur compounds too, though typically less pungent ones. Spices like cumin and fenugreek can also alter body odor for a day or two after a large enough serving. The effect tends to peak roughly twelve to forty-eight hours after eating, depending on how quickly your body processes the meal, and then fades. If you notice the onion smell worsening on a regular schedule, keeping a loose food diary for a week or two can help you pin down whether a specific dietary pattern is amplifying the problem.
Genetics Determine Your Baseline
Not everyone produces the same amount of body odor, and a single gene explains much of the difference. The ABCC11 gene encodes a protein that acts as a pump in apocrine sweat glands, pushing odor precursors out of the gland and onto the skin. A particular version of this gene, carrying the G allele, is needed for the gland to secrete the amino-acid conjugates that bacteria later convert into those sulfur compounds and volatile acids. Researchers found that having this allele is essentially a prerequisite for producing typical axillary odor.7PubMed Central. A strong association of axillary osmidrosis with the wet earwax type determined by genotyping of the ABCC11 gene
A common variant of the gene, where a single nucleotide changes from G to A, causes a near-complete loss of the typical odor components in sweat. People who carry two copies of this variant produce dramatically less of the precursors that bacteria need, and the resulting body odor is faint or absent. This variant is especially common in East Asian populations, which is why rates of clinically significant body odor differ so much across ethnic groups.8PubMed. A functional ABCC11 allele is essential in the biochemical formation of human axillary odor One survey found that clinically notable bromhidrosis affects roughly 6% of Chinese individuals, compared to around 90% of people of European descent.9PubMed Central. Advances in the treatment of axillary bromhidrosis
There’s a quirky practical clue here: the same ABCC11 gene also controls earwax type. The allele associated with stronger body odor produces wet, sticky earwax, while the low-odor variant produces dry, flaky earwax. If you have wet earwax, your apocrine glands are likely pumping out more of the precursors that bacteria love, and that partly explains why the onion smell is harder for you to shake than it is for someone with dry earwax.
Stress Sweat Smells Different From Exercise Sweat
You have two main types of sweat glands. Eccrine glands cover most of your body and produce the watery, salty sweat that cools you during a run or on a hot day. This sweat is mostly water and salt, and it doesn’t smell like much on its own. Apocrine glands are a different story. They’re clustered in the armpits, groin, and around the nipples, and they respond to emotional stress, anxiety, and hormonal signals rather than just heat.
When you’re nervous before a presentation or stressed about a deadline, your apocrine glands activate and release a thicker, protein-rich secretion. This is the secretion packed with the precursors that bacteria convert into sulfur compounds. Research on the enzyme activity inside apocrine glands has found that they contain a specific type of enzyme, type I 5-alpha reductase, which processes steroid hormones and influences the gland’s secretory output.10British Journal of Dermatology. Predominance of type I 5alpha-reductase in apocrine sweat glands of patients with excessive or abnormal odour derived from apocrine sweat (osmidrosis) In people diagnosed with osmidrosis, a condition of particularly strong body odor, this enzyme is notably active.
The practical takeaway: a stressful day can make you smell worse than a hard workout, because stress activates the glands that produce the most odor-friendly sweat. If you notice the onion smell is worst on high-anxiety days rather than gym days, this is likely why.
Your Clothes May Be Holding Onto the Smell
Sometimes the onion smell you catch after a shower isn’t coming from your body at all. Synthetic fabrics like polyester and nylon are known to harbor odor-causing bacteria more stubbornly than cotton or wool. The structure of synthetic fibers gives bacteria places to cling, and standard washing cycles don’t always kill or remove them completely. If you put on a freshly laundered polyester shirt and notice the smell returning within an hour, the shirt itself may be the reservoir.
A few things help: washing workout clothes with a sports-specific detergent or adding white vinegar to the rinse cycle, drying clothes in direct sunlight when possible (UV light kills bacteria), and switching to natural-fiber clothing for the items worn closest to odor-prone areas. Some people find that no amount of showering fixes the problem until they replace old gym shirts that have built up layers of bacterial residue in the fabric.
When Persistent Body Odor Points to Something Medical
For most people, the onion smell is a normal product of healthy skin bacteria doing their thing. But if the smell is unusually strong, doesn’t respond to any of the measures above, or has changed suddenly, it’s worth considering whether a metabolic or medical issue could be involved.
Trimethylaminuria is the most well-known metabolic cause of persistent body odor. People with this condition have a deficiency in a liver enzyme that normally converts trimethylamine, a foul-smelling compound produced during digestion, into an odorless form. Without adequate conversion, trimethylamine builds up and gets excreted in sweat, breath, and urine, producing a strong smell often described as fishy but sometimes perceived as more generally “off.”11PubMed. Treatments of trimethylaminuria: where we are and where we might be heading While the classic description is a fish-like odor, perception of smells varies from person to person, and some people with milder forms notice a sulfurous or onion-like quality instead.
Other medical conditions that can alter body odor include poorly controlled diabetes, which can produce a fruity or acetone-like smell; kidney disease, which can cause an ammonia-like odor as waste products build up in the body; and liver disease, which can impair the normal clearance of odor-causing metabolites.5PubMed Central. Microbiota and Malodor-Etiology and Management Hormonal shifts during puberty, pregnancy, and menopause can also change the volume and composition of apocrine secretion, sometimes dramatically enough that a person notices a new or different body odor seemingly out of nowhere.
If your body odor has changed recently and you can’t explain it through diet, stress, or hygiene, it’s reasonable to bring it up with a doctor. A basic metabolic panel and a conversation about your symptoms can rule out the more concerning causes.
What Actually Helps Reduce the Smell
Understanding the mechanism points toward the most effective strategies. Since the odor is produced by bacteria acting on apocrine secretion, you can target either side of that equation: reduce the bacteria, reduce the secretion, or both.
Antiperspirants are more effective than deodorants for this purpose, and the difference matters. Deodorants are typically alcohol-based and mainly mask odor or provide a mild, short-lived antibacterial effect. Antiperspirants contain aluminum-based salts that form a physical plug in the sweat duct, reducing the flow of apocrine secretion that bacteria feed on. Research comparing the two found that antiperspirants had a much stronger effect on reducing armpit bacterial populations, while deodorants had a more modest impact if any.12PubMed Central. The effect of habitual and experimental antiperspirant and deodorant product use on the armpit microbiome If you’ve been using deodorant alone and still smelling like onions, switching to an antiperspirant or a combination product could make a real difference.
Applying antiperspirant at night rather than in the morning can also help, because your sweat glands are less active during sleep, which allows the aluminum salts to form a better seal before the morning rush of sweat begins. Other tactics that address the bacterial side include using a benzoyl peroxide wash on the armpits a few times a week, which kills odor-causing bacteria more effectively than regular soap, and keeping armpit hair trimmed, since hair increases the surface area where bacteria can colonize and makes it harder for topical products to reach the skin.
For people whose odor is strong enough to affect daily life and doesn’t respond to over-the-counter measures, dermatologists can offer prescription-strength aluminum chloride solutions, botulinum toxin injections to temporarily shut down sweat glands, and in severe cases, surgical procedures to remove or destroy apocrine glands. These options exist specifically because the problem is well understood at a biological level, even if it remains frustrating at the day-to-day level.
Why Humans Evolved to Smell This Way
It might seem like an evolutionary oversight to produce a body part whose main output is a sulfurous stink. But the human armpit’s unique chemistry appears to be anything but accidental. The volatile acids that dominate human axillary odor, including 3-methyl-2-hexenoic acid and 3-hydroxy-3-methyl-hexanoic acid, have not been identified in any other species, suggesting they evolved specifically in humans or our close ancestors.2PubMed Central. The specific biochemistry of human axilla odour formation viewed in an evolutionary context The relationship between our skin bacteria and our apocrine glands looks less like a hygiene failure and more like a signaling system that got co-opted over millions of years.
In many mammals, body odor carries information about genetic compatibility, hormonal status, and individual identity. While modern humans do everything they can to suppress these signals with soap and fragrance, the underlying biology still works. Research has shown that people can identify their own family members by smell, that women’s preferences for male body odor shift across the menstrual cycle, and that stress-induced sweat triggers different emotional responses in people who smell it compared to exercise-induced sweat. None of this means you should stop showering, but it does explain why the system is so persistent. The bacteria, the sweat, and the resulting smell were never a bug. For your distant ancestors, they were a feature.