There are few things in life as disappointing as taking the effort to separate all your clothes and stuff them in the machine, only to have them come out smelling all stale and mildewy. It's just not right.

The truth of the matter is it's not your clothes that are extra-dirty, but likely your machine that needs the real cleaning. Often the funky smell you're picking up on your garments actually comes from a buildup of bacteria and mold in your washer and dryer. Yep — gross.

Luckily, all it takes are these 12 easy deodorizing tricks to get your laundry smelling super-fresh again.

Step 1: Don't delay drying

Don't leave clean laundry in the machine after the load has finished washing — especially not overnight. With a nice warm, dark environment like a closed washing machine, bacteria and mold both thrive.

Step 2: Avoid the damp

Never put damp laundry in the washing pile. If you can't wash wet or damp clothes and towels immediately, pre-treat as needed and then let them dry to avoid getting smelly.

Step 3: Dry well

Thicker towels and heavy clothing such as jeans take longer to dry, so be sure to dry them thoroughly each time.

More: How to Remove Blood, Sweat and Other Tough Laundry Stains

Step 4: Get a clothesline

Hang your laundry outside to dry. The sun can help keep mold at bay — just be sure to dry everything completely (even if it means some time in the dryer inside).

Step 5: Soften carefully

Avoid using liquid fabric softener in the washing machine, as some people have experienced a buildup of "gunk" from its use. (Vinegar is said to be a natural fabric softener.) If you do use store-bought fabric softener, dilute the mixture with water before adding it to the machine, and realize that the softener can make laundry harder to dry.

Step 6: Try different washing machine additives

There are many different laundry additives you can try — get some suggestions below. But be aware that these measures are guidelines only, and effectiveness will depend on many factors, including the size of the load, water temperature and the amount of water used, the origin of the bad smell, etc.

Next Up: Non-toxic/natural solutions

Originally published August 2009. Updated July 2017.

Step 7: Nontoxic/natural solutions

Try allowing each load of smelly laundry to pre-soak for at least 15 minutes in hot water, using one of these additives per load to see what (and how much) works best for you: borax (about 1/2 cup), vinegar (3/4 cup), lemon juice (about 1/2 cup), baking soda (3/4 cup), hydrogen peroxide diluted to 3 percent (1/2 cup).

Step 8: Commercial cleaning products to try

Try running your stinky wash loads with the addition of one extra cleaning product at a time, such as Clean Control, Simple Green or Pine-Sol (1/4 cup — and only if you can handle the scent).

More: How to Clean a Burned Pot, No Chemicals (or Stress) Needed

Step 9: Common household products — but beware

You can try using 1/4 cup of bleach (add it to the wash water and make sure it has been diluted significantly before adding smelly laundry, and never use bleach with any other additive besides regular detergent). Another option is to add 1/2 cup of ammonia to a load of laundry, but be sure not to use with bleach to avoid creating dangerous fumes.

Step 10: Detergent with a bonus ingredient

Try a commercial laundry detergent that has an odor-removing additive, such as Febreze or Renuzit.

Step 11: Go with hot water

Use hot water to wash loads that smell.

Step 12: Wash the washer

To help keep your smelly laundry problem from returning, you may need to give your clothes washer a deep clean of its own. Find out how to deodorize your smelly washing machine here.