Here are the steps to take, from the simplest, to those that will tackle the grimiest situations, for cleaning your grout:
1. Start with water
The mildest cleaning solution is as simple as it gets: water. Start by spraying the grout lines with warm water; the grout should be damp but not soaked. Then use a nylon brush with soft- to medium-bristles to scrub the damp grout in a circular motion. Once you've thoroughly scrubbed the grout lines, wipe them dry. You don't want them to stay wet or you'll risk the development of mildew.
2. Up the ante with vinegar and water, but know the risks
If the grout still looks stained, you can up the acidity level of the cleaning product by using a diluted vinegar and water mixture in a spray bottle — but be sure you understand the risk. If the grout is unsealed, or has not recently been resealed, do not use even a diluted form of vinegar to address stains.
The acidic vinegar will dissolve the grout. Even grout that is sealed is at risk from cleaning solutions that contain vinegar. The same is true of cleaning solutions that contain lemon or other liquids with a low pH value — or cleaning solutions with bleach or ammonia that contain a high pH value. All are potentially damaging to grout.
If it is worth the risk to potentially damage the sealant or grout in order to address a stain, then it may be worth a one-time use. Keep in mind, however, that many grout and tile experts warn against using vinegar on floors or grout. If you decide to proceed, some cleaning experts recommend a one-to-one mixture of vinegar and warm water that could be sprayed on sealed grout and then scrubbed with a brush.
3. Try a baking soda paste
If this mixture still doesn't rid the grout of stains, the grout lines could be covered with a baking soda/water paste and then sprayed with a diluted vinegar/water solution and scrubbed. If the grout is unsealed, use the baking soda/water paste without the vinegar spray. Scrub and wipe dry.
4. Move to a baking soda/hydrogen peroxide paste
Really stubborn sealed or unsealed grout stains could be addressed with a baking soda/hydrogen peroxide paste. Apply the homemade paste and lightly scrub, let it sit for a few minutes, then rinse clean and wipe dry.
5. Last resort: Over-the-counter commercial stain remover
For deeply stained grout that simply won't lift, particularly for mold and mildew stains, an over-the-counter commercial stain remover may be necessary.
6. Steam cleaning is also an option
If you're leery of using acid- or alkaline-based cleaners that could potentially damage grout with repeated use, then steam-cleaning may be the best option. A steam cleaner is a power tool that heats water to more than 200 degrees Fahrenheit (93 degrees Celsius) and then uses nozzle or brush attachments to direct steam to areas that need cleaned, such as grout lines. Because the steam cleaner relies superheated water to lift and remove stains, you won't run the risk that comes with acidic or alkaline cleaning solutions.