Beginner

Grams to Moles Calculator

Convert a mass in grams into the number of moles by dividing by the substance molar mass.

g

Sample mass in grams

g/mol

Leave blank to compute from the formula
Used only when molar mass is blank
Amount of substance
0.9992mol

Molar mass computed from formula: 18.015 g/mol

Mole calculation
n = 18 g / 18.015 g/mol = 0.9992 mol
Mass
18 g
Molar mass
18.015 g/mol
Moles
0.9992 mol
Particles
601,712,648,792,672,750,000,000
1Moles of substance (fill represents fraction of 1 mol reference)
Step by step
  1. 1

    Molar mass (M)

    18.015 g/mol
    Computed by summing standard atomic weights from the chemical formula.
  2. 2

    Moles = mass ÷ molar mass

    18 g ÷ 18.015 g/mol = 0.9992 mol
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

How does this calculator work?

To convert grams to moles, divide the mass in grams by the molar mass in grams per mole: n = m / M. Enter the molar mass directly, or type a chemical formula like H2O and the calculator sums standard atomic weights to find M, then reports the amount of substance in moles.

Formula
n = mass (g) / molar mass (g/mol)
How this is calculated

The number of moles n equals the sample mass m divided by the molar mass M of the substance: n = m / M. Mass is entered in grams and the molar mass in grams per mole, so the result is in moles. One mole is Avogadro number of particles, 6.02214076 x 10^23.

You can supply the molar mass directly, or leave it blank and enter a chemical formula such as H2O, NaCl, C6H12O6 or Ca(OH)2. The calculator then sums standard atomic weights for every atom in the formula (expanding parenthesised groups and their multipliers) to obtain M automatically. The molar mass field always takes priority when it is filled in.

Assumptions and edge cases: mass must be zero or positive, and molar mass must be strictly positive, so a blank or unrecognised formula yields no result. The atomic-weight table uses abridged IUPAC standard values, so molar masses are accurate to roughly four significant figures. Hydrates, isotopes and charge are not modelled.

Frequently asked questions

Either type it directly in g/mol, or enter the chemical formula and let the calculator sum the standard atomic weights of each atom.

Water (H2O) has a molar mass of about 18.015 g/mol, so 18 g of water is roughly 1 mole.

Yes. Formulas with parentheses like Ca(OH)2 are expanded automatically before summing atomic weights.

Also known as

grams to moles
g to mol
moles from mass
mole conversion
convert grams to moles
mass to moles
find moles

APA

TG we-Calculate Editorial Team. (2026). Grams to Moles Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/grams-to-moles-calculator

Chicago

TG we-Calculate Editorial Team. "Grams to Moles Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/grams-to-moles-calculator.

IEEE

TG we-Calculate Editorial Team, "Grams to Moles Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/grams-to-moles-calculator

BibTeX

@misc{wecalculate_grams_to_moles_calculator, title = {Grams to Moles Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/grams-to-moles-calculator}}, year = {2026}, note = {TG we-Calculate} }

Did this calculator help you?