Molecule / Compound Builder
Enter a chemical formula to calculate molar mass and elemental composition.
What is molecular weight?
Molecular weight (or molar mass) is the sum of the atomic weights of all atoms in a molecule, expressed in grams per mole (g/mol). One mole of any substance contains Avogadro's number (6.022 x 10^23) of molecules. Knowing the molar mass lets you convert between mass (grams) and amount (moles), which is essential for stoichiometric calculations in chemistry.
For example, water (H2O) has a molar mass of approximately 18.015 g/mol: two hydrogen atoms (1.008 g/mol each) plus one oxygen atom (15.999 g/mol). This means 18.015 grams of water contains exactly one mole (6.022 x 10^23) of water molecules.
How to calculate molar mass
Write the molecular formula, count the atoms of each element, look up each element's atomic weight from the periodic table, multiply each atomic weight by its count, and sum the results. For glucose (C6H12O6): 6 carbon (6 x 12.011) + 12 hydrogen (12 x 1.008) + 6 oxygen (6 x 15.999) = 180.156 g/mol.
How to use this tool
Enter a chemical formula (like NaCl, H2SO4, or C6H12O6) and the tool instantly calculates the molar mass. It shows the contribution of each element, the percentage composition, and the total mass. The tool handles parenthetical groups, hydrates, and complex formulas.
Percent composition
Percent composition tells you what fraction of a compound's mass comes from each element. For water: hydrogen contributes 2.016/18.015 = 11.19% and oxygen contributes 15.999/18.015 = 88.81%. This information is useful for determining empirical formulas from experimental data and for nutritional calculations.
Frequently asked questions
What is the difference between molecular weight and formula weight?
Molecular weight applies to discrete molecules (like H2O, glucose). Formula weight applies to ionic compounds (like NaCl) that do not exist as individual molecules but as crystal lattices. The calculation is identical โ sum the atomic weights according to the formula โ but the terminology differs based on the type of compound.
Why do atomic weights have decimal values?
Atomic weights are weighted averages of all naturally occurring isotopes of an element. Carbon's atomic weight is 12.011 (not exactly 12) because natural carbon is 98.9% carbon-12 and 1.1% carbon-13. The decimal reflects this isotopic mixture. Only carbon-12 has an atomic weight that is exactly a whole number, by definition.