Molecular Weight Calculator
Calculate the molar mass of a compound from its atomic composition, then find moles from a weighed sample. Perfect for stoichiometry problems and lab preparation of solutions.
About this calculator
Molar mass is the sum of the atomic masses of all atoms in a molecule, expressed in grams per mole (g/mol). For a compound containing C, H, O, and N atoms, the molar mass M = (C × 12.011) + (H × 1.008) + (O × 15.999) + (N × 14.007), using IUPAC standard atomic weights. The number of moles n in a sample is then n = mass / M, which is exactly the formula used here: n = sampleMass / [(C × 12.011) + (H × 1.008) + (O × 15.999) + (N × 14.007)]. This relationship is the gateway to all stoichiometric conversions. Knowing moles allows you to calculate reagent quantities, limiting reagents, and theoretical yields in chemical reactions.
How to use
Calculate the moles in 90 g of glucose (C₆H₁₂O₆). Enter: Carbon = 6, Hydrogen = 12, Oxygen = 6, Nitrogen = 0, Sample Mass = 90 g. Molar mass = (6 × 12.011) + (12 × 1.008) + (6 × 15.999) + (0 × 14.007) = 72.066 + 12.096 + 95.994 + 0 = 180.156 g/mol. Moles = 90 / 180.156 = 0.4996 mol ≈ 0.5 mol. So 90 g of glucose contains approximately 0.5 moles — a classic result used in introductory chemistry courses.
Frequently asked questions
How do I calculate the molar mass of a compound with more than four elements?
This calculator handles C, H, O, and N — the four most common elements in organic and biochemical compounds. For compounds containing other elements such as sulfur, phosphorus, or metals, you would need to add their contributions (atomic mass × atom count) separately. The principle is identical: sum the products of each element's atomic mass and its count in the molecular formula. Many advanced calculators accept full chemical formulas and look up all atomic masses automatically.
What is the difference between molar mass and molecular weight?
Molar mass (g/mol) and molecular weight (dimensionless, expressed in unified atomic mass units, u) are numerically identical but conceptually different. Molar mass is a macroscopic property — the mass of one mole of a substance in grams. Molecular weight is the mass of a single molecule relative to 1/12 the mass of carbon-12. In practice, chemists use the terms interchangeably when working in g/mol. This calculator computes molar mass and uses it to find moles from a weighed sample.
Why do atomic masses use decimal values instead of whole numbers?
Atomic masses are weighted averages of all naturally occurring isotopes of an element. Carbon, for example, is 98.9% ¹²C (mass 12) and 1.1% ¹³C (mass 13), giving an average atomic mass of 12.011 u. These decimal values ensure that calculations using naturally occurring elements give accurate results for bulk samples. Using whole-number masses (like 12 for carbon) introduces small but cumulative errors in precise stoichiometric work and analytical chemistry.