Skip to content

Molecular Weight Calculator — Free Online Molar Mass Tool

Calculate the molecular weight of any chemical compound by entering its formula. Get a detailed element breakdown with percent composition and instant mass-to-moles conversions.

Supports parentheses: Ca(OH)2, Mg3(PO4)2

Moles from mass: 0.9992 mol

Mass from moles: 18.0150 g

Molecular Weight

18.0150g/mol
H2O

Element Breakdown

ElementCountMassTotal%
O115.99915.99988.8%
H21.0082.01611.2%

18.00 g =

0.9992 mol

1.00 mol =

18.0150 g

How to Use the Molecular Weight Calculator

  1. Select a common compound or enter a formula: Use the preset dropdown to quickly load common compounds like water (H2O), glucose (C6H12O6), or sodium chloride (NaCl). Alternatively, type any chemical formula directly into the input field. Capitalize the first letter of each element symbol and use standard subscript notation (H2O, not h2o).
  2. Review the molecular weight: The results panel instantly displays the total molecular weight in grams per mole. This is the mass of one mole of the compound — multiply by Avogadro's number to get the mass of a single molecule in grams.
  3. Examine the element breakdown: The table below the molecular weight shows each element's symbol, atom count in the formula, individual atomic mass, total mass contribution, and percentage of the total molecular weight. This percentage composition is essential for analytical chemistry work.
  4. Convert between mass and moles: Enter a mass in grams in the "Mass" field to see the equivalent number of moles, or enter moles in the "Moles" field to see the equivalent mass in grams. Both conversions use the calculated molecular weight automatically.

The formula parser supports parentheses for polyatomic groups. For example, enter Ca(OH)2 for calcium hydroxide or Al2(SO4)3 for aluminum sulfate. Nested parentheses like Ca3(PO4)2 are also supported.

Molecular Weight Formulas

Molecular Weight

MW = Σ (atomic weight x count) for each element

Percent Composition

%Element = (element total mass / MW) x 100

Mass to Moles

moles = mass (g) / MW (g/mol)

Moles to Mass

mass (g) = moles x MW (g/mol)

Number of Molecules

N = moles x 6.022 x 10^23

Variables Explained

  • MW (Molecular Weight): The total mass of one mole of a compound in grams per mole (g/mol). Numerically equal to the molecular mass in atomic mass units (amu).
  • Atomic Weight: The standard atomic weight of each element as defined by IUPAC. These are weighted averages across all naturally occurring isotopes of each element.
  • Count: The number of atoms of each element present in one formula unit of the compound, derived by parsing the chemical formula including any subscripts and parenthetical groups.
  • %Element: The mass fraction of each element expressed as a percentage. All element percentages in a compound sum to 100%.

Step-by-Step Example

Calculate the molecular weight of glucose (C6H12O6):

  1. Identify elements and counts: C = 6, H = 12, O = 6
  2. Look up atomic weights: C = 12.011, H = 1.008, O = 15.999
  3. Calculate each contribution: C: 6 x 12.011 = 72.066, H: 12 x 1.008 = 12.096, O: 6 x 15.999 = 95.994
  4. Sum all contributions: 72.066 + 12.096 + 95.994 = 180.156 g/mol
  5. Percent composition: C = 40.00%, H = 6.71%, O = 53.29%

One mole of glucose weighs 180.156 grams and contains 6.022 x 10^23 glucose molecules. To prepare a 1 M glucose solution, dissolve 180.156 grams in water and bring to a total volume of 1 liter. This is a common concentration used in cell biology experiments.

Practical Examples

Example 1: Rachel's Pharmaceutical Dosage Calculation

Rachel is a pharmacy student calculating the amount of aspirin (acetylsalicylic acid, C9H8O4) in a standard 325 mg tablet expressed in millimoles for a pharmacokinetics assignment:

  • Formula: C9H8O4
  • MW: C (9 x 12.011 = 108.099) + H (8 x 1.008 = 8.064) + O (4 x 15.999 = 63.996) = 180.159 g/mol
  • Moles in 325 mg: 0.325 / 180.159 = 0.001804 mol = 1.804 mmol

Each aspirin tablet contains approximately 1.8 millimoles of acetylsalicylic acid. This is useful for comparing the molar equivalent doses of different pain medications when evaluating therapeutic efficacy and pharmacokinetic profiles.

Example 2: Tom's Stoichiometry Problem

Tom needs to determine how many grams of carbon dioxide are produced when 50 grams of methane (CH4) is completely combusted. The balanced equation is: CH4 + 2O2 -> CO2 + 2H2O:

  • MW of CH4: 12.011 + (4 x 1.008) = 16.043 g/mol
  • MW of CO2: 12.011 + (2 x 15.999) = 44.009 g/mol
  • Moles of CH4: 50 / 16.043 = 3.117 mol
  • Moles of CO2 (1:1 ratio): 3.117 mol
  • Mass of CO2: 3.117 x 44.009 = 137.13 grams

Burning 50 grams of methane produces approximately 137 grams of CO2. This stoichiometric relationship is fundamental to understanding combustion chemistry, carbon footprint calculations, and greenhouse gas emissions from natural gas usage.

Example 3: Dr. Patel's Polymer Research

Dr. Patel is working with polyethylene glycol (PEG) and needs to verify the molecular weight of a single repeat unit for her polymer characterization study. The PEG monomer is ethylene oxide (C2H4O) with terminal hydroxyl groups:

  • Repeat unit C2H4O: (2 x 12.011) + (4 x 1.008) + 15.999 = 44.053 g/mol
  • For PEG-400 (average MW ~400): approximately 400 / 44.053 = 9.08 repeat units
  • Actual PEG-400 formula: approximately H(OCH2CH2)9OH + partial unit

Understanding the repeat unit molecular weight helps Dr. Patel calculate the average chain length, which influences the polymer's physical properties like viscosity, melting point, and solubility. She uses our calculator to quickly verify molecular weights of various PEG derivatives used in drug delivery formulations.

Example 4: James's Environmental Chemistry Analysis

James is analyzing a water sample and needs to convert a calcium carbonate (CaCO3) hardness reading of 150 mg/L to millimoles per liter (mM) for comparison with European water quality standards:

  • MW of CaCO3: 40.078 + 12.011 + (3 x 15.999) = 100.086 g/mol
  • 150 mg/L = 0.150 g/L
  • Molarity: 0.150 / 100.086 = 0.001499 mol/L = 1.499 mM

The water has a hardness of approximately 1.5 mM CaCO3, which classifies it as moderately hard. James can also use our molarity calculator for additional concentration conversions needed in his environmental monitoring work.

Common Compounds Reference Table

Compound Formula MW (g/mol) Common Use
Water H2O 18.015 Universal solvent
Carbon Dioxide CO2 44.010 Greenhouse gas, carbonation
Sodium Chloride NaCl 58.443 Table salt, saline solutions
Glucose C6H12O6 180.156 Blood sugar, fermentation
Ethanol C2H5OH 46.069 Beverages, disinfectant
Sulfuric Acid H2SO4 98.079 Industrial chemical, batteries
Caffeine C8H10N4O2 194.191 Stimulant in coffee and tea
Calcium Carbonate CaCO3 100.086 Antacid, limestone, chalk

Tips and Complete Guide

Reading Chemical Formulas Correctly

Chemical formulas follow strict conventions that convey precise structural information. Element symbols always begin with a capital letter, with any subsequent letters lowercase (Na for sodium, not NA). Subscript numbers indicate atom count: H2O means 2 hydrogen atoms and 1 oxygen atom. Parentheses group atoms that repeat together: Ca(OH)2 means 1 calcium, 2 oxygens, and 2 hydrogens. The order of elements typically follows electronegativity or the Hill system (carbon first, hydrogen second, then alphabetical). Understanding these conventions ensures accurate molecular weight calculations and clear communication in chemistry.

Empirical vs. Molecular Formulas

The empirical formula is the simplest whole-number ratio of elements in a compound, while the molecular formula shows the actual number of each atom in a molecule. Glucose has an empirical formula of CH2O (simplest ratio) and a molecular formula of C6H12O6 (actual composition). The molecular weight of the molecular formula is always a whole-number multiple of the empirical formula weight: glucose's MW (180.156) is 6 times the empirical formula weight (30.026). To determine the molecular formula from an empirical formula, you need an independently measured molecular weight (from mass spectrometry, for example) and divide it by the empirical weight to find the multiplier.

Isotopes and Average Atomic Weights

The atomic weights used in molecular weight calculations are weighted averages across all natural isotopes. For most applications, these standard values are perfectly adequate. However, in isotope-labeled studies (like Carbon-14 tracing or deuterium NMR), you need to use the exact mass of the specific isotope rather than the average. For example, heavy water (D2O, using deuterium instead of hydrogen) has a molecular weight of 20.028 instead of the standard 18.015 for H2O. Mass spectrometry also measures exact isotopic masses rather than average weights, which is why mass spec peaks do not always match calculated average molecular weights precisely.

Molecular Weight in Everyday Life

Molecular weight affects physical properties that we encounter daily. Small molecules like water (18 g/mol) and alcohol (46 g/mol) are liquids at room temperature, while larger molecules like sugar (342 g/mol) and starch (thousands of g/mol) are solids. In cooking, the molecular weight of flavor compounds determines how volatile they are — smaller molecules evaporate more easily, which is why the smell of vinegar (acetic acid, 60 g/mol) is much more pungent than sugar. In medicine, molecular weight determines how drugs are absorbed: small molecule drugs (below ~500 g/mol) can often be taken orally, while larger biologic drugs (thousands to millions of g/mol) typically require injection.

Common Mistakes to Avoid

  • Incorrect capitalization of element symbols: CO means one carbon and one oxygen (carbon monoxide), while Co means cobalt. Always capitalize only the first letter of each element symbol. Similarly, NO is nitric oxide, but No is nobelium.
  • Forgetting to multiply inside parentheses: In Ca(OH)2, the subscript 2 applies to both O and H inside the parentheses, giving 2 oxygens and 2 hydrogens, not just 2 hydrogens. Our calculator handles this correctly.
  • Using outdated atomic weights: IUPAC periodically updates standard atomic weights. Our calculator uses current IUPAC values. If comparing with textbook values from older editions, small differences in the last decimal places are normal.
  • Confusing molecular weight with density: A high molecular weight does not mean the substance is heavy or dense. Polystyrene foam has a high molecular weight but very low density, while lead has a moderate atomic weight but high density. Molecular weight describes mass per mole, not mass per unit volume.
  • Ignoring significant figures: Atomic weights are known to different precisions for different elements. For most educational and routine lab work, using values to 3 decimal places is sufficient. For high-precision analytical work, consult the latest IUPAC atomic weight table for uncertainty values.

Frequently Asked Questions

Molecular weight (also called molecular mass or molar mass) is the sum of the atomic weights of all atoms in a molecule, expressed in grams per mole (g/mol) or atomic mass units (amu). To calculate it, identify each element in the molecular formula, multiply each element's atomic weight by its count in the formula, and sum all the results. For example, water (H2O) has a molecular weight of (2 x 1.008) + (1 x 15.999) = 18.015 g/mol. This value tells you the mass of one mole (6.022 x 10^23 molecules) of the substance. Our calculator parses any chemical formula automatically and provides a complete element-by-element breakdown with percentage composition.

Molecular weight applies to covalent compounds that exist as discrete molecules (like H2O, CO2, C6H12O6). Formula weight applies to ionic compounds (like NaCl, CaCO3) that do not exist as individual molecules but as crystal lattices of ions. Technically, NaCl does not have a molecular weight because there is no distinct NaCl molecule — it has a formula weight of 58.44 g/mol. In practice, both terms are often used interchangeably, and the calculation is identical: sum up the atomic weights of all atoms in the chemical formula. Our calculator works correctly for both molecular and ionic compounds.

Our calculator supports standard chemical formula notation including parentheses for polyatomic groups. Enter formulas exactly as written in chemical notation: H2O for water, NaCl for sodium chloride, Ca(OH)2 for calcium hydroxide, Mg3(PO4)2 for magnesium phosphate. The parser correctly handles nested parentheses and multipliers. When entering formulas, capitalize only the first letter of each element symbol (Na, not NA or na). Numbers go immediately after the element or closing parenthesis they modify. For example, Al2(SO4)3 means 2 aluminum atoms, 3 sulfur atoms, and 12 oxygen atoms.

One atomic mass unit (amu or u) is defined as exactly 1/12 the mass of a Carbon-12 atom, equal to approximately 1.66054 x 10^-24 grams. The brilliant connection between amu and g/mol is that they are numerically identical: an element with an atomic weight of 12.011 amu (carbon) has a molar mass of 12.011 g/mol. This equivalence arises from Avogadro's number being defined such that one mole of any substance contains exactly 6.02214076 x 10^23 entities. So when our calculator reports a molecular weight of 18.015 for water, this means both 18.015 amu per molecule and 18.015 grams per mole.

Molecular weight is the conversion factor between mass (grams) and moles. To convert grams to moles: moles = mass / molecular weight. To convert moles to grams: mass = moles x molecular weight. For example, to find how many moles are in 100 grams of glucose (C6H12O6, MW = 180.156 g/mol): moles = 100 / 180.156 = 0.5551 mol. Conversely, 2 moles of glucose weighs 2 x 180.156 = 360.312 grams. Our calculator includes mass-to-moles and moles-to-mass converters directly in the results panel, so you can perform both calculations without switching tools.

Atomic weights are not whole numbers because they represent the weighted average of all naturally occurring isotopes of an element. Carbon, for instance, exists as about 98.9% Carbon-12 (mass 12.000) and 1.1% Carbon-13 (mass 13.003), giving a weighted average of 12.011. Chlorine is about 75.8% Chlorine-35 and 24.2% Chlorine-37, yielding an atomic weight of 35.45. Elements with only one stable isotope (like fluorine at 18.998) have atomic weights very close to whole numbers. The variations from isotopic abundances are precisely measured and internationally standardized by the International Union of Pure and Applied Chemistry (IUPAC).

Some widely encountered molecular weights include: water (H2O) at 18.015, carbon dioxide (CO2) at 44.010, glucose (C6H12O6) at 180.156, sodium chloride (NaCl) at 58.443, ethanol (C2H5OH) at 46.069, acetic acid (CH3COOH) at 60.052, sulfuric acid (H2SO4) at 98.079, ammonia (NH3) at 17.031, methane (CH4) at 16.043, and caffeine (C8H10N4O2) at 194.191. Our calculator includes a preset dropdown for these and other common compounds, allowing you to quickly access their molecular weights without typing the formula. All values use IUPAC-standard atomic weights.

Hydrated compounds contain water molecules within their crystal structure, written with a dot notation like CuSO4 dot 5H2O (copper sulfate pentahydrate). To calculate the molecular weight of a hydrated compound, calculate the anhydrous compound and the water separately, then add them. For CuSO4 dot 5H2O: CuSO4 = 159.609 g/mol, plus 5 x H2O = 5 x 18.015 = 90.075 g/mol, for a total of 249.684 g/mol. In our calculator, you would need to enter the components separately since dot notation is not supported. Enter CuSO4 first, note the weight, then add 5 times the weight of water (90.075) manually.

Percent composition is the mass percentage of each element in a compound. It equals (element's total mass / molecular weight) x 100. For water (MW = 18.015): hydrogen = (2 x 1.008) / 18.015 x 100 = 11.19%, oxygen = 15.999 / 18.015 x 100 = 88.81%. Percent composition is important for identifying unknown compounds through elemental analysis, calculating empirical formulas from experimental data, verifying the purity of synthesized compounds, and understanding the nutritional content of foods (e.g., the nitrogen content of protein). Our calculator displays the percent composition for each element in the breakdown table alongside the atom count and mass contributions.

Related Calculators

Disclaimer: This calculator is for informational and educational purposes only. Results are estimates and may not reflect exact values.

Last updated: February 23, 2026

Sources