Unmask the Secrets of Vegetable Colors! The Amazing “Rainbow Test Tubes” Experiment with Purple Cabbage
I’m Ken Kuwako, your science trainer. Every day is an experiment!
Take a look at the red cabbage in your local grocery store. It might look like just another vegetable, but did you know it’s actually hiding a secret source of magic ink? Today, I’m going to show you how to use this humble cabbage to trap a breathtaking rainbow inside a test tube. Get ready for a colorful drama that will leave both kids and adults absolutely spellbound!
Create a Rainbow with Red Cabbage!
In the world of science, red cabbage is famous for being an elite natural indicator. Like a chameleon, it has the incredible ability to change its color instantly depending on whether a liquid is acidic or alkaline. By tapping into this power, anyone can easily create a liquid rainbow.
What You’ll Need:
Red cabbage
Sodium bicarbonate (Baking soda)
Diluted hydrochloric acid
Beaker
Graduated cylinder
How to Do It:
First, chop the red cabbage into small pieces and place them in a beaker. Add just enough water to cover the cabbage and heat it over a gas burner. As the water boils, the pigment will dissolve, turning the liquid a deep, vibrant purple. Once the color is rich enough, turn off the heat, strain out the cabbage, and pour your purple extract into the graduated cylinder.
Next, add about 5g of sodium bicarbonate (baking soda). Watch closely—the purple liquid will instantly shift to a bright green! This transformation is a guaranteed “wow” moment every single time.
Now, use a pipette to slowly and gently add the diluted hydrochloric acid. Be careful here: if you add it too quickly, the reaction might cause it to foam over, so take your time. You’ll see the surface of the liquid begin to blush a brilliant red.
Finally, take a glass stirring rod and stir the liquid very, very slowly. If you do it right, you’ll see green at the bottom, purple in the middle, and red at the top. A beautiful, shimmering gradient will appear right before your eyes—it’s a rainbow in a bottle!

The Secret Behind the Colors
This “magic” is actually a chemical reaction involving a pigment called anthocyanin found in many plants. Anthocyanin has a fascinating quirk: its molecular structure changes depending on the pH level (the acidity or alkalinity) of its environment.
Neutral (Original state): Purple
Alkaline (With baking soda): Green or Yellow
Acidic (With hydrochloric acid): Red
The reason the rainbow appears at the end is that the liquids of different pH levels have settled into distinct layers within the cylinder.
The key to success is stirring gently. If you stir too vigorously, the layers will mix completely, and the whole thing will turn a uniform acidic red. “Slow and steady” is the scientific secret to preserving your beautiful rainbow! This same pigment, anthocyanin, is responsible for the blue-purple of blueberries and the fiery red of autumn leaves. Science is the hidden artist behind the most beautiful colors in nature.
Inquiries and Requests
Bringing the wonder of science closer to you! I share easy-to-follow tips and fun experiments you can try at home. Feel free to explore more:
My “Science Notebook” series is now a book! Details here
Learn more about Ken Kuwako here
For work requests (writing, lectures, workshops, TV supervision, etc.), click here – Follow me on X (formerly Twitter) for the latest updates!
Watch experiment videos on the Science Material Channel!

