Normality Calculator for Standard Acids

๐Ÿงช Normality Calculator for Standard Acids — in JavaScript

This JavaScript snippet helps calculate the normality of standard acid and base solutions and also computes the weight of acid required for a specific volume and normality. Useful for students and lab chemists!

JavaScript Code:

(() => {
  const avogadro = 6.02214076e23;

  const standardAcids = [
    { name: "Hydrochloric Acid", symbol: "HCl", molwt: 36.45384, basicity: 1 },
    { name: "Sulfuric Acid", symbol: "H2SO4", molwt: 98.079, basicity: 2 },
    { name: "Nitric Acid", symbol: "HNO3", molwt: 63.01, basicity: 1 },
    { name: "Potassium Hydrogen Phthalate", symbol: "KHP", molwt: 204.22, basicity: 1 },
  ];

  function normality(molwt, eq, wtgm, volcc) {
    return (wtgm / molwt) * eq * 1000 / volcc;
  }

  function wtReqdNormalityAcid(molwt, basicity, norm, volreqd) {
    const equiWt = molwt / basicity;
    return equiWt * norm * volreqd / 1000;
  }

  const baseSymbol = "NaOH";
  const molwtBase = 39.99663928;
  const weightBaseTaken = 2; // g
  const volumeSolBase = 500; // mL
  const equiVBase = 1;

  const normBase = normality(molwtBase, equiVBase, weightBaseTaken, volumeSolBase);
  const volBaseTaken = 20; // mL

  console.log(`๐Ÿ”ฌ Alkali: ${baseSymbol} | Amount Taken: ${weightBaseTaken} g | Volume Prepared: ${volumeSolBase} mL`);
  console.log(`๐Ÿงช Normality of ${baseSymbol} solution: ${normBase.toFixed(2)} N\n`);

  const reqNormality = 0.1; // N
  const reqVolMls = 1000; // mL

  console.log(`๐Ÿ“Š Acids required to make ${reqNormality} N solutions (1L):\n`);
  for (const acid of standardAcids) {
    const { name, symbol, molwt, basicity } = acid;
    const amtAcid = wtReqdNormalityAcid(molwt, basicity, reqNormality, reqVolMls);
    console.log(`๐Ÿ”น Acid: ${name} (${symbol})`);
    console.log(`    ➤ Amount Required: ${amtAcid.toFixed(5)} g\n`);
  }

  console.log(`\n๐Ÿงช๐Ÿ“Œ Example: Using Functions Independently\n`);
  const nNaOH = normality(40, 1, 2, 500);
  const nHNO3 = normality(63.01, 1, 6.3, 1000);
  console.log(`✅ Normality of NaOH: ${nNaOH.toFixed(2)} N`);
  console.log(`✅ Normality of HNO3: ${nHNO3.toFixed(2)} N`);

  const wtH2SO4 = wtReqdNormalityAcid(98.079, 2, 0.2, 500);
  console.log(`✅ H2SO4 required for 0.2 N, 500 mL: ${wtH2SO4.toFixed(3)} g`);
})();
๐Ÿ”ฌ Alkali: NaOH | Amount Taken: 2 g | Volume Prepared: 500 mL
๐Ÿงช Normality of NaOH solution: 0.10 N

๐Ÿ“Š Acids required to make 0.1 N solutions (1L):

๐Ÿ”น Acid: Hydrochloric Acid (HCl)
    ➤ Amount Required: 3.64538 g

๐Ÿ”น Acid: Sulfuric Acid (H2SO4)
    ➤ Amount Required: 4.90395 g

๐Ÿ”น Acid: Nitric Acid (HNO3)
    ➤ Amount Required: 6.30100 g

๐Ÿ”น Acid: Potassium Hydrogen Phthalate (KHP)
    ➤ Amount Required: 20.42200 g

๐Ÿงช๐Ÿ“Œ Example: Using Functions Independently

✅ Normality of NaOH: 0.10 N
✅ Normality of HNO3: 0.10 N
✅ H2SO4 required for 0.2 N, 500 mL: 4.904 g

๐Ÿง  Key Takeaway: This script helps you quickly calculate either the normality of a solution or the weight of an acid needed for a desired volume and strength. Great for lab preparations and titrations!

Comments

Popular posts from this blog

✈️ Jet Takeoff Physics Simulator – Interactive Post

Electron Motion in a Electric Field