Why does baking soda turn onions yellow?

Onions are full of pale yellow plant pigments called flavonoids, mainly quercetin. Baking soda makes the onions slightly alkaline, and in alkaline conditions these pigments turn a deeper, brighter yellow. The colour shows up within moments, before any real browning starts, and it is harmless.

With lemon or vinegar Acidic: stays white or cream
Plain Near neutral: pale, faintly yellow
With baking soda Alkaline: yellow
How the same onion pigments look as conditions move from acidic to alkaline. The swatch colours are an illustration, not measurements.

What colours an onion?

Yellow and white onions get their colour mostly from flavonols, a group of flavonoids. The best known is quercetin. A USDA review of flavonoids in vegetables named onions as the largest vegetable source of quercetin in the diet. It listed yellow and white onions at 10 to 50 mg of flavonols per 100 g. USDA ARS, Flavonoid Content of Vegetables

Cooks call the pale pigments in onions, cauliflower and potatoes anthoxanthins. They are “generally whiter in an acid medium and yellowed in an alkaline medium.” Anthoxanthin, Wikipedia A professional cooking text gives the same rule for onions, cauliflower and white cabbage: their white pigments stay white in acid and turn yellow in alkaline water. White Vegetables, ckbk

Why alkaline conditions change the colour

Baking soda (sodium bicarbonate) is a mild base. Quercetin carries several –OH groups. In alkaline conditions those groups can give up hydrogen ions, which leaves the molecule negatively charged. The charged form absorbs light at longer wavelengths. A 2017 study of quercetin and related compounds measured this shift as pH rose. Quercetin and its analogues: optical and acido–basic properties, RSC PubChem describes quercetin as dissolving in alkaline water “with yellow color.” Quercetin, PubChem

As a result, the onion absorbs more violet and blue light and reflects more yellow. Its pigment hasn’t changed into a different compound. The same molecule has switched to a different form, much like a pH indicator.

Yellow first, brown later

Many cooks add baking soda to speed up caramelizing, so the yellow is easy to mistake for early browning. They are two different effects. In a National Onion Association test with ⅛ teaspoon of baking soda per pound of yellow onions, the onions “took on a yellow hue almost immediately after cooking.” Browning came later. National Onion Association

  1. Almost immediately A yellow hue appears. This is the pigment reacting to the higher pH.
  2. Early on The onions stay a little orange while they soften.
  3. About 10 min They start to turn brown rather than orange.
  4. About 13 min They are soft and caramelized. The association’s article puts the usual method at about 45 minutes.

Times are from one home-kitchen test reported by the National Onion Association.

Browning is a separate set of reactions, including the Maillard reaction, between sugars and amino acids. The association credits baking soda’s pH change with speeding up the Maillard reaction, which is why caramelizing goes faster. National Onion Association So baking soda causes both the early yellow and the faster brown, through two different mechanisms.

Why red onions turn blue-green instead

Red onions also contain anthocyanins, the red-purple pigments found in red cabbage. In the USDA review, red onions and red potatoes were the only vegetables with anthocyanins reported. USDA ARS Anthocyanins look red in acid and shift toward “a startling bluish-green” with alkaline ingredients such as baking soda or eggs. America’s Test Kitchen A red onion holds both pigment families. Blue anthocyanins next to yellowed flavonols can therefore look green.

Yellow or white onion

Yellow

Its flavonols turn deeper yellow.

Red onion

Blue-green

Its anthocyanins shift toward blue.

Any onion with acid

Paler

Lemon or vinegar keeps the pigments in their pale, acidic form.

Is it safe, and can you stop it?

Yes, it is safe. The yellow is the onion’s own pigment in a different form, not spoilage or a toxic by-product. What to watch is the amount of baking soda. The National Onion Association recommends no more than ¼ teaspoon per pound of onions. At ⅛ teaspoon, its onions turned “creamy, almost like an onion jam” and had no chemical taste. National Onion Association

If you want pale onions, skip the baking soda or add a little acid. The cooking text above keeps cauliflower white by adding lemon juice or cream of tartar to the cooking water. Onion pigments respond to acid in the same way. ckbk

Try it at home

Slice a yellow onion and put a few pieces in each of three small bowls of water: one plain, one with a pinch of baking soda, and one with a splash of vinegar. If the explanation above is right, the baking soda pieces should look the most yellow and the vinegar pieces the palest. Then add vinegar to the baking soda bowl. The yellow should fade, because a pH colour change is reversible. This is a suggested experiment. These results are predictions, not reported measurements.