DIY Shampoo: The chemistry of foam you won't find on the label

DIY Shampoo: The chemistry of foam you won't find on the label

👩‍🔬 Online school Walker Formulation Academy📅 30 June 2026⏱️ 9 min read

Do you know what the Soviet "Krapiva" shampoo, the Japanese furo ritual, and a modern sulphate-free bottle costing three thousand rubles have in common? They all solve the same problem: removing sebum, impurities, and styling residue without turning hair into straw. The only difference is exactly how this happens at the molecular level. And that is where things get interesting.

Shampoo is perhaps the most underrated product in hair care. We spend hours choosing masks and serums, but wash them off with something that costs less than a coffee. Yet, a shampoo formula is a delicate balance between cleansing and preserving the hair's lipid barrier, between foaming and conditioning effects, and between storage stability and biodegradability. Let's break this down for real.

Close-up of shampoo formula ingredients in glass beakers — surfactant foam, botanical extracts, pH strips — flat lay on white marble, editorial beauty photography style, natural lighting
Close-up of shampoo formula ingredients in glass beakers — surfactant foam, botanical extracts, pH strips — flat lay on white marble, editorial beauty photography style

What actually happens when you wash your hair

Surfactants: not enemies, but tools

Surface-active agents (surfactants) are molecules with a split personality: one part loves water (the hydrophilic "head"), while the other is drawn to fats (the hydrophobic "tail"). When shampoo hits wet hair, surfactants line up around droplets of sebum, forming micelles—tiny spheres where the fat is trapped inside, with a water-loving shell on the outside. Water then rinses all this splendor down the drain.

The problem isn't the principle itself—it's flawless. The problem is the choice of surfactant. Sodium Lauryl Sulfate (SLS) does the job aggressively: it doesn't distinguish between sebum and the essential ceramides and cuticle proteins. Sodium Laureth Sulfate (SLES) is milder, but still effective enough to disrupt the hydrolipid balance with daily use. This is exactly why the "sulphate-free" movement gained such momentum—not because sulphates are "toxic" (that's a myth), but because for fine, colored, or dry hair, they are excessively effective.

The hierarchy of surfactants in modern formulas

A professional shampoo formula is built on a system of primary and secondary surfactants. Here is how it works in practice:

  • Primary surfactant — the main cleansing power. Sodium Cocoyl Isethionate (SCI), Sodium Lauroyl Methyl Isethionate (SLMI), Cocamidopropyl Betaine (CAPB), or classic SLES. Concentration: 8–20% in the finished product.
  • Secondary surfactant — improves foaming and softens the irritating potential of the primary one. Most often these are amphoteric surfactants: Cocamidopropyl Betaine (2–6%) or Disodium Cocoamphodiacetate.
  • Thickener — Sodium Chloride (common salt!) works as a rheology modifier for SLES systems: 1–3% can triple the viscosity. For "sulphate-free" systems, you need Hydroxyethylcellulose or Guar Hydroxypropyltrimonium Chloride.
  • Conditioning agents — Polyquaternium-10, Guar Hydroxypropyltrimonium Chloride, silicones (Dimethicone, Amodimethicone). They adsorb onto the negatively charged surface of the hair and reduce friction during combing.
  • Preservative — without it, your shampoo will become a breeding ground for microbes within two weeks. Phenoxyethanol + Ethylhexylglycerin, Sodium Benzoate + Potassium Sorbate at a pH below 5.5.
  • pH: the number that determines everything

    Healthy hair has a pH of about 3.67 — researchers discovered this back in the 1970s, and the data has been confirmed repeatedly since then. The hair cuticle consists of overlapping keratin scales; at a low pH, they lie flat against each other, making the hair look shiny and smooth. At a pH above 6, the scales lift, the hair becomes rough, more susceptible to mechanical damage, and prone to static.

    Most commercial shampoos have a pH of 5.0–6.0. This is a compromise: at this level, surfactants work effectively, preservatives are active, and the cuticle is not catastrophically damaged. If you are formulating yourself, the target range is 4.5–5.5. We covered more details on how pH affects the stability and efficacy of the entire formula in our article pH in cosmetics: a basic guide for formulators.

    Why "natural" doesn't mean "correct pH"

    This is where many homemade formulas fail. When searching for a natural shampoo recipe online, you often encounter options based on Castile soap — liquid soap made from olive oil. It is wonderful on its own, but its pH is around 9–10. This is an alkaline environment that literally destroys the cuticle, causes static, and makes hair stiff. Apple cider vinegar as a rinse is not a life hack, but an attempt to fix a chemical error.

    Natural shampoos based on old recipes — soapwort, quillaja saponins, rye flour — are interesting from a historical perspective, but they have the same problem: pH control is unpredictable, and the concentration of active substances varies from batch to batch. This does not mean that plant-based surfactants are bad — Decyl Glucoside, Coco Glucoside, and Lauryl Glucoside are derived from renewable raw materials and work perfectly in modern formulas. They just need to be formulated correctly.

    Formula architecture: how to assemble a shampoo that works

    Basic formula for beginners

    A good starting point for a gentle shampoo for normal hair looks like this:

    1. Purified water (Aqua) — up to 100%, the base of the system
    2. Sodium Laureth Sulfate 70% — 15–20% (calculated as active substance, about 10–14%)
    3. Cocamidopropyl Betaine 30% — 5–8%
    4. Sodium Chloride — 1–3% (add gradually while monitoring viscosity)
    5. Panthenol — 0.5–1% (moisturizing, repair)
    6. Hydrolyzed Keratin or Hydrolyzed Wheat Protein — 1–2%
    7. Polyquaternium-10 — 0.2–0.5% (conditioning effect)
    8. Phenoxyethanol + Ethylhexylglycerin — 0.8–1%
    9. Citric Acid — to pH 5.0–5.5
    10. Fragrance or essential oils — 0.5–1%

    Please note: oils are rarely added to shampoo, and when they are, it is done wisely. Unlike a leave-on anhydrous product, shampoo is rinsed off, and oils either wash away with the foam or—if there is too much—make the hair heavy. The exception is DIY hair oil in a leave-on format: that involves different chemistry, a different objective, and an entirely different composition.

    Thickening without salt: for "sulphate-free" systems

    If you are working with glucosides or isethionates, salt will not thicken your formula—it will simply dissolve and do nothing. Other approaches are needed here:

    • Hydroxyethylcellulose (HEC) — 0.5–1.5%, added to cold water while stirring, swells when heated to 60–70°C
    • Guar Hydroxypropyltrimonium Chloride — 0.2–0.5%, thickens and conditions simultaneously
    • Carbomer (Carbopol) — 0.2–0.5% with NaOH neutralization, but be careful: it loses effectiveness at a pH below 5
    • Xanthan Gum — 0.1–0.3% in combination with other thickeners

    The behavior of gums and gelling agents in aqueous systems is a separate, in-depth topic that we covered in our article Tribology, gums, and gelling agents. It also covers the synergy of xanthan with other polymers.

    Specialized formulas: when "one size fits all" doesn't work

    Dry and damaged hair

    For this hair type, the key parameter is the balance between cleansing and preserving the remaining lipids. We reduce the concentration of the primary surfactant to 8–10% active matter, increase the proportion of the amphoteric surfactant, and add:

    • Hydrolyzed Collagen — 2–3%: small peptides penetrate the cortex through the damaged cuticle
    • Betaine (not to be confused with CAPB) — 1–2%: an osmoprotectant that retains moisture
    • Ceramide NP or Ceramide AP — 0.1–0.5%: restoration of the cuticle's lipid barrier
    • Amodimethicone — 0.5–1%: selectively adsorbs onto damaged areas

    Oily hair and sensitive scalp

    The paradox: aggressive cleansing of an oily scalp stimulates the sebaceous glands to produce even more sebum—a compensatory reaction. A mild shampoo with a pH of 4.5–5.0, used regularly, provides better long-term results than a "degreasing" one with SLS.

    Additives that work: Zinc Pyrithione (0.5–1%) — regulates the scalp microbiome and reduces sebum production; Salicylic Acid (0.5–2%) at a pH below 4.5 — a keratolytic that dissolves keratin scales; Niacinamide (2–4%) — anti-inflammatory effect. Important: Salicylic Acid and Zinc Pyrithione are regulated actives; their concentrations are limited by EU and EAEU legislation.

    By the way, if you have ever wondered about a shampoo formula for pets—it has its own specifics regarding pH and surfactants, and it differs drastically from human shampoo. More on this in our article Shampoo for dogs and cats: what every pet lover should know 🐶🐱.

    Stability and storage: what blogs don't tell you

    Microbiological safety

    Shampoo is an aqueous system containing nourishing substrates (proteins, plant extracts). Without adequate preservation, it is an ideal environment for Pseudomonas aeruginosa, Staphylococcus aureus, and mold fungi. Homemade formulas are especially vulnerable because they are produced in non-sterile conditions.

    A minimal working approach: Phenoxyethanol (0.8–1%) + Ethylhexylglycerin (0.1–0.2%), pH 5.0–5.5. When using plant extracts, increase the preservative concentration or add a second preservative. Read more about the logic of multi-component preservation in our article on preserving clay masks: the principles are the same, the context is different.

    Physical stability

    Shampoo can separate, turn cloudy, or lose viscosity during temperature fluctuations. A stability test for a home laboratory: place samples in three conditions — refrigerator (+4°C), room temperature (+22°C), and "stress" (+40°C) — for 4 weeks. Visual assessment + pH measurement + viscosity (you can use a simple Brookfield rheometer or even a Ford cup). If the formula separates or the pH shifts by more than 0.5 units at +40°C, something needs to be changed before it ends up on someone's head.

    Can you make shampoo without synthetic surfactants?

    Technically, yes, but with caveats. Saponins (from quillaja, soapwort, chestnut) are natural surfactants that actually foam and cleanse. The problem is standardization: the concentration of active substances in plant raw materials varies, pH control is difficult, and the microbiological stability of such a product requires special attention. If you are looking for a natural shampoo recipe based on saponins, it is possible, but it requires thorough testing of each batch. Glucoside surfactants (Decyl Glucoside, Coco Glucoside) are a good compromise: they are derived from plant raw materials, are well-tolerated, and are easy to formulate.

    Why doesn't homemade shampoo thicken like store-bought ones?

    Most likely, you are working with a "sulphate-free" system where salt does not work as a thickener. Try Hydroxyethylcellulose (0.5–1%) or Guar Hydroxypropyltrimonium Chloride (0.2–0.5%). A second option is that the surfactant concentration is too low: to thicken with salt, you need at least 12–15% SLES calculated as active matter. Another factor is temperature: some thickeners are only activated when heated above 60°C.

    How to combine DIY hair oil with shampoo in your routine?

    DIY hair oil and shampoo work at different stages and have different tasks. Oil is a leave-in treatment that forms a protective film on the cuticle, reduces friction, and prevents moisture loss. Shampoo washes it off — this is normal if the oil was applied as a pre-poo before washing or as a finishing treatment afterward. Adding unrefined oils directly to shampoo is not the best idea: they do not emulsify well in a surfactant system without a special solubilizer (PEG-40 Hydrogenated Castor Oil, Polysorbate 20) and will settle on the walls of the bottle.

    What's next: from understanding to practice

    Shampoo is an excellent entry point into cosmetic chemistry. It is a water-based system with a relatively simple formula and provides quick results. But it is precisely here that it becomes clear that "mixing ingredients" and "formulating a product" are fundamentally different things. Choosing a surfactant system, pH control, thickening, preservation, stability — every step requires an understanding of chemistry, not just a list of ingredients.

    If you want to move further — from intuitive mixing to conscious formulating — take a look at what we do in the Walker Formulation Academy Club. That is exactly the kind of thing we analyse there: not recipes, but the principles that allow you to create any formula yourself.

    Walker Formulation Academy Club

    Enjoyed the article? Get access to the AI Chemist and video recipes

    The 24/7 AI assistant answers formulation questions, calculates HLB and pH and helps you choose ingredients. Plus a private community of chemists and monthly product reviews.

    No card required · Cancel anytime

    Rate this article

    Your rating helps other readers find useful guides