This calculator converts a mass in grams to the number of moles and the number of atoms (or molecules) using the substance’s molar mass and Avogadro’s constant. Enter the mass, the molar mass (or pick a common compound), and you get the moles and the particle count instantly.
Formula
The core conversion uses two equations:
- Moles from mass: n = m / M, where n is the amount in moles, m is the mass in grams, and M is the molar mass in g/mol.
- Particles from moles: N = n × NA, where N is the number of atoms (or molecules) and NA is Avogadro’s constant, 6.02214076 × 1023 particles per mole.
For a compound like NaCl, the molar mass is the sum of the atomic weights of its elements: Na (22.990 g/mol) + Cl (35.45 g/mol) = 58.44 g/mol. For an element like carbon, the molar mass is simply its atomic weight (12.011 g/mol).
Worked Example
Using the default values from the calculator: mass = 2.922 g of NaCl, molar mass = 58.44 g/mol.
- Compute moles: n = 2.922 g / 58.44 g/mol = 0.05000 mol (rounded to 4 decimal places).
- Compute atoms (strictly, formula units of NaCl): N = 0.05000 mol × 6.02214076 × 1023 mol−1 = 3.011 × 1022 particles.
The calculator shows the same: 0.0500 mol and 3.011 × 1022 particles. Note that for an ionic compound like NaCl, the “particles” are formula units, not individual atoms; if you want the total number of individual atoms, multiply by the number of atoms per formula unit (2 for NaCl).
Assumptions
- The substance is pure and has the exact molar mass entered.
- Avogadro’s constant is exactly 6.02214076 × 1023 mol−1 (SI definition).
- For compounds, the molar mass is the sum of the atomic weights of the elements in the formula, using IUPAC standard atomic weights.
- The conversion works for any element, molecule, or ionic compound; the result is the number of formula units, not necessarily individual atoms.
When to Use This Conversion
You need this conversion whenever you are moving between the macroscopic world (grams you can weigh on a balance) and the microscopic world (counts of atoms or molecules). Common situations include:
- Stoichiometry problems: balancing chemical equations requires mole ratios, so you convert given masses to moles first.
- Preparing solutions: molarity (mol/L) requires moles of solute, which you get from the mass and molar mass.
- Calculating the number of atoms in a sample, e.g., to estimate how many atoms are in a penny or a grain of salt.
- Converting between mass and particle counts in spectroscopy, nuclear chemistry, or materials science.
The result from the calculator is the amount of substance in moles and the particle count. If you need the number of atoms of a specific element in a compound, multiply by the subscript of that element in the formula.
How to Choose the Molar Mass
The molar mass is the mass of one mole of the substance, expressed in g/mol. For an element, use its atomic weight from the periodic table (e.g., H = 1.008, C = 12.011, O = 15.999). For a molecule, add the atomic weights of all atoms in the formula. For example:
- Water (H2O): 2 × 1.008 + 15.999 = 18.015 g/mol
- Carbon dioxide (CO2): 12.011 + 2 × 15.999 = 44.009 g/mol
- Glucose (C6H12O6): 6 × 12.011 + 12 × 1.008 + 6 × 15.999 = 180.156 g/mol
If you are using a hydrated salt, include the water of hydration in the molar mass (e.g., CuSO4·5H2O has a molar mass of 249.685 g/mol). The calculator accepts any positive molar mass; the default is NaCl.
Common Mistakes and Misconceptions
One frequent error is confusing mass with moles. Grams are a measure of mass; moles are a count of particles. They are proportional only through the molar mass. Another mistake is using the wrong molar mass, especially for hydrated compounds or isotopes. Also, remember that Avogadro’s number is enormous: 6.022 × 1023 per mole, so the particle count is always a huge number for any macroscopic sample.
A common misconception is that one mole of any substance contains the same number of atoms. That is true for elements, but for compounds, one mole contains Avogadro’s number of molecules, not atoms. For example, one mole of CO2 contains 6.022 × 1023 molecules, but 3 × 6.022 × 1023 atoms (since each molecule has 3 atoms).
Another pitfall is rounding too early. If you round the molar mass to 58.4 instead of 58.44, the moles will be slightly off. Keep at least 4 significant figures in intermediate steps.
How to Read the Result
The first output, moles, is a decimal number (e.g., 0.0500 mol). The second output, particle count, is displayed in scientific notation (e.g., 3.011 × 1022). This is because the number is either extremely large (for grams) or extremely small (for a few atoms). The calculator shows 4 decimal places for moles and 4 significant figures for the particle count. If you need more precision, you can increase the decimal places in your own calculations.
For example, if you enter 12.011 g of carbon (molar mass 12.011 g/mol), you get exactly 1.0000 mol and 6.022 × 1023 atoms—that is Avogadro’s number. That is a good sanity check.
Limits and Extensions
This calculator assumes a pure substance. If you have a mixture, you need the average molar mass. It also assumes the molar mass is constant, which is true for a given isotope or molecular formula. For gases, the conversion to volume requires the ideal gas law (PV = nRT), not this calculator. For solutions, you would also need the concentration to find volume.
The calculator does not handle isotopic mixtures automatically; if you have a specific isotope, use its exact atomic mass. For most chemistry problems, the standard atomic weights are sufficient.
If you need to convert atoms to grams, you can reverse the process: divide the number of atoms by Avogadro’s number to get moles, then multiply by the molar mass. This calculator only does grams→moles→atoms, but the reverse is straightforward.
Frequently Asked Questions
How do I convert grams to moles? Divide the mass in grams by the molar mass (g/mol). For example, 10 g of water (molar mass 18.015 g/mol) is 10 / 18.015 = 0.555 mol.
How many atoms are in one mole? Exactly 6.02214076 × 1023 particles. This is Avogadro’s constant, defined by the SI system.
What is the difference between atoms and molecules in this conversion? The calculator gives the number of formula units. For an element, that is atoms. For a molecular compound, it is molecules. For an ionic compound, it is formula units (e.g., NaCl units). To get individual atoms, multiply by the number of atoms per formula unit.
Can I use this for any element or compound? Yes, as long as you enter the correct molar mass. The calculator is generic; it does not know the substance, so you must provide the molar mass.
Why is the particle count shown in scientific notation? Because Avogadro’s number is about 6.022 × 1023, so any macroscopic sample has a particle count in the 1020–1025 range. Scientific notation keeps the number readable.
What if I have a mass in milligrams or kilograms? Convert to grams first: 1 mg = 0.001 g, 1 kg = 1000 g. Then use the calculator as usual.
Related
Formula used
in m | Mass of solute | g | 2.922 | 0 in mm | Molar mass | g/mol | 58.44 | 0.001 out n | Amount of substance | mol | m / mm | 4 out N | Number of particles | - | n * 6.02214076e23 | 4
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.
More in this section
- 10×10 Calculator: 10 Ways It Saves You Time
- 10 x 100 Calculator: Fast Multiplication Tool
- Moles to Atoms: How to Convert & Count Particles1.506 × 1024 atoms
- Number of Moles of Oxygen Atoms Explained
- Half-Life Formula: Number of Half-Lives4.00
- Half Life Calculator: How It Works & How to Use12.5000 g