How to Make Natural Blue Dye for Fabric or Food

You can make natural blue dye from several common sources: butterfly pea flowers, red cabbage, black beans, indigo leaves, and spirulina. The method depends on whether you need the dye for fabric, food, or craft projects. Some sources give you blue straight from steeping, while others require a chemical shift or fermentation step to reach a true blue.

Butterfly Pea Flowers: The Easiest Blue

Butterfly pea flowers produce a vivid blue with nothing more than hot water. Steep about 50 dried flowers in one cup of boiling water for 15 minutes, or until the petals have gone completely pale. Strain the liquid and you’ll have a deep blue concentrate. For a lighter dye, use fewer flowers: 12 per cup gives a medium blue. The color works beautifully as a food-safe dye for rice, drinks, baked goods, and frosting. It’s also pH-sensitive, so adding a squeeze of lemon will shift it toward purple.

For fabric dyeing, butterfly pea flower extract is less permanent than indigo. It fades with washing unless you use a fixative. But for food projects, seasonal crafts, or egg dyeing, it’s the fastest route to natural blue.

Red Cabbage With a pH Shift

Red cabbage extract is naturally purple, but you can push it to blue by raising the pH into the 7 to 8 range. Start by roughly chopping half a head of red cabbage and simmering it in enough water to cover for about 30 minutes. Strain out the cabbage and let the liquid cool. At this point, you’ll have a deep purple.

To shift the color to blue, add a small amount of baking soda, stirring after each pinch. You only need to reach a slightly alkaline environment. Go slowly, because once you pass pH 9 the color turns green, and by pH 12 it shifts to yellow-green. The anthocyanins in cabbage are also less stable at higher pH values, so overshooting doesn’t just change the color; it breaks down the pigment faster. For a food-safe blue, baking soda is the ideal alkaline additive. For fabric dyeing, the cabbage blue is pretty but fades quickly without a mordant.

Black Beans: A Cold-Process Blue

Black beans produce a blue dye through a simple cold soak, no cooking required. Cover dried black beans with cold water, using roughly a 1:2 ratio of beans to water, and let them sit for 24 to 48 hours. The longer soak draws more pigment from the skins. Strain the liquid and you’ll have a blue that can lean toward green, purple, or gray depending on the batch and your water’s mineral content.

This cold-brew method is popular for dyeing fabric and yarn because heat can shift the color toward purple or brown. If you’re dyeing textiles, soak your fabric in the strained bean water for several hours or overnight. The blue won’t be as intense or permanent as indigo, but it’s a genuinely hands-off process that uses pantry ingredients. And you can still cook the beans afterward.

Indigo and Woad: The Traditional Deep Blue

For a permanent, wash-resistant blue on fabric, indigo is the gold standard. The plants most commonly used are true indigo (a tropical legume) and woad (a cold-hardy European plant). Both contain precursor compounds that convert to the same blue pigment through fermentation and oxidation.

The basic process starts by soaking fresh leaves in water. During soaking, fermentation converts the plant’s precursors into a colorless intermediate compound called indoxyl. An alkaline agent, traditionally wood ash lye or slaked lime, is added to maintain the right pH and neutralize acids produced during fermentation. At this stage, the liquid looks yellowish-green, not blue.

Next comes aeration: you vigorously stir, whisk, or pour the liquid back and forth between containers to introduce oxygen. This oxidation step transforms the colorless indoxyl into the actual blue pigment, indigotin. You’ll see the liquid turn blue and eventually dark blue sediment will settle to the bottom. That sediment is your indigo pigment. Pour off the water, collect the paste, and dry it for storage.

Dyeing Fabric With Indigo

Here’s where indigo gets interesting: the blue pigment itself is insoluble in water, so you can’t just dip fabric into it. You need to reverse the chemistry. By creating an alkaline bath with a reducing agent (traditionally fermented fruit, wheat bran, or a bacterial fermentation vat), you convert the blue pigment back into its colorless, water-soluble form. Fabric dipped in this vat absorbs the colorless dye. When you pull the fabric out and expose it to air, the pigment oxidizes back to blue right before your eyes. Multiple dips build deeper color. This is why indigo-dyed denim gets its characteristic fading pattern: the dye sits on the fiber surface rather than penetrating deeply.

A side reaction during extraction also produces a reddish compound, which is normal and contributes to the depth and warmth of natural indigo compared to synthetic versions.

Spirulina: Blue for Food Only

Spirulina, the blue-green algae sold as a health supplement, contains a bright blue pigment that works well as a food colorant. You can buy spirulina powder and mix it with a small amount of water to create a paste, then thin it to the intensity you want. The blue is vibrant but fragile. It remains stable below 45°C (113°F) and at a slightly acidic pH around 5.5 to 6.0. Above that temperature, the pigment degrades rapidly. At 47°C, it loses half its color in about five hours.

This makes spirulina blue ideal for cold applications: smoothie bowls, frosting, no-bake desserts, and cold drinks. It’s a poor choice for anything that gets baked or boiled. Light also accelerates breakdown, so store spirulina-dyed foods away from direct sunlight. For fabric dyeing, spirulina is essentially useless since the pigment doesn’t bind to fibers and washes out immediately.

Making the Color Last on Fabric

If you’re dyeing fabric with any of the non-indigo sources above (cabbage, black beans, butterfly pea), the blue will fade significantly after a few washes unless you use a mordant. Mordants are mineral salts that help the dye bond to fiber. The most common and safest option is alum (aluminum potassium sulfate), which you can find at grocery stores in the spice aisle or from dye supply shops. Dissolve alum in hot water, soak your fabric in the solution for an hour or more before dyeing, then proceed with your dye bath.

Copper sulfate is another mordant that can shift colors toward blue-green tones and improve durability, but it’s a heavy metal salt that requires careful handling and proper disposal. Iron sulfate darkens colors, sometimes dramatically, pushing blues toward gray or near-black. Chromium, tin, and other heavy metal mordants appear in historical and industrial dyeing but pose real toxicity concerns for home use. For most home dyers, alum is the right starting point. Natural mordant alternatives include tannin from oak galls or pomegranate peel, though these tend to add warm undertones rather than staying color-neutral.

Indigo is the exception: it doesn’t need a mordant at all. The pigment physically bonds to fiber through oxidation, which is why it has been the world’s dominant natural blue dye for thousands of years.

Choosing the Right Source for Your Project

  • Food coloring (cold): Butterfly pea flowers or spirulina give the brightest, most reliable blue with minimal effort.
  • Food coloring (cooked): Butterfly pea flowers or red cabbage with baking soda. Spirulina can’t handle the heat.
  • Fabric dyeing (permanent): Indigo or woad. Nothing else comes close for wash resistance.
  • Fabric dyeing (temporary or experimental): Black beans or red cabbage with an alum mordant. Expect soft, muted blues that evolve over time.
  • Craft projects (paper, eggs, play dough): Any of the above. Red cabbage is the most fun because you can demonstrate the full color spectrum by adjusting pH.

Natural blue is the rarest color in the plant world, which is why historically it commanded high prices and why each of these sources involves either a chemical trick (pH shifting, fermentation, reduction) or a specialized organism (spirulina, indigo plants) to produce it. The trade-off is that most natural blues are less stable than reds or yellows. Expect some fading over time, especially with light exposure and repeated washing, and you’ll get results you can work with.