molecalculator

Moles & Molar Mass

Grams to Moles to Atoms: Formula and Example

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

Amount of substance 0.6661 mol
Number of particles
4.011 × 1023 particles
Result, rounded to 4 decimal places
Sample mass
12 g
Set in the form below
Molar mass
18.015 g/mol
Set in the form below
You enter
Sample mass (g), Molar mass (g/mol)
You get
Amount of substance (mol), Number of particles (particles)
Rounding
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.

To convert grams to atoms, divide the mass by the substance’s molar mass in grams per mole, then multiply the moles by Avogadro’s constant, 6.02214076 × 1023 particles per mole. Enter a sample’s mass and molar mass to calculate its amount in moles and its number of particles; for a molecular substance, those particles are molecules, while for an element they may be atoms.

Formula

The conversion is moles = mass ÷ molar mass, or n = m / M. Then calculate number of particles = moles × Avogadro’s constant, or N = n × NA. Combined, the formula is N = (m / M) × 6.02214076 × 1023.

  • m is the sample mass in grams (g).
  • M is the substance’s molar mass in grams per mole (g/mol).
  • n is the amount of substance in moles (mol).
  • N is the particle count; specify whether the particles are atoms, molecules, ions, or formula units.
  • NA is Avogadro’s constant, exactly 6.02214076 × 1023 mol−1.

Use a molar mass that matches the chemical formula and the kind of particle you want to count. The calculator treats the entered molar mass as an input; for compounds, obtain it by adding the atomic masses of all atoms in the formula. For example, H2O has a molar mass of about 18.015 g/mol using H = 1.008 and O = 15.999 g/mol.

Worked Example

For the default sample of 12.00 g and molar mass of 18.015 g/mol:

  1. Find the amount in moles: n = 12.00 g ÷ 18.015 g/mol = 0.6661 mol (rounded to four decimal places).
  2. Convert moles to particles: N = 0.6661 mol × 6.02214076 × 1023 particles/mol ≈ 4.011 × 1023 particles.

Using the unrounded mole value gives 12.00 ÷ 18.015 × 6.02214076 × 1023 = 4.011 × 1023 particles when rounded to four significant figures. With this default molar mass, the sample represents water molecules, so the result is about 4.011 × 1023 molecules—not individual atoms. Each water molecule contains three atoms, giving about 1.203 × 1024 atoms in total.

Assumptions

  • The mass is in grams and the molar mass is in grams per mole.
  • The input molar mass correctly describes the substance and the particles being counted.
  • The sample is treated as pure, with no correction for impurities, moisture, or measurement uncertainty.
  • The particle count is a theoretical amount calculated from the entered values; it is not a direct count of individually observed particles.

What the Formula Counts

A mole is a counting unit, much like a dozen, but vastly larger: one mole contains exactly 6.02214076 × 1023 specified entities. The entity must be clear. For a pure element such as copper, a mole usually means a mole of copper atoms. For water, a mole means a mole of H2O molecules. For an ionic compound such as sodium chloride, chemists commonly count formula units, not separate NaCl molecules in a crystal.

To convert a molecular count into a count of atoms, multiply by the number of atoms in each molecule. For example, each carbon dioxide molecule, CO2, contains three atoms. The atom count is therefore three times the number of CO2 molecules. For a compound with several elements, you can also calculate the count of a particular atom by multiplying the molecule count by that element’s subscript. In CO2, the number of oxygen atoms is twice the number of molecules.

How to Find Molar Mass

Read the chemical formula and add the atomic mass for every atom it contains. Subscripts multiply the atomic mass; parentheses apply a multiplier to everything inside them. Use one consistent set of atomic weights. Common abridged values include H = 1.008, C = 12.011, N = 14.007, O = 15.999, Na = 22.990, Cl = 35.45, and S = 32.06 g/mol.

  • Water, H2O: 2(1.008) + 15.999 = 18.015 g/mol.
  • Carbon dioxide, CO2: 12.011 + 2(15.999) = 44.009 g/mol.
  • Sodium chloride, NaCl: 22.990 + 35.45 = 58.44 g/mol.

These are conventional molar masses based on standard atomic weights; the exact composition of a natural sample can vary slightly with isotope abundances. For routine calculations, use the molar mass specified by your course, reference, or lab method, especially when its chosen atomic-weight convention matters.

Using the Result and Avoiding Errors

The calculator’s first result is moles, which helps show how much chemical substance is present. The second is the number of particles of the kind represented by the molar mass. Particle counts are usually enormous, so scientific notation is more readable than writing every digit. Keep extra digits in intermediate calculations and round the final answer to a precision justified by the measured mass and molar mass.

  • Mixing units: grams must be divided by g/mol. A mass in milligrams must first be converted: 1,000 mg = 1 g.
  • Using the wrong molar mass: distinguish a molecule from an atom, ion, or formula unit, and include every subscript in the formula.
  • Confusing particles and atoms: a molecular count is not automatically an atom count. Multiply by atoms per molecule when that is what the question asks for.
  • Premature rounding: rounding the mole value too early can shift the final particle count. Carry calculator digits through both steps.
  • Assuming a sample is pure: if the mass includes impurities or water, the actual amount of the target substance is lower than this simple calculation predicts.

This conversion is a bookkeeping relationship, not a measurement of purity or reaction yield. If a chemical reaction is involved, use the balanced equation and its mole ratios to find how many moles of a reactant or product are related. The grams-to-moles-to-particles calculation alone does not account for a reaction’s limiting reagent or incomplete conversion.

Frequently Asked Questions

What is the formula to convert grams to atoms?
Divide grams by molar mass in g/mol, then multiply by 6.02214076 × 1023 particles/mol. If the substance consists of molecules, multiply the molecule count by atoms per molecule when you need total atoms.

How many atoms are in one mole?
One mole contains exactly 6.02214076 × 1023 specified entities. It contains that many atoms only when the entities are atoms; a mole of molecules contains that many molecules.

How do I convert grams to moles only?
Use moles = grams ÷ molar mass. For instance, 12.00 g of water divided by 18.015 g/mol is about 0.6661 mol.

Do I multiply or divide by Avogadro’s number?
Multiply moles by Avogadro’s constant to get particles. Divide a particle count by Avogadro’s constant to return to moles.

How do I get the number of atoms in a compound?
First calculate the number of molecules or formula units. Then multiply by the number of atoms of interest in each entity, or by the total number of atoms in its formula for a total atom count.

Can I use milligrams instead of grams?
Yes, but convert first: divide milligrams by 1,000 to get grams, then use the standard formula. Alternatively, use a molar mass expressed in mg/mol, keeping mass and molar-mass units consistent.

Related

Formula used
in m | Sample mass | g | 12.00 | 0
in mm | Molar mass | g/mol | 18.015 | 0
out n | Amount of substance | mol | m / mm | 4
out a | Number of particles | 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

The whole Moles & Molar Mass section →