Grams to Moles Calculator
Mass, moles, particles and gas volume of any substance, with every step shown.
Atoms of each element in the sample
How it was worked out
About the Grams to Moles Calculator
Convert between the four ways chemists count a substance: mass in grams, amount in moles, the number of particles (molecules, atoms, ions or formula units) and, for gases, the volume at STP or at any temperature and pressure. Type a formula or a name and the molar mass is worked out for you from IUPAC (CIAAW 2024) atomic weights — or type a molar mass yourself, in g/mol or kDa for a protein.
Whichever quantity you know, the calculator gives all the others at once, the number of atoms and the mass of each element in the sample, and the dimensional analysis behind every number, using the exact Avogadro constant 6.022 140 76 × 10²³ mol⁻¹ and molar gas constant R = 8.314 462 618… J/(mol·K).
How to use it
- Type the substance as a formula (
H2O,CuSO4·5H2O) or a name (glucose), or choose Molar mass and type it. - Choose what you know — Mass, Amount, Particles or Gas volume — and type the value with its unit. Large numbers can be written as
6.022e23or6.022 × 10^23. - For gases, pick the conditions: IUPAC STP (0 °C, 100 kPa), the older 0 °C and 1 atm, 25 °C, or your own temperature and pressure.
- Read the converted value, the other quantities and the atoms of each element; open the steps to follow the unit conversions.
Examples
25 g of H2O
1.388 mol — 8.357 × 10²³ molecules
25 g ÷ 18.015 g/mol.
2.561 mol of Au
504.4 g
OpenStax Chemistry 2e prints 504.5 g (Check Your Learning after Example 3.4), which matches gold rounded to 197.0 g/mol.
5.00 g of Cu
4.738 × 10²² atoms
OpenStax Example 3.5: 4.74 × 10²² Cu atoms.
9.213 g of C4H10
9.545 × 10²² molecules and 9.545 × 10²³ hydrogen atoms
1 mol of any ideal gas
22.711 L at IUPAC STP (0 °C, 100 kPa); 22.414 L at 0 °C and 1 atm
Molar mass 66.5 kDa, 10 mg
1.504 × 10⁻⁷ mol (150.4 nmol)
Common uses
- Chemistry homework on the mole: grams ↔ moles ↔ particles, step by step.
- Working out how many molecules or atoms are in a weighed sample.
- Gas problems at STP or at room conditions: litres ↔ moles ↔ grams.
- Converting a protein or polymer mass to moles from its molar mass in kDa.
The formulas
- Mass and amount: n = m ÷ M, so m = n × M, where M is the molar mass in g/mol.
- Amount and particles: N = n × N_A, where N_A = 6.022 140 76 × 10²³ mol⁻¹ is the Avogadro constant. Since 2019 this number is exact: one mole contains exactly 6.022 140 76 × 10²³ elementary entities — atoms, molecules, ions, electrons or other specified particles (BIPM, SI base unit mole).
- Amount and gas volume: V = n × V_m, with the ideal-gas molar volume V_m = R·T ÷ p. R = 8.314 462 618… J/(mol·K) is exact too (R = N_A·k).
Which STP?
IUPAC defines standard conditions for gases as 273.15 K (0 °C) and 10⁵ Pa (100 kPa), and recommends that the older pressure of 1 atm (101.325 kPa) no longer be used (Gold Book). Many textbooks still use 0 °C and 1 atm, so both are offered:
- 0 °C and 100 kPa: V_m = 22.710 954 64… L/mol
- 0 °C and 1 atm: V_m = 22.413 969 54… L/mol
- 25 °C and 100 kPa: 24.790 L/mol; 25 °C and 1 atm: 24.465 L/mol
The first two are CODATA 2022 values; the others follow from V_m = R·T ÷ p. The two STPs differ by 1.3 %, so check which one your course or data source uses.
Molecules, atoms, formula units and ions
The particle count is named after the substance: atoms for an element such as Cu or He, molecules for molecular substances such as H₂O, O₂ or glucose, formula units for ionic compounds such as NaCl or NH₄Cl (which have no molecules), and ions for a charged formula. The table of elements also gives the atoms of each element: one mole of H₂O holds two moles of H atoms.
Sources
- BIPM, SI base unit: mole, and The International System of Units (SI Brochure, 9th edition, 2019).
- NIST CODATA 2022: Avogadro constant, molar gas constant, molar volume at 273.15 K and 100 kPa and at 273.15 K and 101.325 kPa.
- IUPAC Compendium of Chemical Terminology (Gold Book), standard conditions for gases.
- IUPAC CIAAW, Standard Atomic Weights 2024 (molar masses).
- OpenStax, Chemistry 2e (CC BY 4.0), §3.1 Formula Mass and the Mole Concept (worked examples).
- NIST SP 811 (2008), Appendix B.8 (pressure and mass units).
Limitations
- Gas volumes assume ideal behaviour. Real gases deviate a little, more at high pressure and low temperature, and the volume of a solid or liquid has nothing to do with these figures (use its density).
- Molar masses from a formula apply to normal isotopic composition; isotopically labelled formulas use the label’s mass.
- Results are shown to the significant figures you choose: round your final answer to the precision of your data.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
How do I convert grams to moles?
Divide the mass by the molar mass: n = m ÷ M. For 25 g of water, 25 g ÷ 18.015 g/mol = 1.388 mol.
How do I convert moles to grams?
Multiply by the molar mass: m = n × M. Two moles of NaCl weigh 2 × 58.440 = 116.88 g.
How many molecules are in a mole?
Exactly 6.022 140 76 × 10²³ — the Avogadro number, fixed by the 2019 SI definition of the mole. Multiply moles by it to get particles; divide particles by it to get moles.
What is the volume of one mole of gas at STP?
For an ideal gas, 22.711 L at IUPAC STP (0 °C and 100 kPa) and 22.414 L at 0 °C and 1 atm, the older definition many textbooks use. At 25 °C and 1 atm it is 24.465 L.
Can I use it for a protein or a polymer?
Yes. Choose Molar mass and type it in kDa (1 kDa = 1,000 g/mol). 10 mg of a 66.5 kDa protein is 1.504 × 10⁻⁷ mol, or 150.4 nmol.
Why does my answer differ slightly from my textbook’s?
Usually because of rounded atomic weights (gold as 197.0 instead of 196.966 57, for example) or a different STP. The calculator uses full CIAAW 2024 atomic weights and shows which conditions it used.