Grams to Moles Calculator

This professional calculator converts between mass (grams) and amount of substance (moles) for any chemical formula. It precisely parses formulas (including parentheses and hydrates like CuSO4·5H2O), computes molar mass from authoritative atomic weights, and returns moles, mass, and number of molecules. Ideal for students, educators, and lab professionals seeking fast, reliable results.

Data Source and Methodology

Authoritative Data Sources:

  • IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW). Standard Atomic Weights of the Elements (2013; updates through 2021). https://ciaaw.org/atomic-weights.htm
  • Bureau International des Poids et Mesures (BIPM). The International System of Units (SI), 9th edition (2019) — exact Avogadro constant NA = 6.02214076×1023 mol−1. SI Brochure

Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.

The Formula Explained

Molar mass from formula

LaTeX: M = \sum_i n_i \, A_i

Grams → Moles

LaTeX: n = \dfrac{m}{M}

Moles → Grams

LaTeX: m = n \, M

Molecules from moles

LaTeX: N = n \, N_A

Where Ai is the standard atomic weight of element i, ni is the count of atoms of element i in the formula unit, M is molar mass, m is mass, n is the amount of substance, and NA is the Avogadro constant.

Glossary of Variables

  • Chemical formula — The stoichiometric representation of the substance (e.g., H2O, NaCl, Ca(OH)2, CuSO4·5H2O).
  • Molar mass (M) — Mass per mole of entities, in g/mol, computed from the formula and atomic weights.
  • Mass (m) — The mass of the sample, typically entered in grams (g). The tool also accepts mg and kg.
  • Moles (n) — Amount of substance in mol.
  • Molecules (N) — Number of formula units: N = n × NA.
  • NA — Avogadro constant, exactly 6.02214076×1023 mol−1.
  • Significant figures — The display precision for results; does not affect internal calculation precision.

Worked Example

How It Works: A Step-by-Step Example

Find the amount of substance in 5.00 g of sodium chloride (NaCl):

  1. Parse the formula: NaCl → Na:1, Cl:1.
  2. Compute molar mass: LaTeX: M(\mathrm{NaCl}) = A(\mathrm{Na}) + A(\mathrm{Cl}) \approx 22.98977 + 35.453 = 58.44277\ \mathrm{g\,mol^{-1}}
  3. Apply grams-to-moles: LaTeX: n = \dfrac{m}{M} = \dfrac{5.00}{58.44277} \approx 0.08556\ \mathrm{mol}
  4. Optional molecules: LaTeX: N = n\,N_A \approx 0.08556 \times 6.02214076\times10^{23} \approx 5.15\times10^{22}

Frequently Asked Questions (FAQ)

What inputs do I need?

Provide a valid chemical formula and one known quantity: either mass (with unit) or moles. The calculator derives the rest.

Does the tool handle hydrates and nested parentheses?

Yes. Use a dot for hydrates (CuSO4·5H2O) and parentheses for groups (e.g., Al2(SO4)3). Multiple nesting levels are supported.

How accurate are the atomic weights?

Atomic weights come from IUPAC’s CIAAW standard tables. Outputs are rounded to your chosen significant figures for display, but internal calculations use higher precision.

Can I switch between grams and moles?

Yes, use the toggle at the top of the calculator to convert in either direction.

How is the number of molecules computed?

It uses N = n × NA with the exact Avogadro constant NA = 6.02214076×1023 mol−1.

Why do I see an error for my formula?

Ensure correct capitalization (e.g., Co vs. CO), valid element symbols, balanced parentheses, and numeric subscripts only.

What are common use cases?

Preparing solutions, verifying stoichiometry in reactions, and converting measurements from lab balances into moles for calculations.

Tool developed by Ugo Candido. Content verified by Chemistry SME Review Team.
Last reviewed for accuracy on: .