The best way to wash a baseball cap depends on the age of the cap, the fabric and how precious it is to the owner. If the cap has any age on it, washing it by hand is probably best. The same applies for wool caps, which will shrink dramatically if tossed in a washing machine.
Determine the Age
If the baseball cap is less than 10 years old, and is not made of wool (check the tag inside the headband), toss it in the washing machine and then let the cap air dry. This works fine with standard laundry detergents.
No matter what kind of baseball cap you own, don't place it in a clothes dryer. A dryer will ruin the shape of the cap and possibly warp or melt the plastic inside the brim of many newer baseball caps.
Handwash Wool Caps
Dip your wool baseball cap in a bowl of cold water with a wool-friendly detergent, such as Woolite. Rub all surfaces of the cap with a washcloth, rinse and air dry. Scrub the inside of the brim and headband, as this is where sweat and odors accumulate. Do not wring-out a wool cap; otherwise, you'll end up with a lump of twisted felt when the cap dries.
Drying the cap
Air dry all baseball caps. If you are worried about the material shrinking, fit the cap over a Styrofoam mannequin head (available at department stores), or set the cap on the end of a football or any other object roughly the size of a human head.
Plastic Hat Cages
Plastic cages shaped like baseball caps open on a hinge like a clamshell. The idea is you put the cap in the cage, close it and run the hat through a washing cycle. Some instructions suggest running the hat and cage through a dishwashing cycle, since throwing a hard plastic hat cage in a washing machine is an invitation to problems (shredded plastic in the washer, anyone?). If you use a plastic hat cage in the dishwasher, beware of harsh dishwashing detergents that could fade your cap, or worse. Don't use laundry detergent in the dishwasher, unless you want to be waist deep in soap bubbles.