b2KIT

Molecular Weight Calculator

Enter a chemical formula and calculate molecular weight, elemental composition percentages, and molar mass with visual pie chart.

Tested tool guide Tested browser tools Checked August 16, 2026

What Molecular Weight Calculator does, with a checked example

A chemical formula is the starting point: the calculator counts each element, totals its atomic-weight contribution, reports the corresponding molecular weight and molar mass, and divides the total into elemental mass percentages shown in a pie chart. It answers what one formula weighs, not what substance produced an experimental mass. The common trap is capitalization: CO denotes carbon and oxygen, while Co is the symbol for cobalt, so chemically correct letter case is essential.

Worked example

A concrete input and expected output from the current implementation.

Input

H2O

Expected output

Molecular weight: approximately 18.015; molar mass: approximately 18.015 g/mol; elemental composition: H 11.19% and O 88.81%; pie chart: the same two shares.

Using H = 1.008 and O = 15.999, two hydrogen atoms contribute 2.016 and one oxygen atom contributes 15.999, totaling 18.015. Their percentage contributions are 11.19% and 88.81%, which sum to 100.00% after rounding.

How the result is produced

1

Formula counting

The formula is read as element symbols plus counts. A whole-number subscript applies to the preceding element or grouped atoms, and an omitted subscript means one. Each atom count is multiplied by that element's atomic weight, then all contributions are added. This calculation depends only on formula composition; it does not infer bonding, molecular shape, concentration, or sample purity.

2

Composition calculation

After the total is known, each element's combined contribution is divided by that total and multiplied by 100. Those percentages supply the labeled composition values and pie-chart shares. Because displayed percentages are rounded independently, their printed sum can occasionally differ slightly from 100%, even when the unrounded contributions account for the full formula.

Good uses

  • Find the molar mass needed to convert between moles and grams when preparing a quantity of a reagent whose complete chemical formula is known.
  • Compare calculated elemental mass percentages with an elemental-analysis result when checking whether a proposed empirical or molecular formula is plausible.
  • Check how adding or removing atoms changes formula mass and composition, such as comparing an anhydrous compound with a separately specified hydrated form.

Limits and checks

  • Treat the result as a formula-based average, not an isotope-specific exact mass. Natural isotopic composition can vary, while monoisotopic mass uses one selected isotope of each element.
  • A formula cannot distinguish structural isomers. Ethanol and dimethyl ether both have the formula C2H6O, so this calculator gives them identical masses and elemental percentages.
  • The total covers only the atoms represented in the entered formula. Omitted water of crystallization, counterions, or solvent molecules will not be included in the reported mass.

Common questions

Are molecular weight and molar mass the same?

They are closely related but are not the same physical quantity. Relative molecular mass, often called molecular weight, is a dimensionless ratio. Molar mass is mass divided by amount of substance, normally expressed in g/mol. Their numerical values are conventionally treated as the same for routine formula calculations, so both can be reported from one formula total.

Can this calculator identify an unknown compound from percentages?

No. It calculates forward from a formula supplied by the user. Elemental percentages can help compare candidate formulas, but they do not uniquely determine molecular formula or structure. Different formulas can produce similar rounded percentages, and structural isomers have exactly the same composition, so experimental identification requires additional chemical evidence.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools