Atom Count Calculator Formula

Understand the math behind the atom count calculator. Each variable explained with a worked example.

Formulas Used

Number of Atoms

num_atoms = (mass_grams / atomic_mass) * 6.022e23

Moles

moles = mass_grams / atomic_mass

Variables

VariableDescriptionDefault
mass_gramsMass of Element(g)12
atomic_massAtomic Mass(g/mol)12.011

How It Works

How to Count Atoms

Formula

N = (mass / atomic mass) × 6.022 × 10^23

Convert grams to moles, then moles to atoms using Avogadro's number.

Worked Example

How many atoms in 12 g of carbon-12?

mass_grams = 12atomic_mass = 12.011
  1. 01Moles = 12 / 12.011 = 0.999 mol
  2. 02Atoms = 0.999 × 6.022 × 10^23
  3. 03Atoms ~ 6.02 × 10^23

Ready to run the numbers?

Open Atom Count Calculator