{
  "id": "soap",
  "version": "2528537543f7",
  "status": "published",
  "name": "Soap Calculator",
  "question": "How much lye does my soap need?",
  "summary": "Computes the lye (sodium hydroxide or potassium hydroxide) and water for a soap recipe from each oil’s weight and published SAP value, with a superfat, the lye purity, and the water-to-lye ratio.",
  "category": "chemistry",
  "subcategory": "stoichiometry",
  "url": "https://www.acalculator.org/chemistry/soap-calculator",
  "markdown": "https://www.acalculator.org/chemistry/soap-calculator.md",
  "kind": "function",
  "method": "Lye = Σ (oil weight × SAP value) × (1 − superfat ÷ 100) ÷ (purity ÷ 100); water = lye × water-to-lye ratio; concentration = lye ÷ (lye + water) × 100.",
  "assumptions": [
    "SAP values are The Soap Kitchen’s published NaOH and KOH charts (retrieved 2026-10-02); a batch of a real oil can differ a little.",
    "Superfat 5% by default; water twice the lye’s weight by default (a 33% lye solution).",
    "Always weigh lye and wear eye and skin protection; add lye to water, never water to lye."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "lye": {
        "title": "Lye",
        "description": "Sodium hydroxide (NaOH) for bar soap, or potassium hydroxide (KOH) for liquid soap.",
        "type": "string",
        "enum": [
          "naoh",
          "koh"
        ]
      },
      "u": {
        "title": "Weights in",
        "description": "The unit of every weight you type and every weight shown: grams, ounces or pounds.",
        "type": "string",
        "enum": [
          "g",
          "oz",
          "lb"
        ]
      },
      "oils": {
        "title": "Oils",
        "description": "One row per oil, butter or wax: which one and its weight.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "o": {
              "title": "Oil",
              "description": "The oil, butter or wax.",
              "type": "string",
              "enum": [
                "almond",
                "apricot",
                "avocado",
                "babassu",
                "tallow",
                "beeswax",
                "castor",
                "cocoa",
                "coconut",
                "corn",
                "cottonseed",
                "emu",
                "primrose",
                "flaxseed",
                "grapeseed",
                "hazelnut",
                "hemp",
                "jojoba",
                "lard",
                "macadamia",
                "neem",
                "olive",
                "palm",
                "palmkernel",
                "peanut",
                "poppy",
                "pumpkin",
                "canola",
                "ricebran",
                "safflower",
                "sesame",
                "shea",
                "soybean",
                "sunflower",
                "walnut",
                "wheatgerm"
              ]
            },
            "w": {
              "title": "Weight",
              "description": "How much of it, in the unit above.",
              "type": "number",
              "exclusiveMinimum": 0,
              "maximum": 100000
            }
          }
        }
      },
      "sf": {
        "title": "Superfat",
        "description": "The share of oil left unsaponified, for a milder bar: less lye by this percent.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 30
      },
      "pure": {
        "title": "Lye purity",
        "description": "How pure your lye is, from its label: about 100% for NaOH; KOH is often sold at about 90%.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 50,
        "maximum": 100
      },
      "ratio": {
        "title": "Water to lye ratio",
        "description": "Parts of water per part of lye by weight: 2 means twice the lye’s weight in water.",
        "type": "number",
        "minimum": 1,
        "maximum": 5
      }
    }
  },
  "outputs": {
    "lye": {
      "label": "Lye",
      "description": "The weight of lye to dissolve, in your unit.",
      "format": "number"
    },
    "water": {
      "label": "Water",
      "description": "Lye × the water-to-lye ratio, in your unit.",
      "format": "number"
    },
    "total": {
      "label": "Oils",
      "description": "All the oils added up, in your unit.",
      "format": "number"
    },
    "batch": {
      "label": "Batch weight",
      "description": "Oils + lye + water, in your unit.",
      "format": "number"
    },
    "concentration": {
      "label": "Lye concentration",
      "description": "Lye ÷ (lye + water) × 100.",
      "format": "percent"
    },
    "text": {
      "label": "Lye and water",
      "description": "The lye and water with their unit, in words.",
      "format": "text"
    },
    "breakdown": {
      "label": "Lye for each oil",
      "description": "Each oil’s weight × its SAP value, before superfat and purity.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "lye": "naoh",
      "u": "g",
      "oils": [
        {
          "oil": "olive",
          "weight": 500
        },
        {
          "oil": "coconut",
          "weight": 300
        },
        {
          "oil": "shea",
          "weight": 200
        }
      ],
      "sf": 5,
      "pure": 100,
      "ratio": 2
    },
    "outputs": {
      "lye": 142.12,
      "water": 284.24,
      "total": 1000,
      "batch": 1426.36,
      "concentration": 33.333333333333336,
      "text": "142.12 g of NaOH in 284.24 g of water",
      "breakdown": "Olive Oil: 67 g; Coconut (refined): 57 g; Shea (Karite) Butter: 25.6 g"
    },
    "text": "Use 142.12 g of NaOH in 284.24 g of water."
  },
  "examples": [
    {
      "given": {
        "lye": "naoh",
        "u": "g",
        "oils": [
          {
            "oil": "olive",
            "weight": 500
          },
          {
            "oil": "coconut",
            "weight": 300
          },
          {
            "oil": "shea",
            "weight": 200
          }
        ],
        "sf": 5,
        "pure": 100,
        "ratio": 2
      },
      "expect": {
        "lye": 142.12,
        "water": 284.24,
        "batch": 1426.36,
        "text": "142.12 g of NaOH in 284.24 g of water"
      },
      "source": "The Soap Kitchen, Saponification values in soap making (multiply each oil’s weight by its value; NaOH: olive 0.134, coconut (refined) 0.190, shea 0.128), https://www.thesoapkitchen.co.uk/guide-to-sap-values/; hand calculation in content.mdx: 67 + 57 + 25.6 = 149.6 g × 0.95 = 142.12 g"
    },
    {
      "given": {
        "lye": "koh",
        "u": "g",
        "oils": [
          {
            "oil": "olive",
            "weight": 1000
          }
        ],
        "sf": 0,
        "pure": 90,
        "ratio": 3
      },
      "expect": {
        "lye": 211.77777777777777,
        "water": 635.3333333333334,
        "concentration": 25
      },
      "source": "The Soap Kitchen, Saponification values in soap making (KOH chart: olive oil 0.1906), https://www.thesoapkitchen.co.uk/guide-to-sap-values/; hand calculation in content.mdx: 1,000 × 0.1906 = 190.6 g ÷ 0.9 = 211.78 g"
    },
    {
      "given": {
        "lye": "naoh",
        "u": "oz",
        "oils": [
          {
            "oil": "olive",
            "weight": 32
          },
          {
            "oil": "coconut",
            "weight": 20
          },
          {
            "oil": "palm",
            "weight": 12
          }
        ],
        "sf": 5,
        "pure": 100,
        "ratio": 2
      },
      "expect": {
        "lye": 9.291,
        "total": 64,
        "water": 18.582
      },
      "source": "The Soap Kitchen, Saponification values in soap making (example mixture of 2 lb olive, 1 lb 4 oz coconut and 12 oz palm; NaOH: olive 0.134, coconut 0.190, palm 0.141), https://www.thesoapkitchen.co.uk/guide-to-sap-values/; hand calculation in content.mdx: 4.288 + 3.8 + 1.692 = 9.78 oz × 0.95 = 9.291 oz"
    }
  ],
  "sources": [
    "The Soap Kitchen, Saponification values in soap making: saponification chart (sodium hydroxide, NaOH) and saponification chart (potassium hydroxide, KOH); multiply the weight of each oil by its value. https://www.thesoapkitchen.co.uk/guide-to-sap-values/ (retrieved 2026-10-02)",
    "Modern Soap Making, How to Better Understand Water Discounts When You Make Soap (water as a ratio of the lye; a 33% lye solution is 33% lye and 67% water; multiply the lye by 2 for a 33% solution). https://www.modernsoapmaking.com/blog/lye-solution-in-soapmaking (retrieved 2026-10-02)"
  ],
  "related": [
    "molar-mass",
    "molarity",
    "dilution"
  ],
  "changelog": []
}
