molecalculator

Moles & Molar Mass

Number of Atoms Calculator: Formula and Examples

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

Number of atoms 6.017 × 1023 atoms
Amount of substance
0.999084 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 · 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.

Calculate the number of atoms from a sample’s mass and the element’s molar mass: convert mass to moles, then multiply by Avogadro’s constant. Enter the sample mass in grams and molar mass in grams per mole to get the atom count, with the intermediate amount in moles shown as well.

Formula

The number of atoms is the sample’s amount in moles multiplied by Avogadro’s constant. First calculate moles as mass divided by molar mass:

n = m / M
N = n × NA = (m / M) × NA

  • N is the number of atoms, reported as a count of atoms.
  • n is the amount of substance, in moles (mol).
  • 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 is the atom count. The second is the intermediate amount in moles. Because the count is commonly enormous, the page may display it in scientific notation; the number is a count, not a mass or a number of moles.

Worked Example

For the default inputs, the sample mass is 12 g and the molar mass is 12.011 g/mol, the standard atomic weight used here for carbon.

  1. Calculate the amount: n = m / M = 12 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.

The calculator reports the atom count to zero decimal places, so the displayed answer is 601,660,000,000,000,000,000,000 atoms (approximately 6.0166 × 1023). The intermediate result is approximately 0.999083 mol, displayed to six decimal places as 0.999083 mol.

Assumptions

  • The sample is the specified element and its mass is entered in grams.
  • The molar mass is appropriate for the element’s composition; the default, 12.011 g/mol, is the IUPAC abridged standard atomic weight for carbon.
  • The result counts atoms in the sample. It does not account for impurities, mixtures, or a chemical formula containing multiple atoms per molecule.

How the Calculation Works

A mole is a unit for counting specified entities. One mole contains exactly 6.02214076 × 1023 entities. To count atoms in a pure elemental sample, first determine how many moles its mass represents. Molar mass links those quantities: for carbon, one mole has a mass of about 12.011 g. Multiplying the moles by Avogadro’s constant converts the amount into atoms.

The units show why the calculation works: grams divided by grams per mole gives moles, and moles multiplied by atoms per mole gives atoms. The mole units cancel in the second step. Keep the mass and molar mass in compatible units; if mass is in milligrams, convert it to grams by dividing by 1,000 before using this calculator.

Choosing the Right Molar Mass

The molar mass depends on which atoms or chemical formula the sample contains. For a pure element, use its atomic weight in g/mol. For a compound, add the atomic weights of every atom in its formula to find the mass of one mole of molecules or formula units. That gives a count of those entities—not automatically a count of individual atoms.

For example, one molecule of water, H2O, contains three atoms: two hydrogen atoms and one oxygen atom. If a sample’s molar mass calculation gives the number of water molecules, multiply that molecular count by three to get its total number of atoms. To count only hydrogen atoms in that water, multiply by two; to count oxygen atoms, multiply by one. For a compound with a specified element appearing several times in each formula unit, multiply the formula-unit count by that element’s subscript.

For an element with naturally occurring isotopes, the standard atomic weight is generally an abundance-weighted value. A sample deliberately enriched in a particular isotope has a different molar mass, so use the isotope’s molar mass when that distinction matters. A chemical formula and the intended entity—atoms, molecules, ions, or formula units—must be clear before interpreting the result.

Common Errors and Limits

  • Mixing units: Entering milligrams as if they were grams makes the calculated count 1,000 times too large. Convert first, and express molar mass in g/mol.
  • Using the wrong molar mass: A compound’s molar mass is not the atomic weight of one element in it. Sum all formula atoms, then account for how many atoms of interest each entity contains.
  • Confusing moles with atoms: A mole is a quantity of entities; it is not itself a number of atoms. Apply Avogadro’s constant to convert between them.
  • Rounding too early: Keep extra digits through the division and multiplication, then round the final count to a precision justified by the measured mass and molar mass.

This formula assumes a known sample mass and composition. It cannot determine purity, identify a substance, or distinguish molecules from atoms without formula information. If the sample is a mixture, the total mass alone is not enough: each component’s amount and composition are needed. For a real laboratory sample, follow your lab method, the safety data sheet (SDS) and your supervisor.

Frequently Asked Questions

What is the formula for calculating the number of atoms?
Use N = (m / M) × 6.02214076 × 1023, where m is mass in grams and M is molar mass in grams per mole. This gives atoms for a pure elemental sample.

How do I calculate atoms from moles?
Multiply the number of moles by 6.02214076 × 1023 atoms per mole. For example, 2 mol of carbon contains approximately 1.2044 × 1024 carbon atoms.

How do I calculate atoms in a compound?
First calculate the number of molecules or formula units from mass and the compound’s molar mass. Then multiply by the number of atoms per entity, or by the relevant element’s subscript if counting just that element.

Can I calculate the number of atoms from volume?
Not from volume alone. You also need information such as density and composition to obtain mass, or a known concentration and volume to obtain moles. For gases, pressure, temperature, and a gas-law model may also be needed.

Why is Avogadro’s constant used?
It defines the number of specified entities in one mole. Multiplying moles by this constant converts a chemical amount into a count of atoms or other entities, provided the entity is identified correctly.

Related

Formula used
in m | Sample mass | g | 12 | 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 | 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 →