Deodorants prevent the odour associated with sweating, either by masking it, or by killing the bacteria responsible. To make the effects last longer, the active ingredients are sometimes encased within microcapsules. As the capsules take up water from sweat they burst, releasing deodorising chemicals. By including capsules of a variety of sizes, each requiring a different amount of water to burst, the duration can be extended.
Most deodorants also contain antiperspirants, which prevent sweating from occurring at all. These are usually aluminium-based compounds. The aluminium is taken up by the cells that line the openings of the ducts that carry sweat to the surface of the skin. As the aluminium moves into the cells, it takes water with it, causing the cells to swell and closing off the ducts. Depending on the type of aluminium compound used, the effect will last for different lengths of time.