molecalculator

Moles & Molar Mass

How to Calculate the Number of Atoms

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

Number of atoms 6.017 × 1023 atoms
Amount of substance
0.9991 mol
= Sample mass ÷ Molar mass
Sample mass
12 g
Set in the form below
Molar mass
12.011 g/mol
Set in the form below
You enter
Sample mass (g), Molar mass (g/mol)
You get
Number of atoms (atoms), Amount of substance (mol)
Rounding
0 dp · 4 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.

Calculate the number of atoms in a sample from its mass, or convert a known amount in moles directly into atoms. Enter the sample mass and the substance’s molar mass to get an atom count; for a compound, the result counts atoms of all elements unless you specify which element you mean.

Formula

For a pure sample, first calculate moles by dividing its mass by its molar mass. Then multiply the amount in moles by Avogadro’s constant:

N = (m / M) × NA

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

The calculator’s first result treats each counted particle as one atom. That is appropriate for a sample of a monatomic element, such as copper. For a molecular element or compound, the calculation initially gives the number of molecules or formula units; multiply by the number of atoms of the element you want in each particle to get that element’s atom count. The total number of atoms in each particle requires multiplying by the sum of its subscripts.

Worked Example

The calculator defaults use 12.00 g of carbon and a molar mass of 12.011 g/mol.

  1. Find the amount in moles: n = m / M = 12.00 g / 12.011 g/mol ≈ 0.99908 mol.
  2. Multiply by Avogadro’s constant: N = 0.99908 mol × 6.02214076 × 1023 mol−1 ≈ 6.0166 × 1023 atoms.
  3. Rounded to the calculator’s zero decimal places, the headline result is 601,660,000,000,000,000,000,000 atoms (about 6.0166 × 1023). The second result is 0.9991 mol.

Assumptions

  • The sample is pure and its mass and molar mass refer to the same substance.
  • The substance’s stated molar mass is appropriate for its chemical formula and isotopic composition.
  • The headline result counts one atom per particle. For molecules and formula units, adjust for the number of atoms in each particle as explained below.

What You’ll Need

  • The sample’s mass, measured or provided in grams. Convert other mass units before entering the value: 1 kg = 1,000 g and 1 mg = 0.001 g.
  • The substance’s molar mass in g/mol. Look it up or calculate it from the chemical formula and the standard atomic weights of its elements.
  • A calculator, or the calculator fields above. For a compound, you also need its chemical formula to determine how many atoms of a particular element occur in each molecule or formula unit.

Step-by-Step

  1. Identify what you want to count. Decide whether you need atoms in a monatomic element, molecules in a molecular sample, formula units in an ionic substance, or atoms of one element within a compound. These are different counts. The formula starts by counting moles of the substance’s particles.
  2. Record the sample mass. Use the mass of the sample itself, not the container. Convert the value to grams before entering it. For example, 0.025 kg is 25 g, while 80 mg is 0.080 g.
  3. Find the correct molar mass. For an element, use its molar mass in g/mol. For a compound, add the standard atomic masses for every atom in its formula. For water, H2O, M = 2(1.008) + 15.999 = 18.015 g/mol. Keep enough digits for the calculation, then round the final answer to a precision justified by the measurements.
  4. Enter the mass and molar mass. Check that the units are grams and grams per mole. The calculator finds moles as mass divided by molar mass, then multiplies by 6.02214076 × 1023 particles per mole.
  5. Interpret the first result carefully. For a monatomic element such as carbon in this example, particles are atoms, so the result is the number of atoms. For water, the same calculation gives water molecules, not total atoms. Each H2O molecule contains three atoms, so multiply the molecule count by 3 for total atoms. To count hydrogen atoms, multiply by 2; to count oxygen atoms, multiply by 1.
  6. Check the scale and rounding. A mole represents a very large number of particles, so ordinary lab-sized masses commonly produce counts around 1020 to 1024. Keep unrounded values during intermediate steps. Report scientific notation when it makes the result easier to read, and do not imply more measurement precision than the mass supports.

For an ionic compound, use its empirical formula to count atoms per formula unit. For example, each NaCl formula unit has one sodium atom and one chlorine atom, so its total atom count is twice the number of formula units. The compound’s molar mass must include both elements.

Common Mistakes

  • Mixing up atoms and molecules: A mass-to-moles calculation for a molecular substance counts molecules first. Apply the formula subscripts only if you need atoms.
  • Using the wrong molar mass: Check every subscript and parenthesis. In Ca(OH)2, the group in parentheses occurs twice.
  • Entering inconsistent units: Entering milligrams as though they were grams makes the calculated count 1,000 times too high. Convert mass before calculating.
  • Rounding too early: Truncating the molar mass or intermediate moles can shift the final digits. Carry extra digits and round only the reported answer.
  • Assuming a pure sample: If the mass includes impurities, moisture, or a mixture, the simple result overestimates the amount of the target substance unless its purity or fraction is accounted for.

Tips

  • Write the chemical formula next to the calculation and mark the atom count you need. This prevents confusing total atoms with atoms of one element.
  • Use molar masses calculated from consistent atomic weights. Small differences between reference tables can occur because atomic weights may be reported with different rounding.
  • Use dimensional analysis: g ÷ (g/mol) gives mol, and mol × (particles/mol) gives particles. Units should cancel as shown.
  • For a mixture, calculate each substance separately if its mass and composition are known, then add the relevant atom counts.
  • When the input is already an amount in moles, skip the mass conversion and use N = n × NA, where n is the amount in mol.

Troubleshooting

  • The answer is implausibly large or small: Check whether mass was entered in g rather than mg or kg, and confirm that molar mass is in g/mol rather than kg/mol.
  • The answer is a molecule count when you expected atoms: Multiply by the number of atoms per molecule, or by the relevant element’s subscript for an element-specific count. Do not multiply twice if the substance is already monatomic.
  • The calculator rejects an entry: Enter a nonnegative sample mass and a positive molar mass. Check for a misplaced decimal point or a unit typed into a numeric field.
  • Your result differs slightly from a textbook: Compare the molar mass, atomic-weight rounding, and significant figures used. Use the same conventions before comparing final digits.
  • The sample is not pure or its composition is uncertain: The calculation cannot determine the target substance’s actual mass from total mass alone. Obtain the composition or purity fraction, then calculate using the target portion.

Frequently Asked Questions

How do I calculate atoms from moles?
Multiply moles by 6.02214076 × 1023 particles per mole. For molecules or formula units, multiply that particle count by the number of atoms you want per particle.

How do I calculate atoms from grams?
Divide the mass in grams by molar mass in g/mol to get moles, then multiply by Avogadro’s constant. For compounds, check whether you need molecules, formula units, or individual atoms.

How many atoms are in one mole?
One mole contains exactly 6.02214076 × 1023 specified entities. If the entities are molecules, the number of atoms depends on the atoms in each molecule.

How do I count one element in a compound?
Calculate the number of molecules or formula units, then multiply by that element’s subscript. If the element appears more than once in the formula, account for every occurrence.

Can I calculate atoms without knowing the molar mass?
Not from mass alone. You need the substance’s identity and formula, or another way to determine its molar mass; if moles are already known, use Avogadro’s constant directly.

Related

Formula used
in m | Sample mass | g | 12.00 | 0
in mm | Molar mass | g/mol | 12.011 | 0.001
out n | Number of atoms | atoms | (m / mm) * 6.02214076e23 | 0
out mol | Amount of substance | mol | m / mm | 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

The whole Moles & Molar Mass section →