ciencia

Grams to Moles Calculator (n = m ÷ MW)

Calculator Free · Private
Reviewed by: (política editorial ) · Last reviewed:
Was this calculator helpful?

This calculator converts a sample's mass in grams into the number of moles and the total count of molecules using the substance's molecular weight (MW) or molar mass. The core relation is the cornerstone of stoichiometry: n = m / MW, where n is moles, m is mass in grams, and MW is the molar mass expressed in grams per mole (g/mol). Once moles are determined, multiplying by Avogadro's number (Nₐ = 6.02214076 × 10²³ mol⁻¹, a value fixed exactly since the 2019 SI redefinition) yields the absolute molecule count. The mole is the SI base unit for amount of substance and is essential whenever atoms or molecules must be counted rather than weighed — a recurrent need in analytical chemistry, biochemistry, pharmacology, materials science, environmental monitoring, food technology and industrial manufacturing. For example, 18 g of water (H₂O, MW = 18.015 g/mol) equals approximately 1 mole, which contains exactly 6.022 × 10²³ water molecules. Similarly, 58.44 g of sodium chloride (NaCl) equals 1 mole of formula units, the foundation of preparing a 1 M NaCl solution in 1 liter of water. This calculator is calibrated against the IUPAC standard atomic weights maintained by the IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW), and validated against the NIST Chemistry WebBook for common substances. It accepts decimal molecular weights, handles values as small as 1 mg or as large as several kilograms, and presents results in mol and number of molecules with appropriate scientific notation. Beyond the numerical output, the tool returns an interpretation paragraph that contextualizes the result — flagging unusually small or large mole quantities and suggesting common laboratory contexts where such a number appears. Whether you are a chemistry undergraduate verifying a stoichiometry problem, a graduate student preparing reagents for a synthesis protocol, a clinical pharmacologist computing millimole dosages, or a high school teacher building practice problems, this calculator delivers the answer in milliseconds with the level of precision needed for academic and professional work.

Last reviewed: June 3, 2026 Verified by Source: NIST Chemistry WebBook — Molecular Weights & Physical Properties, NIST — Avogadro Constant (Fundamental Physical Constants), IUPAC — Atomic Weights of the Elements 2021 (CIAAW), Wikipedia — Mole (unit) 100% private

To convert grams to moles: **n = m (g) ÷ MW (g/mol)**. Example: 18 g of water (MW = 18.015 g/mol) = 0.9992 mol ≈ 1 mol = 6.02 × 10²³ molecules. Multiply moles by Avogadro's number (6.02214076 × 10²³ mol⁻¹) to get the molecule count.

When to use this calculator

  • Preparing a 1 M NaCl solution in the lab: weigh exactly 58.44 g of NaCl (MW = 58.44 g/mol) to obtain 1.000 mol dissolved in 1 L of water — the basis of clinical saline preparations.
  • Calculating the number of glucose molecules (MW = 180.16 g/mol) in a 5 g sugar packet: 5 / 180.16 = 0.02776 mol = 1.672 × 10²² individual glucose molecules.
  • Pharmacy dosage calculations: converting 325 mg aspirin tablets (MW = 180.157 g/mol) into 1.804 mmol for pharmacokinetic modeling and patient-specific dosing.
  • Stoichiometry exercises: determining moles of CO₂ produced when burning 12 g of carbon: 12 g / 12.011 g/mol = 0.999 mol C → 0.999 mol CO₂ = 43.97 g of CO₂ released.
  • Industrial scale-up of a synthesis: converting a kilogram-scale reagent (e.g., 5 kg = 5000 g of NaOH, MW = 39.997 g/mol) into 125.01 mol for reactor stoichiometry planning.
  • Environmental analysis: computing micromoles of a pollutant detected in a 1 L water sample, where 0.5 mg of arsenic (MW = 74.92 g/mol) = 6.67 × 10⁻⁶ mol = 6.67 µmol = 4.02 × 10¹⁸ atoms.
  • Biochemistry: calculating moles of ATP (MW = 507.18 g/mol) needed for an in vitro enzymatic assay where the protocol calls for 10 µmol → 5.072 mg of ATP.

Worked Example: 18 g of Water (H₂O)

  1. Mass: m = 18 g | Molecular weight of H₂O: MW = 18.015 g/mol
  2. n = 18 ÷ 18.015 = 0.9992 mol ≈ 1 mol
  3. Molecules: N = 0.9992 × 6.02214076 × 10²³ = 6.017 × 10²³ molecules
Result: 18 g of water ≈ 1 mol ≈ 6.02 × 10²³ molecules

How it works

3 min read

How It Is Calculated

The mole is the SI base unit for amount of substance, defined since 2019 as exactly 6.02214076 × 10²³ elementary entities (Avogadro's number, Nₐ).

n  = m / MW                          # moles
N  = n × Nₐ                          # number of molecules
   = (m / MW) × 6.02214076 × 10²³

SymbolMeaningUnit
nAmount of substancemol
mMass of sampleg
MWMolar mass (molecular weight)g/mol
NₐAvogadro's number (6.02214076×10²³)mol⁻¹
NNumber of molecules/formula units

---

Reference Table — Common Substances

SubstanceFormulaMW (g/mol)1 mol mass (g)Common use
WaterH₂O18.01518.015Universal solvent, lab standard
Sodium chlorideNaCl58.4458.44Saline solutions
GlucoseC₆H₁₂O₆180.16180.16Blood sugar, energy metabolism
Oxygen gasO₂31.99831.998Respiration, combustion
Carbon dioxideCO₂44.01044.010Greenhouse gas, carbonation
EthanolC₂H₅OH46.06846.068Beverages, antiseptic
AspirinC₉H₈O₄180.157180.157Pain relief (325 mg/tablet)
CaffeineC₈H₁₀N₄O₂194.19194.19Stimulant (~95 mg/8 oz coffee)
Hydrogen gasH₂2.0162.016Fuel cells, hydrogenation
AmmoniaNH₃17.03117.031Fertilizers, cleaning agents

Molecular weights sourced from NIST Chemistry WebBook (webbook.nist.gov).

---

Typical Examples with Numbers

Example 1 — Water (H₂O)


  • Given: m = 18 g, MW = 18.015 g/mol

  • n = 18 / 18.015 = 0.9992 mol ≈ 1 mol

  • N = 0.9992 × 6.02214076 × 10²³ = 6.017 × 10²³ molecules

  • Interpretation: nearly one full mole; rounding MW to 18 gives exactly 1 mol.
  • Example 2 — Glucose (C₆H₁₂O₆) in a sugar packet


  • Given: m = 5 g, MW = 180.16 g/mol

  • n = 5 / 180.16 = 0.02776 mol (27.76 mmol)

  • N = 0.02776 × 6.02214076 × 10²³ = 1.672 × 10²² molecules

  • Interpretation: less than 3 hundredths of a mole — moles make tiny masses countable.
  • Example 3 — NaCl for a 1 M solution


  • Given: m = 58.44 g, MW = 58.44 g/mol

  • n = 58.44 / 58.44 = 1.000 mol

  • N = 6.022 × 10²³ formula units of NaCl

  • Interpretation: dissolve in 1 L → 1 M solution, standard in clinical labs.
  • ---

    Common Errors

    1. Using atomic weight instead of molecular weight — Carbon's atomic weight is 12.011 g/mol, but CO₂ is 44.010 g/mol. Always sum all atoms in the formula.
    2. Forgetting to convert units before dividing — Mass must be in grams, not milligrams or kilograms. 325 mg of aspirin = 0.325 g; 0.325 / 180.157 = 0.001804 mol, not 1.804 mol.
    3. Confusing moles with molarity — Moles (n) measure amount; molarity (M = n/V) measures concentration. A solution can have 2 mol of NaCl in 2 L and still be 1 M.
    4. Rounding molecular weight too early — Using MW = 18 instead of 18.015 for water introduces a 0.08% error, which matters in analytical chemistry and pharmaceutical compounding.
    5. Applying Avogadro's number to atoms inside a molecule — 1 mol of H₂O contains 6.022 × 10²³ molecules, but 2 × 6.022 × 10²³ hydrogen atoms and 6.022 × 10²³ oxygen atoms. Multiply N by the atom count per molecule to get total atoms.

    ---

    Related Calculators

    Since no internal related calculators are currently listed for this topic, explore other science tools on Hacé Cuentas to support your chemistry and physics work.

    Frequently asked questions

    How do you convert grams to moles?

    Use the formula n = m ÷ MW, where n is moles, m is mass in grams, and MW is the molecular weight (molar mass) in g/mol. Example: 36 g of water (MW = 18.015 g/mol) → n = 36 ÷ 18.015 = 1.999 mol ≈ 2 mol = 1.204 × 10²⁴ molecules. To convert moles back to grams, rearrange: m = n × MW.

    What is a mole in chemistry?

    A mole is the SI unit for amount of substance, defined as exactly 6.02214076 × 10²³ elementary entities (atoms, molecules, ions, electrons, or other particles). This number is Avogadro's constant, redefined with its exact integer value in the 2019 SI revision. One mole of any substance contains the same number of particles, regardless of identity. The mole is essential because chemists work with macroscopic masses (grams, kilograms) but reactions occur at the molecular level — the mole bridges those two scales.

    How do I find the molecular weight of a compound?

    Sum the standard atomic weights of every atom in the molecular formula. For water (H₂O): 2 × 1.008 (H) + 1 × 15.999 (O) = 18.015 g/mol. For glucose (C₆H₁₂O₆): 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol. Standard atomic weights are published by IUPAC's Commission on Isotopic Abundances and Atomic Weights (CIAAW) and reflect natural isotopic composition. The NIST Chemistry WebBook at webbook.nist.gov provides authoritative values for tens of thousands of compounds. Most periodic tables include atomic weights below each element symbol — use those values directly for educational and most laboratory calculations.

    What is the difference between molar mass and molecular weight?

    Molecular weight (MW) is technically dimensionless — it expresses how heavy a molecule is compared to 1/12 the mass of carbon-12. Molar mass is the mass of one mole of a substance, expressed in grams per mole (g/mol). Numerically, both are equal: water has MW = 18.015 and molar mass = 18.015 g/mol. In daily laboratory and educational practice, the terms are used interchangeably, and you can substitute one for the other without changing any calculation result. The distinction matters only in rigorous scientific writing or thermodynamic equations where dimensional consistency is enforced.

    Why does 1 mole of different substances have different masses?

    Because atoms of different elements have different masses. One mole always contains ~6.022 × 10²³ particles by definition, but heavier atoms weigh more per particle than lighter ones. Hydrogen (the lightest element) has an atomic weight of 1.008 g/mol, so 1 mol of H atoms weighs only 1.008 g. Iron has atomic weight 55.845 g/mol, so 1 mol of Fe weighs 55.845 g. Uranium (one of the heaviest naturally occurring elements) has atomic weight 238.03 g/mol, so 1 mol of U weighs 238.03 g. The same logic applies to molecules: water (small, light atoms) has MW 18.015 g/mol; sucrose (a large sugar) has MW 342.30 g/mol.

    How many molecules are in 1 gram of water?

    Using n = 1 / 18.015 = 0.05551 mol, then N = 0.05551 × 6.02214076 × 10²³ = 3.343 × 10²² molecules. That is 33.43 sextillion water molecules in a single gram — a number so large it dwarfs all human counting capacity. To put it in perspective: if you tried to count one molecule per second, counting them all would take more than 10¹⁵ years (over 70,000 times the current age of the universe). This is exactly why the mole concept is essential: it lets chemists work with manageable numbers (1, 2, 0.5 mol) instead of unwieldy molecular counts (10²², 10²³, 10²⁴).

    Can I use this calculator for ionic compounds like NaCl?

    Yes. For ionic compounds, you calculate formula units rather than discrete molecules, but the mathematics is identical: n = m / MW. NaCl has MW = 58.44 g/mol (sum of Na = 22.99 and Cl = 35.45), so 29.22 g of NaCl = 0.5 mol = 3.011 × 10²³ formula units. Each formula unit consists of one Na⁺ cation and one Cl⁻ anion. The same approach works for other ionic salts: KNO₃ (MW = 101.10 g/mol), CaCl₂ (MW = 110.98 g/mol), CuSO₄·5H₂O (MW = 249.69 g/mol including waters of hydration). For ionic species the term "formula unit" is technically more accurate than "molecule", though they are commonly used interchangeably.

    What is Avogadro's number and why is it that specific value?

    Avogadro's number (Nₐ = 6.02214076 × 10²³ mol⁻¹) was fixed at this exact value during the 2019 SI redefinition. Before 2019, the mole was defined as the number of atoms in 12 g of carbon-12, and Nₐ was measured experimentally with increasing precision over decades (the best measurements were accurate to 9 significant figures). Since 2019, this relationship reversed: Nₐ is now an exact defined constant, and 1 mole of carbon-12 weighs approximately 12 g (with negligible uncertainty). This change improved metrological consistency across all SI base units. NIST maintains the exact value at physics.nist.gov/cgi-bin/cuu/Value?na.

    How do I convert moles back to grams?

    Rearrange the formula: m = n × MW. For example, 2.5 mol of CO₂ (MW = 44.010 g/mol) = 2.5 × 44.010 = 110.025 g. This reverse calculation is essential when preparing reagents at a specified molar quantity in the laboratory. Other common reverse examples: 0.1 mol of NaOH (MW = 39.997 g/mol) = 3.9997 g (needed for a 0.1 M solution in 1 L); 0.025 mol of glucose (MW = 180.16 g/mol) = 4.504 g; 1 mmol of caffeine (MW = 194.19 g/mol) = 0.19419 g = 194.19 mg. Note that 1 mmol = 0.001 mol, so when working in millimoles divide masses in milligrams by MW.

    How does the mole concept relate to molarity (M)?

    Molarity is the most common concentration unit in chemistry: M = mol of solute / liters of solution. The mole is the amount; molarity is the concentration. For example: dissolving 1 mol of NaCl (58.44 g) in enough water to make 1 L of solution gives a 1 M (or 1 molar) NaCl solution. Dissolving the same 58.44 g in 2 L gives a 0.5 M solution — same amount of NaCl, lower concentration. Other concentration units derived from moles include molality (mol/kg of solvent), mole fraction (mol of one component / total mol), and normality (equivalents/L). All of these require first calculating the number of moles, which is the role of this calculator.

    Why does atomic weight have decimals (like 12.011 for carbon)?

    Because elements in nature occur as mixtures of isotopes with slightly different masses. Carbon, for example, is 98.93% ¹²C (mass 12 exactly, by definition) and 1.07% ¹³C (mass 13.003). The natural average — weighted by abundance — comes to 12.011. This is the standard atomic weight reported by IUPAC. For an isotopically pure sample of ¹²C, you would use mass 12.000; for natural carbon, use 12.011. The same principle applies to chlorine (35.45, mostly ³⁵Cl with some ³⁷Cl), bromine (79.90), and most elements. In analytical or nuclear chemistry, isotope-specific molar masses are sometimes used; in general laboratory work, the standard atomic weights are sufficient.

    Is the mole the same as Avogadro's number?

    They are closely related but not identical concepts. A mole is a unit of measurement for amount of substance (similar to how "dozen" is a unit meaning 12). Avogadro's number (Nₐ) is the count of particles in one mole: 6.02214076 × 10²³. You wouldn't say "I have 12 of a dozen apples" — you would say "I have one dozen apples" or "I have 12 apples". Likewise: "I have 1 mole of water" is correct, and that mole contains 6.022 × 10²³ water molecules. The number Nₐ is the conversion factor between moles and particle count, just as 12 is the conversion factor between dozens and individual items.

    Sources and references