Molecular Weight Calculator - Molar Mass From Formula

Find molar mass from a chemical formula with per-element breakdown and percent composition. Worked examples cover water, hydrates and coordination complexes.

01 calculator

M = Σ(atomic weight × count)

Result

    Show the working

      The Molecular Weight Calculator converts a chemical formula into molar mass in grams per mole. Enter a formula such as H2O, C6H12O6 or CuSO4.5H2O; the tool multiplies each element's standard atomic weight by its atom count, sums the contributions, and shows percent composition by mass. Nested brackets and hydrate dot notation are supported so lab formulas paste in the form they appear on labels.

      Calculate molar mass from a chemical formula

      Formula result = f(inputs), with variables: in is inputs, f is formula, out is resultresult = f(inputs)ininputsfformulaoutresult
      Calculate molar mass from a chemical formula.

      Molar mass is the mass of one mole of a substance, reported in grams per mole. Multiply each element's standard atomic weight by its atom count, then add every contribution. The tool parses subscripts, parentheses and hydrate dots, then returns the total with a per-element row so the arithmetic stays visible beside the sum.

      Enter the formula without spaces where possible. Use digits for subscripts (H2O, C6H12O6). Use a period or middle dot for hydrates (CuSO4.5H2O). Square brackets and nested groups work for coordination compounds. The result updates when the formula is valid; malformed tokens surface as parse errors rather than silent wrong totals.

      Standard atomic weights follow the IUPAC conventional values used in most teaching labs. Isotopic mixtures that differ from the conventional average need a custom atomic weight override, not the default table.

      Read the per-element breakdown

      Concept diagram: Inputs leads to per-element breakdown leads to ResultInputsper-element breakdownResult
      Read the per-element breakdown.

      Each row lists the element symbol, the atom count after expanding brackets, the atomic weight used, and that element's mass contribution. The sum of the contribution column equals the molar mass. Reading the table catches typos: an accidental double subscript shows up as an inflated count before any weighing begins.

      For water, the breakdown is two hydrogens and one oxygen. Hydrogen contributes about 2.016 g/mol; oxygen contributes about 15.999 g/mol; the total is about 18.015 g/mol. For a hydrate, water of crystallisation appears as its own block of H and O atoms multiplied by the hydrate coefficient, not as a separate "water" line unless the UI groups it that way.

      Contribution (g/mol) = atom count × atomic weight
      Molar mass (g/mol)   = sum of all contributions

      If a formula uses parentheses, expand them first. In Ca(OH)2 the OH group appears twice, so oxygen count is 2 and hydrogen count is 2, not 1 and 1.

      Calculate percent composition by mass

      Scale bar: 1 Input unit equals 2.92 Output unit1 Input unit2.92 Output unit
      Calculate percent composition by mass.

      Percent composition by mass for an element equals that element's contribution divided by the molar mass, multiplied by 100. The percentages for all elements in a correct formula sum to 100 percent within rounding. Labs use these figures to check purity claims and to compare experimental elemental analysis against a theoretical formula.

      % element = (contribution / molar mass) × 100

      For H2O at 18.015 g/mol: hydrogen is (2.016 / 18.015) × 100 ≈ 11.19%; oxygen is (15.999 / 18.015) × 100 ≈ 88.81%. Rounding to two decimal places is usual for student reports; keep more digits when comparing to instrument output.

      Percent composition does not replace empirical-formula work from combustion data. It answers the forward question: given the formula, what mass fraction should each element hold.

      Calculate the molar mass of glucose

      Concept diagram: Inputs leads to molar mass of glucose leads to ResultInputsmolar mass of glucoseResult
      Calculate the molar mass of glucose.

      Glucose (C6H12O6) is the usual textbook check that atom counts and atomic weights multiply cleanly. Carbon is about 12.011, hydrogen about 1.008 and oxygen about 15.999. Six carbons, twelve hydrogens and six oxygens should land near 180.156 g/mol when those conventional weights are used.

      1. Expand the formula. C: 6, H: 12, O: 6.

      2. Multiply each count by atomic weight. `` C: 6 × 12.011 = 72.066 H: 12 × 1.008 = 12.096 O: 6 × 15.999 = 95.994 ``

      3. Sum. `` 72.066 + 12.096 + 95.994 = 180.156 g/mol ``

      Molar mass of glucose ≈ 180.156 g/mol. Percent carbon ≈ 40.00%; hydrogen ≈ 6.71%; oxygen ≈ 53.28%. Small differences from printed tables usually come from which digit of the atomic weight the author rounded to.

      Water is the quick sanity check. H2O:

      H: 2 × 1.008 = 2.016
      O: 1 × 15.999 = 15.999
      Total ≈ 18.015 g/mol

      If a hand calculation lands far from 18.015 for water, the atomic weights or the arithmetic are wrong before any harder formula is attempted.

      Write formulas with brackets and hydrates

      Formula result = f(inputs), with variables: in is inputs, f is formula, out is resultresult = f(inputs)ininputsfformulaoutresult
      Write formulas with brackets and hydrates.

      Hydrates and coordination complexes need group expansion before any atomic weight is multiplied. A coefficient after a hydrate dot multiplies water of crystallisation. Brackets and parentheses multiply ligands or polyatomic ions. The same molar-mass engine handles both once atom counts are expanded correctly.

      Hydrates use a coefficient after a dot to multiply a water formula. Copper(II) sulfate pentahydrate is written CuSO4·5H2O or CuSO4.5H2O. The "5" multiplies H2O, adding 10 hydrogen atoms and 5 oxygen atoms to the anhydrous CuSO4 count.

      CuSO4·5H2O
      Cu: 1 × 63.546 = 63.546
      S:  1 × 32.06  = 32.06
      O:  (4 + 5) × 15.999 = 143.991
      H:  10 × 1.008 = 10.08
      Total ≈ 249.68 g/mol

      Coordination complexes nest ligands in brackets. Hexaamminecobalt(III) chloride is [Co(NH3)6]Cl3. The NH3 group appears six times inside the complex; three chloride ions sit outside.

      [Co(NH3)6]Cl3
      Co: 1 × 58.933 = 58.933
      N:  6 × 14.007 = 84.042
      H:  18 × 1.008 = 18.144
      Cl: 3 × 35.45  = 106.35
      Total ≈ 267.48 g/mol

      Nested parentheses multiply from the inside out. In Al2(SO4)3, the sulfate group appears three times: sulfur count 3, oxygen count 12. The calculator expands groups before summing so the typed formula can match the printed label.

      Distinguish molecular weight, molar mass and molecular mass

      Concept diagram: Inputs leads to Distinguish molecular weight, molar… leads to ResultInputsDistinguish molecularweight, molar…Result
      Distinguish molecular weight, molar mass and molecular mass.

      Textbook language mixes three related terms. Molecular weight (relative molecular mass) is historically a unitless ratio relative to 1/12 of carbon-12. Molar mass is the same number with units of grams per mole, which is what balances and solution prep use. Molecular mass often means the mass of one molecule in atomic mass units (u or Da).

      For ordinary stoichiometry, treat the calculator's grams-per-mole output as molar mass. Calling it "molecular weight" in speech is common in labs; the numeric value matches when conventional atomic weights are used. Polymers and non-molecular solids (ionic lattices) still have a formula mass even when "molecule" is a loose description.

      Relative molecular mass Mr is dimensionless. Molar mass M has units. Molecular mass of one molecule in u is numerically close to Mr for the same formula. Keep the unit that matches the next calculation: g/mol for moles from mass, u when discussing a single molecule on a mass spectrometer axis.

      Read the atomic weight table

      Concept diagram: Inputs leads to atomic weight table leads to ResultInputsatomic weight tableResult
      Read the atomic weight table.

      Standard atomic weights are weighted averages over terrestrial isotopic abundances, not the mass numbers of the most common isotopes. Chlorine is near 35.45, not 35 or 37. Carbon is near 12.011, not exactly 12. The Molecular Weight Calculator uses those conventional averages so results match lab manuals and supplier certificates.

      ElementSymbolApprox. atomic weight
      HydrogenH1.008
      CarbonC12.011
      NitrogenN14.007
      OxygenO15.999
      SulfurS32.06
      ChlorineCl35.45
      CobaltCo58.933
      CopperCu63.546

      Atomic weights for some elements have ranges when isotopic composition varies by source. Teaching tools usually pin one conventional value. If a certificate lists a different figure for a reagent lot, override that element rather than forcing the default table.

      Frequently asked questions

      How do you calculate molecular weight from a formula?

      Multiply each element's atomic weight by its atom count after expanding brackets and hydrates, then sum the contributions. The total in g/mol is the molar mass used for stoichiometry. Water near 18.015 g/mol is the fastest check that hydrogen was not entered as atomic mass number 1.000 by mistake.

      Why is water about 18.015 g/mol instead of 18?

      Hydrogen's conventional atomic weight is about 1.008, not 1.000. Two hydrogens contribute about 2.016; oxygen about 15.999; the sum is about 18.015 g/mol. Rounded "18" appears in quick mental math; lab weighing should use the fuller figure when the balance supports it.

      How does the calculator handle CuSO4.5H2O?

      The digit after the dot multiplies H2O. For pentahydrate that adds 10 H and 5 O to the anhydrous CuSO4 atom counts. The fixture total is about 249.68 g/mol when conventional atomic weights for Cu, S, O and H are applied.

      What about [Co(NH3)6]Cl3?

      Expand NH3 six times, then add three Cl outside the brackets. Cobalt, nitrogen, hydrogen and chlorine contributions sum to about 267.48 g/mol. Bracket nesting is the usual source of undercounted nitrogen when the formula is expanded by hand.

      Is molar mass the same as molecular weight?

      In lab practice the numbers match when both use the same atomic weights. Strictly, molar mass carries g/mol units; relative molecular mass is unitless. Report g/mol for weighing and solution prep so the next calculation has an explicit unit.

      Can ionic compounds have a molecular weight?

      Ionic solids have a formula mass based on the empirical formula unit. The arithmetic is identical to molecular cases; the language shifts from "molecule" to "formula unit." NaCl and CaCO3 are routine examples.

      Why do published tables disagree slightly?

      Authors round atomic weights to different digits, and IUPAC updates conventional values over time. Differences of a few hundredths of a gram per mole are normal; large gaps usually mean a wrong formula or a missed hydrate coefficient.

      Does the tool support isotopes like D2O?

      Only if deuterium is entered as an element the parser recognises with its own atomic weight. Default H is protium-average hydrogen, not deuterium. Heavy-water work needs an explicit D (or 2H) entry and should not reuse the H2O fixture total.

      How is percent composition used?

      Percent composition predicts mass fractions from a known formula and checks elemental analysis against theory. It does not by itself prove a molecular formula when several candidates share similar percentages; combustion data and other evidence still decide between isomers and multiples.

      Summary

      The Molecular Weight Calculator turns a chemical formula into molar mass with a transparent per-element table and percent composition. Water near 18.015 g/mol, CuSO4·5H2O near 249.68 g/mol and [Co(NH3)6]Cl3 near 267.48 g/mol are the checks that confirm parsing of simple molecules, hydrates and brackets.

      Use the grams-per-mole total for stoichiometry; treat naming debates between molecular weight and molar mass as secondary to getting the atom counts right.