CalcWorldHub
Chemistry · CalcWorldHub

Molar Mass from a Formula: Add Atomic Contributions

For a formula with two element types, add each atomic-mass contribution: M = m₁n₁ + m₂n₂. The calculator takes two atomic masses in g/mol and their whole-number atom counts. It sums those inputs; it does not parse a written formula.

Open calculator
A molecule model balanced against a laboratory weighing scale

Share this article

Molar-mass calculation identifies each element, counts its atoms in the formula, multiplies each count by an atomic mass, and sums the contributions.
Expand subscripts before adding the element contributions.

Count atoms before multiplying

Expand subscripts and parentheses to get each element’s atom count before entering the two contributions. A subscript applies to the symbol before it; a parenthesized group multiplies every count inside.

Both atomic masses must be positive and both atom counts must be nonnegative whole numbers; at least one atom is required. A formula with more than two distinct elements cannot be represented by this calculator in one calculation.

Worked examples

Example 1 · water, H₂O

Inputs: Hydrogen 1.008 g/mol × 2 atoms; oxygen 15.999 g/mol × 1 atom.

Calculation: M = 1.008 × 2 + 15.999 × 1 = 18.015 g/mol.

Using these rounded standard atomic-weight values, the estimated molar mass is 18.015 g/mol.

Example 2 · hydrogen peroxide, H₂O₂

Inputs: Hydrogen 1.008 g/mol × 2 atoms; oxygen 15.999 g/mol × 2 atoms.

Calculation: M = 1.008 × 2 + 15.999 × 2 = 34.014 g/mol.

The formula has four atoms but only two element types, which fit the calculator’s inputs.

Two hydrogen atoms at one point zero zero eight grams per mole each plus one oxygen atom at fifteen point nine nine nine gives water molar mass eighteen point zero one five grams per mole.
The calculator accepts two element types and integer counts.

Choose atomic weights for the needed precision

The listed atomic weights for natural materials are recommended values; isotopic composition can create intervals for some elements. Common rounded classroom values such as 1.008 for hydrogen and 15.999 for oxygen support a useful estimate, not a universal exact mass for every sample.

Use atomic-weight data appropriate to the sample and required precision. Keep units as g/mol and enter atomic masses, not a molecular mass in place of one element’s value.

Distinguish relative mass from molar mass

A sum of relative atomic masses gives a dimensionless relative molecular or formula mass. The corresponding molar mass is expressed per mole, commonly in g/mol. Their numerical values are effectively the same at the precision used in many classroom examples, but their units and meanings differ.

Hydrogen peroxide, H₂O₂, still uses two element entries even though each count is two. The counts must represent one molecule or formula unit, not the number of molecules in a sample.

Use the result with a verified formula

Molar mass converts a pure substance’s mass to amount: n = mass ÷ molar mass. The conversion depends on the correct chemical identity and formula. Mixtures, impurities, different hydration states, and nonstoichiometric materials may not be described by one simple formula.

This tool does not identify a compound, validate structure or charge, or adjust for isotopic composition and purity. Confirm the formula and atomic-weight source before using the result in stoichiometry or preparation.

Audit the formula before using the sum

Write the formula as element symbols and counts before entering values. Parentheses multiply every atom count in the group, and a subscript applies only to the symbol or grouped expression it follows. If an element appears more than once, combine its counts so the two entries represent the full formula unit.

The calculator supports only two distinct element types. A third element, a hydrate dot, a variable-composition material, or a mixture requires a broader method. Do not omit an element merely to fit the interface; split terms only when the resulting contribution is still explicitly tracked and correctly summed outside the tool.

Choose atomic-weight values appropriate to the substance and precision. Standard atomic weights for natural materials can be intervals because isotopic composition varies. A rounded classroom value may be suitable for a worked estimate, while a laboratory calculation may require a source and precision matched to the sample.

Keep formula mass and molar mass conceptually distinct. Relative formula mass is a dimensionless sum of relative atomic masses; molar mass expresses mass per mole, commonly in g/mol. Their numerical values align at ordinary atomic-weight precision, but the units matter when converting a weighed sample to amount.

Before using n = mass ÷ molar mass, confirm that the entered formula matches the material form, including any waters of crystallization or specified isotopic composition. The calculator sums the entries exactly as provided and does not validate chemical structure, charge, purity, or reaction stoichiometry.

Sources and further reading

Share this article

Browse all articles · Calculator: Molecular formula molar mass calculator