Baking soda is a powdery miracle. Not only is it the secret ingredient to making mashed potatoes fluffy, it can help you make authentic-tasting soft pretzels at home and caramelize onions in half the time. It's actually got lots of surprising uses you might not know about, and one of them is that a pinch or two can correct sour and bitter tastes in your food.
The pH measurement determines whether a substance is an acid or a base on a scale from 0 to 14. Acidic falls into the 0 to 6 range, while 7 means neutral (which is also the pH of water), and 8 or higher indicates an alkali, or a base. On the pH scale, baking soda is a 9.
Meanwhile, lemon juice and vinegar rank as a 2 on that same scale, so you can glean for yourself that acidic foods are pretty mouth-puckering. However, when baking soda is added to a dish, it neutralizes those acids. That's why one of sodium bicarbonate's common uses was as a stomach antacid for many years.
For a full explanation of what pH measures and the chemical definition of acids and bases, check out the ChemWiki.
The University of Wisconsin Extension writes, "Because of its chemical makeup, baking soda has unique capabilities as a buffer. Buffering is the maintenance of a stable pH balance, or acid-alkali balance. As a buffer, baking soda tends to cause acid solutions to become more basic and to cause basic solutions to become more acid, bringing both solutions to a stable pH around 8.1 (slightly basic) on the pH scale. A buffer also resists pH change in a solution, in this case maintaining a pH of 8.1."
So, if you've added too much vinegar to a salad dressing or lemon juice to a marinade, or cooked tomatoes only to discover that they're super tart, you can add a pinch (but just a pinch—too much and you'll get a very soft, weird taste in your food) of baking soda and it should take the rough edges off the taste.
Some Redditors point out that you can try adding sugar first to a too-tart recipe (or even add a grated carrot or raisins since they're high in sugar), but in my opinion, sugar can sometimes actually bring out the flavor of something acidic unless you add a lot of it, which would just ruin your dish altogether.
Chowhound users have mixed feelings on the topic, but many of them have tried the baking soda trick and liked it.
Again, they emphasize that a very small amount is usually all it takes, and not to be surprised if you see some foaming when you add the baking soda—it's chemically reacting with the acid in your food.
The Kitchn went so far as to add several tablespoons of baking soda to rescue four gallons of chili.
Meanwhile, Dr. Gourmet (aka Dr. Timothy S. Harlan), a physician and TV commenter, says to use 1/4 teaspoon of baking soda to every cup of tomato sauce to neutralize any acid.
I experimented by adding 2 tablespoons of lemon juice to about 6 ounces of plain iced tea. I tasted it, winced, and had to drink some water. Next, I added 1/8 of a teaspoon of baking soda and stirred well. It definitely neutralized the mouth-puckering effect of too much lemon juice, and I didn't need as much honey to get the iced tea to just the right level of sweetness that it might have otherwise required.
I probably could have added more and been fine, but I played it safe instead. I say experiment and find out what works for you.