The shirt came back from a wedding in June and went straight into the closet. I did not look at it closely until October, when I pulled it out for another event. Under the arms, the white had turned the specific pale yellow that means the stain has been sitting there for months and been through at least three wash cycles without anyone noticing. I had four days until the event. I treated it that night with the wrong thing first (chlorine bleach, because it was white and I was not thinking) and woke up to find the yellow had intensified rather than cleared.
That is when I learned that sweat stains on white shirts operate by entirely different chemistry than what most cleaning instincts suggest, and that the instinctive move of reaching for bleach is exactly what makes this stain worse. White shirts do get a specific advantage over colored garments: the treatments that are off-limits on dyed fabric (hydrogen peroxide, lemon juice, direct sunlight) are fully available here. But you have to use them correctly and in the right order.

The Short Answer:
To get sweat stains out of a white shirt: soak the stained area in a solution of one cup white vinegar and two cups of warm water for 30 minutes. Then apply a paste of two parts hydrogen peroxide, one part baking soda, and one part water directly to the stain. Let it sit for 30 to 60 minutes. Wash on the hottest cycle safe for the fabric and air dry to confirm the stain is gone before using the dryer.
Never use chlorine bleach on sweat stains. It reacts with the protein components in sweat and can intensify the yellow color rather than removing it.

Why White Shirts Yellow at the Armpits
The yellow color is not from sweat alone. Sweat itself is mostly water, salt, and protein; it dries clear. The discoloration happens when sweat combines with the aluminum compounds in antiperspirant deodorant. Aluminum reacts with the proteins and natural body oils in sweat to form a stubborn compound that bonds to fabric fibers and oxidizes over time, producing the yellow-brown color that appears days or weeks after the sweat itself is long gone.
This is why the stain often shows up during a laundry day weeks after the actual sweating happened, and why repeated machine washing without pre-treatment does not touch it. You are not trying to lift a water-soluble substance off the surface of the fabric. You are trying to break an aluminum-protein bond that has baked itself into the fiber through multiple wash and dry cycles. That requires a different kind of chemistry than standard detergent provides.
On white fabric specifically, UV light and mild bleaching agents are safe tools that are not available on colored or dark garments. This is the key advantage white shirts have: the treatments that work best are not restricted by the risk of color damage.
Fresh Stains vs. Old Yellow Stains: Two Different Problems
The treatment depends on which situation you are in, and they are genuinely different problems.
Fresh stains are o 

Author