Grams to Moles Calculator

Convert mass (grams) to amount of substance (moles) using accurate molar masses. Select from a library of common compounds, or enter a custom molecular formula and molar mass. Includes step‑by‑step stoichiometry and particle count via Avogadro's constant.

Select a substance from the list or choose "Custom" to enter your own formula and molar mass.
? Water (5 g)
? NaCl (10 g)
? Glucose (25 g)
? CO₂ (2.2 g)
? H₂SO₄ (15 g)
? Ethanol (8 g)
Privacy first: All calculations are performed locally in your browser. No data is sent to any server.

What Is a Mole and Why Does It Matter?

In chemistry, the mole (symbol: mol) is the SI base unit for the amount of substance. One mole contains exactly 6.02214076 × 1023 elementary entities (atoms, molecules, ions, or electrons) — a number known as Avogadro's constant (NA). The mole bridges the microscopic world of atoms and molecules with the macroscopic world of grams and kilograms, enabling chemists to count particles by weighing them.

The concept was pioneered by Amedeo Avogadro in 1811, and the modern definition was adopted by the International System of Units (SI) in 2019, fixing NA as an exact constant. This calculator uses the current IUPAC-recommended molar masses derived from the CIAAW (Commission on Isotopic Abundances and Atomic Weights) standard.

n = m / M

where n = amount (mol), m = mass (g), M = molar mass (g/mol)

How to Use This Tool

  1. Select a substance from the dropdown menu, or choose Custom to enter your own molecular formula and molar mass.
  2. Enter the mass in grams (e.g., 5.0).
  3. Click Calculate — the tool instantly computes the number of moles.
  4. Review the step‑by‑step solution, particle count, and additional substance information.
  5. Use the preset example buttons to quickly test common conversions.

Why Use This Grams‑to‑Moles Calculator?

  • Educational Support: Perfect for chemistry students learning stoichiometry, molar mass, and reaction calculations.
  • Lab Accuracy: Quickly convert reagent masses to moles for solution preparation, titrations, and synthesis planning.
  • Time Saver: No need to manually look up molar masses — the built‑in database covers 15+ common compounds.
  • Custom Flexibility: Enter any substance with its formula and molar mass for complete versatility.
  • Visual Learning: The step‑by‑step derivation reinforces the relationship between mass, moles, and particle count.

The Science Behind the Calculation

The conversion from grams to moles rests on the definition of molar mass: the mass of one mole of a substance. For a given compound, the molar mass is the sum of the atomic masses of all atoms in its molecular formula, expressed in grams per mole (g/mol). Atomic masses are determined by high‑precision mass spectrometry and are published by the IUPAC and NIST.

For example, water (H₂O) has a molar mass of 18.015 g/mol. This means that 18.015 grams of water contain 6.022 × 1023 water molecules. If you have 5.0 g of water, the number of moles is:

n = 5.0 g / 18.015 g/mol = 0.2775 mol

The number of molecules is then: N = 0.2775 mol × 6.022 × 1023 mol⁻¹ ≈ 1.67 × 1023 molecules. This fundamental relationship underpins all of stoichiometry, from balancing chemical equations to predicting yields and determining empirical formulas.

Note on isotopic composition: The molar masses provided in this calculator are based on standard terrestrial isotopic abundances, as compiled by the CIAAW. In practice, variations in isotopic ratios (e.g., ¹⁸O/¹⁶O in water) can shift the effective molar mass at the 5th or 6th decimal place. For most general chemistry, educational, and routine analytical applications, the standard values are fully sufficient. For high‑precision isotope work, one would need to measure or account for the specific isotopic composition of the sample.

Molar Mass Table for Selected Substances

Substance Formula Molar Mass (g/mol) Common Use
Water H₂O 18.015 Solvent, coolant
Sodium Chloride NaCl 58.44 Table salt, brine
Glucose C₆H₁₂O₆ 180.156 Energy source, biochemistry
Sulfuric Acid H₂SO₄ 98.079 Industrial acid, batteries
Carbon Dioxide CO₂ 44.01 Greenhouse gas, carbonation
Sodium Hydroxide NaOH 40.00 Lye, soap making
Ethanol C₂H₅OH 46.07 Alcohol, fuel
Ammonia NH₃ 17.031 Fertilizer, cleaner
Methane CH₄ 16.04 Natural gas, fuel
Calcium Carbonate CaCO₃ 100.086 Antacid, cement
Hydrochloric Acid HCl 36.46 Acid digestion, cleaning
Sodium Bicarbonate NaHCO₃ 84.006 Baking soda, antacid
Acetic Acid CH₃COOH 60.052 Vinegar, chemical synthesis
Sucrose C₁₂H₂₂O₁₁ 342.30 Table sugar
Aspirin C₉H₈O₄ 180.157 Analgesic, anti‑inflammatory
Case Study: Preparing a 0.5 M Glucose Solution

A biochemistry lab needs 250 mL of a 0.5 M (molar) glucose solution for a cell culture experiment. The molar mass of glucose (C₆H₁₂O₆) is 180.156 g/mol.

Step 1: Calculate the number of moles required: n = C × V = 0.5 mol/L × 0.250 L = 0.125 mol.
Step 2: Convert moles to grams: m = n × M = 0.125 mol × 180.156 g/mol = 22.5195 g.

The researcher weighs out 22.52 g of glucose, dissolves it in deionized water, and brings the total volume to 250 mL. Using this calculator, the reverse check is simple: enter 22.52 g of glucose and verify that it equals 0.125 mol — exactly the required amount.

Practical considerations: In a real laboratory, the analytical balance used has a measurement uncertainty (often ±0.1 mg or better). The calculated molarity will inherit this uncertainty. Additionally, the purity of the reagent (e.g., 98% glucose) should be factored in—the effective mass of pure glucose is mass × (purity/100). This tool provides the core stoichiometric conversion, allowing you to easily adjust for purity and other corrections.

This type of calculation is essential in clinical chemistry, pharmaceutical formulation, and food science.

Avogadro's Constant and the Particle Count

The mole is inextricably linked to Avogadro's constant (NA = 6.02214076 × 1023 mol⁻¹). This constant represents the number of particles in one mole. When you know the number of moles (n), you can calculate the total number of particles (N) using:

N = n × NA

For example, 0.2775 mol of water contains 0.2775 × 6.022 × 1023 ≈ 1.67 × 1023 water molecules. This concept is crucial in understanding reaction stoichiometry, gas laws (where the mole relates to volume at STP), and colligative properties.

The 2019 redefinition of the mole made NA an exact constant, eliminating uncertainty in the Avogadro constant and ensuring that the mole is now fundamentally tied to a fixed number of entities rather than to the mass of a reference substance.

Common Mistakes and How to Avoid Them

  • Confusing molar mass with molecular weight: Molar mass is expressed in g/mol, while molecular weight is a dimensionless ratio. The numerical values are the same, but the units differ.
  • Using the wrong formula: Always double‑check the molecular formula of your substance. For hydrates (e.g., CuSO₄·5H₂O), include the water of crystallization in the molar mass calculation.
  • Incorrect unit conversion: Ensure mass is in grams. If you have milligrams (mg), divide by 1000 to convert to grams before using the calculator.
  • Forgetting about significant figures: In lab work, report your answer with the appropriate number of significant figures based on the precision of your measurements.

Applications Across Industries

  • Pharmaceuticals: Dosage calculations, active ingredient formulation.
  • Environmental Chemistry: Measuring pollutant concentrations in air and water.
  • Food Science: Nutritional analysis, ingredient scaling.
  • Materials Science: Polymer synthesis, nanomaterial production.
  • Education: Teaching fundamental stoichiometry to undergraduate and high‑school students.

Data sources and standards: The molar mass values and constants used in this tool are derived from the publicly available databases of the National Institute of Standards and Technology (NIST) and the International Union of Pure and Applied Chemistry (IUPAC). The calculation logic follows the official SI definition of the mole as established by the BIPM. This tool is periodically updated to reflect the latest recommended atomic weights. All code and calculations are transparent and performed client‑side.

Frequently Asked Questions

Molar mass (g/mol) is the mass of one mole of a substance; molecular weight is the ratio of the average mass of one molecule to 1/12 of the mass of a carbon‑12 atom. They are numerically equal but have different units. In practice, the terms are often used interchangeably in the lab.

Use the inverse formula: m = n × M. Multiply the number of moles by the molar mass (g/mol) to obtain the mass in grams. Our companion Moles to Grams Calculator handles this conversion automatically.

Select the Custom option and enter the molecular formula and molar mass manually. You can find molar masses from standard references or by summing atomic masses from the periodic table.

Results are accurate to the precision of the molar mass values (typically 4–6 significant figures) and your input mass. The tool uses double‑precision floating‑point arithmetic, so rounding errors are negligible for typical laboratory and educational purposes.

This calculator is designed for pure substances. For solutions, you first need to know the mass of the solute. For mixtures, you must determine the mass of each component separately, or use the average molar mass if dealing with a polymer or complex blend.

We recommend the Khan Academy Chemistry course, the Chemistry LibreTexts library, and the classic textbook "Chemistry: The Central Science" by Brown, LeMay, and Bursten.