Musty smell in clothes that have lain damp
Short answer: The smell comes from microorganisms in the fibre. A vinegar wash followed by an ordinary wash and complete drying removes it in most cases.
Why the smell sticks
Musty odour comes from compounds that mould and bacteria release as they grow. They work into the fibre, and an ordinary cold wash does not reach them. That is why the smell returns as soon as the fabric gets warm and damp.
The two step cure
First wash with a cup of white vinegar and no detergent at the highest temperature the fabric allows. Then wash normally with washing powder. Powder contains bleach that finishes the job.
Drying is half the solution
Dry the items all the way through, ideally outdoors in sun and wind. A damp remnant in seams and waistbands is enough for the smell to return. Feel the thickest parts before you put them away. See bamboo towels.
Where the smell starts
Damp wardrobes, cellars and sealed plastic boxes are the usual places. Store clothes dry and airy, and avoid plastic directly against the fabric. See bamboo bedding and bamboo sheets.
Frequently asked questions
Does freezing the clothes work
No. Cold slows growth but removes neither the odour compounds nor the organisms.
Can perfume cover the smell
It works for a day. The smell returns as soon as the fabric gets damp.
How long should clothes be in the sun
A couple of hours is enough. Sun both dries and acts on the surface.