When a dye hits the carpet, your stomach often hits the floor. Luckily, there are many methods using household items to lift the stain from the carpet without having to call a professional or worse, have your carpet replaced. The key is to act quickly before the stain sets in without vigorously rubbing the stain into the fabric.
Use a common household solution. One of the most common dye stains (and the hardest to treat) is from hair dye. According to Good Housekeeping, mixing 1 tbsp. liquid dishwashing soap and 1 tbsp. white vinegar in 2 cups of warm water can help remove the stain. Use a clean cloth to sponge the stain with the vinegar solution, occasionally blotting the area dry until the stain begins to disappear. Sponge the area with cold water and blot dry. Then sponge the area with rubbing alcohol, again blotting occasionally, and then sponge with cold water. If the stain is still there, try mixing 1 tsp. dishwashing soap with 1 tbsp. ammonia and 2 cups warm water. Never mix ammonia and bleach products. The mix creates hazardous fumes. Sponge the stain with the ammonia solution and let it set for 30 minutes. During the 30 minutes, blot the area dry and add more solution with a sponge every five minutes. Lastly, sponge with cold water and blot dry.
A last-ditch attempt to treat the stain is to apply hydrogen peroxide to the area with an eyedropper. Always test a different spot on the carpet to ensure that the peroxide itself won't create its own stain. Try testing it on an area in a corner or under a piece of furniture. Apply the peroxide and let it dry for 24 hours. Repeat the treatment if necessary.
Another solution from 1001 Carpet Care is to mix 1 tbsp. borax with 1 pint warm water. Always wear rubber gloves when using borax. Test an inconspicuous area of the carpet before applying this solution. Sponge the stain with the solution, starting from the outside and moving in. Blot the area dry and repeat if necessary. Vacuum the area when dry.
Try other approaches to minimize the appearance of the stain. In the event that the stain won't go away, you could bleach the area if you have a white carpet. If you don't have a white carpet, you can use a felt tip marker that matches the color of the carpet to mark over the stain. You could also cut the stain out of the carpet and replace the hole with a carpet remnant from your flooring specialist or from an inconspicuous place in your house, such as your closet. Call a professional if necessary.