molecalculator

Moles & Molar Mass

Grams to Atoms Calculator and Step-by-Step Method

Calculator No. 01-0689 · Updated · Formula and assumptions shown below

Number of atoms 6.022 × 1023 atoms
Amount of substance
1.000000 mol
= Sample mass ÷ Molar mass of element
Sample mass
12.011 g
Set in the form below
Molar mass of element
12.011 g/mol
Set in the form below
You enter
Sample mass (g), Molar mass of element (g/mol)
You get
Number of atoms (atoms), Amount of substance (mol)
Rounding
0 dp · 6 dp

For study and lab planning. The result follows from the numbers you enter and the formula shown. Check it against your method before you weigh, mix or dilute anything, follow the safety data sheet and your supervisor, and do not use it for clinical, dosing or medication work.

This calculator converts a sample’s mass in grams into the number of atoms it contains. Enter the mass and the element’s molar mass in grams per mole; the result uses Avogadro’s constant to give an atom count. Use it for a pure element, not a compound unless you account for how many atoms of the chosen element each formula unit contains.

Formula

First convert mass to amount of substance, then convert moles to atoms:

Atoms = (mass in grams ÷ molar mass in grams per mole) × Avogadro’s constant

In symbols, N = (m ÷ M) × NA.

  • N is the number of atoms, in atoms.
  • m is the sample mass, in grams (g).
  • M is the element’s molar mass, in grams per mole (g/mol).
  • NA is Avogadro’s constant, exactly 6.02214076 × 1023 mol−1.

The calculator also reports the intermediate amount, n = m ÷ M, in moles. Molar mass has units of g/mol, so dividing grams by g/mol leaves mol; multiplying by mol−1 gives a count of atoms. The atom count is a theoretical particle count and can be fractional in the arithmetic, even though individual atoms are discrete.

Worked Example

Find the number of carbon atoms in 12.011 g of carbon. These are the calculator’s default inputs: mass = 12.011 g and molar mass = 12.011 g/mol.

  1. Calculate the amount in moles: n = 12.011 g ÷ 12.011 g/mol = 1 mol.
  2. Multiply by Avogadro’s constant: N = 1 mol × 6.02214076 × 1023 atoms/mol = 6.02214076 × 1023 atoms.
  3. Rounded to the calculator’s zero decimal places, the result is 602214076000000000000000 atoms, or approximately 6.022 × 1023 atoms.

The second output is 1.000000 mol. The calculator’s headline result is displayed as a whole-number count; scientific notation is usually clearer for such a large number.

Assumptions

  • The sample is a pure element, and the supplied molar mass matches its chemical identity.
  • The calculation treats the material’s atoms as countable particles and uses the exact SI value of Avogadro’s constant.
  • For an element with multiple naturally occurring isotopes, use its standard atomic weight as the average molar mass unless the sample’s isotope composition is known and a more specific value is needed.

What You’ll Need

  • The sample’s mass in grams. If it is given in another unit, convert it to grams first.
  • The correct molar mass in g/mol. For an element, use its atomic weight from a reliable periodic table, expressed as g/mol. The example uses carbon’s standard atomic weight, 12.011 g/mol.
  • A calculator, or the calculator fields above. Keep extra digits during the calculation and round only the final result to suit the measurement.

If you are weighing a real sample in a lab, follow your lab method, the safety data sheet (SDS) and your supervisor.

Step-by-Step

  1. Identify what particles you are counting. For a sample of a pure element such as copper, the desired particles are atoms of that element. A molecule or ionic compound is different: its molar mass describes formula units or molecules, and you may need an additional factor to count atoms of a particular element.
  2. Find the mass in grams. Enter the measured mass as a nonnegative number. Convert other units before entering them: 1 kg = 1000 g, and 1 mg = 0.001 g. Do not enter milligrams as though they were grams.
  3. Look up the molar mass. Enter the value in g/mol. For a single element, the numerical value of its atomic weight in unified atomic mass units corresponds to its molar mass in g/mol. For instance, oxygen is about 15.999 g/mol. Use the appropriate isotope-specific molar mass if the sample is enriched in a particular isotope.
  4. Divide grams by molar mass. This gives moles: n = m ÷ M. One mole contains Avogadro’s constant number of specified particles. The calculator shows this intermediate amount so you can check that the units and scale make sense.
  5. Multiply moles by Avogadro’s constant. Calculate N = n × 6.02214076 × 1023. The result is the number of atoms corresponding to the sample mass and molar mass.
  6. Report a sensible number of significant figures. The conversion constant is exact, but a measured mass and an average molar mass are not necessarily exact. Round the result to reflect the least precise input; use scientific notation for very large counts.

Common Mistakes

  • Using the wrong mass unit: entering 250 mg as 250 g makes the result 1000 times too large. Convert first: 250 mg = 0.250 g.
  • Using atomic mass as a divisor without units: use the molar mass in g/mol. Its numerical value may match the periodic-table atomic weight, but the units are essential to the conversion.
  • Using a compound’s molar mass as if it counted one atom: a mole of water molecules contains two moles of hydrogen atoms and one mole of oxygen atoms. Molecules and atoms are not interchangeable.
  • Rounding too early: keep the full molar-mass value and calculator digits until the end. Premature rounding can change the final significant figures.
  • Assuming every sample of an element has exactly the standard atomic weight: isotope composition can affect molar mass. Standard atomic weights are appropriate for ordinary natural materials, not necessarily specially enriched samples.

Tips

  • Write down units at every stage: g ÷ (g/mol) = mol, then mol × atoms/mol = atoms.
  • Use the intermediate mole value as a quick check. If a small mass of a heavy element appears to contain many moles, check the molar mass and units.
  • For a compound, calculate moles of compound first, then multiply by the number of atoms of the element in each formula unit. For example, each carbon dioxide molecule contains one carbon atom and two oxygen atoms.
  • If the problem asks for total atoms in a compound, add the atom counts for each element, or multiply the number of molecules by the total atoms per molecule.
  • Distinguish an exact conversion from measurement precision: Avogadro’s constant is exact, but a scale reading has uncertainty.

Troubleshooting

The result is far too large or small: check whether the mass was converted to grams, and whether the molar mass is in g/mol rather than kg/mol. Check that you did not multiply by the molar mass where the formula requires division.

The calculator rejects an input: mass must be zero or positive, and molar mass must be positive. Enter a decimal point if needed, and remove unit text or thousands separators from numeric fields.

The answer does not match a textbook: compare the atomic-weight value and rounding convention. A book may use a rounded molar mass or a specified isotope. Also confirm whether it asks for atoms, molecules, ions, or formula units.

You have a compound rather than a pure element: decide which particle count is required. Use the compound’s molar mass to find moles of molecules or formula units, then apply its chemical formula to obtain the count of the desired atoms.

Frequently Asked Questions

How do I convert grams to atoms?
Divide the mass in grams by molar mass in g/mol to get moles, then multiply by 6.02214076 × 1023 atoms per mole.

Can I convert grams directly to atoms?
Yes, if you know the sample’s molar mass. Combine the steps as atoms = grams ÷ molar mass × Avogadro’s constant.

Does the formula work for compounds?
It first gives molecules or formula units when you enter a compound’s molar mass. To get a particular element’s atoms, multiply by the number of those atoms in each molecule or formula unit.

Why is Avogadro’s constant used?
It defines the number of specified elementary entities in one mole. For this calculation, the specified entity is an atom.

Can the answer be a fraction of an atom?
The equation may produce a non-integer expected count because of rounding and measurement uncertainty. A physical sample contains a whole-number count of atoms; report the calculated value with appropriate precision.

Which molar mass should I use for an isotope?
Use the isotope-specific molar mass when the sample’s isotope identity is known. For ordinary natural material, the element’s standard atomic weight is generally the useful average.

Related

Formula used
in m | Sample mass | g | 12.011 | 0
in mm | Molar mass of element | g/mol | 12.011 | 0.001
out a | Number of atoms | atoms | m / mm * 6.02214076e23 | 0
out n | Amount of substance | mol | m / mm | 6

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

The whole Moles & Molar Mass section →