Grams ↔ Moles Converter
Convert between grams (m) and moles (n) using the molar mass (M). Auto-compute M from a chemical formula, see step-by-step work, and an optional mini chart that links m, M, and n at a glance.
Background
The relationship is m = n × M, where m is mass in grams, n is amount in moles, and M is molar mass in g·mol⁻¹. Provide any two to find the third. You can auto-fill M from a chemical formula or enter M directly.
How to use this converter
- Provide any two: mass m (g), moles n (mol), molar mass M (g·mol⁻¹).
- Auto M: Type a chemical formula to auto-compute M; you may override it.
- Formulas: m = nM, n = m/M, M = m/n.
Formula & Equation Used
Mass: m = n × M
Moles: n = m / M
Molar mass: M = m / n
Example Problems & Step-by-Step Solutions
Example 1 — 5.00 g NaCl → moles
M(NaCl) ≈ 58.44 g·mol⁻¹ → n = 5.00 / 58.44 = 0.0856 mol.
Example 2 — 0.250 mol CO₂ → grams
M(CO₂) ≈ 44.01 g·mol⁻¹ → m = 0.250 × 44.01 = 11.0 g.
Example 3 — M from formula
For Ca(OH)₂: M = 40.08 + 2×(16.00 + 1.008) ≈ 74.09 g·mol⁻¹.
Frequently Asked Questions
Q: Do I need the chemical formula?
Only if you want us to auto-compute M. Otherwise, type M directly.
Q: What if I enter all three values?
We’ll recompute the missing one based on m = nM and show any consistency check in the steps.
Q: Are units important?
Yes: m in grams, n in moles, M in g·mol⁻¹. We follow these units consistently.