---
slug: molecular-weight-calculator
title: "Molecular Weight Calculator"
category: scientific
updated: 2026-11-18
canonical: https://calcseed.com/c/scientific/molecular-weight-calculator/
html: /c/scientific/molecular-weight-calculator/
---

# Molecular Weight Calculator

Calculate the molecular weight (molar mass) of a chemical formula such as H2O or C6H12O6.

## Quick answer

**Quick answer:** with the default inputs (H2O), the molecular weight is **18.02**. Change any input to update the result.

## Default calculation

Values computed by this calculator at exactly the default inputs listed below.

### Inputs (defaults)

| Input | Value | Unit |
| --- | --- | --- |
| Chemical formula | H2O |  |

### Outputs at these defaults

| Output | Value | Unit |
| --- | --- | --- |
| Molecular weight | 18.015 |  |

## Formula

```text
M = &Sigma;(n_i_ × A_r,i_)
```

## Inputs

| Variable | Type | Unit | Default |
| --- | --- | --- | --- |
| Chemical formula | text |  | H2O |

## Outputs

| Result | Format |
| --- | --- |
| Molecular weight | primary |
| Molecular weight | number |

## How it works

### What this calculator returns

You type a formula and get one number: the mass of one mole of that substance in grams. For the default H_2_O the result is **18.02 g/mol**, built from two hydrogen atoms at 1.008 and one oxygen at 15.999, which sum to 18.015 before display rounding.

The steps panel also breaks the total down element by element, so you can see which atom dominates. In water the oxygen contributes 88.8% of the mass; in glucose carbon and oxygen are almost equal, at 40.0% and 53.3%.

### How the sum is built

Molecular weight is the sum of each element&rsquo;s standard atomic weight multiplied by how many atoms of it the formula contains. The tool reads the formula left to right, pairing each element symbol with the integer that follows it, and treats a missing number as one.

The result is numerically identical to molar mass in g/mol, because a mole is defined as 6.022 × 10^23 entities and the atomic weight scale is anchored to carbon-12. Molecular weight is technically a dimensionless ratio and molar mass carries units, but every practical calculation uses the same digits.

#### What the parser accepts

Write a flat list of element symbols and counts: H2O, CO2, C6H12O6, NaCl, H2SO4. Symbols must use the correct capitalisation, since Co is cobalt with a weight of 58.933 while CO is carbon monoxide at 28.010 — a 30.9 g/mol difference from one keystroke. Parentheses and hydrate dots are not parsed, so Al2SO43 must be expanded by hand.

### Worked example at the defaults

Hydrogen: 2 × 1.008 = 2.016. Oxygen: 1 × 15.999 = 15.999. Total: **18.015 g/mol**, displayed as 18.02 after rounding to four significant figures. That one mole of water is 18.02 g and contains 6.022 × 10^23 molecules.

The same arithmetic scales without limit: a litre of water at 1,000 g is 55.5 mol, and a single molecule weighs 18.015 ÷ 6.022 × 10^23 = 2.99 × 10^−23 g. Both numbers follow from the 18.015 figure and nothing else.

### Where the mass sits in glucose

| Element | Count | Atomic weight | Contribution |
| --- | --- | --- | --- |
| C | 6 | 12.011 | 72.066 g/mol |
| H | 12 | 1.008 | 12.096 g/mol |
| O | 6 | 15.999 | 95.994 g/mol |
| Total | — | — | 180.156 g/mol |

Glucose is a useful sanity check because its formula hides a large hydrogen count. Twelve hydrogens contribute only 6.7% of the mass despite being the most numerous atoms, which is why hydrogen is usually ignored in quick estimates and never ignored in precise work.

### Common formulas and their weights

| Formula | Name | Molecular weight |
| --- | --- | --- |
| H2O | Water | 18.015 g/mol |
| CO2 | Carbon dioxide | 44.009 g/mol |
| NaCl | Table salt | 58.440 g/mol |
| NH3 | Ammonia | 17.031 g/mol |
| NaOH | Sodium hydroxide | 39.997 g/mol |
| H2SO4 | Sulfuric acid | 98.072 g/mol |
| CaCO3 | Calcium carbonate | 100.086 g/mol |
| C6H12O6 | Glucose | 180.156 g/mol |

These eight cover most general-chemistry weighings. Sodium hydroxide at 39.997 g/mol is the classic trap: a 1 M solution needs 40.00 g per litre, and using 40 g exactly introduces a 0.008% error that is invisible on a balance but real over many litres.

### What changes the number

- Atom counts: doubling every subscript in H2O gives H4O2, still 36.03 g/mol, because the ratio, not the formula, sets the mass per mole.
- Isotopes: deuterium oxide (D2O) weighs 20.028 g/mol against 18.015 for ordinary water, a 11.2% difference.
- Atomic weight revisions: the IUPAC values shift in the fourth decimal as measurements improve, which changes 18.015 by less than 0.001.
- Rounding: using H = 1 and O = 16 gives 18 instead of 18.015, an error of 0.08% that compounds in stoichiometry.

#### Hydrates and parentheses

A hydrate such as CuSO_4_&middot;5H_2_O is 249.68 g/mol, but the tool reads CuSO45H2O as 5 extra hydrogens and 5 extra oxygens attached directly, which happens to give the same total here. It fails for Al_2_(SO_4_)_3_, where the subscript 3 multiplies a group. Expand that by hand as Al2S3O12 before entering it.

### Mistakes that give the wrong weight

- Cobalt versus carbon monoxide: Co is 58.933, CO is 28.010.
- Using a space or subscript character that the parser cannot read, such as H₂O copied from a document.
- Assuming brackets multiply: Ca(OH)2 must be written CaO2H2 to be counted correctly.
- Mixing molecular weight with formula weight for ionic solids, which have no discrete molecules but the same arithmetic.

A quieter issue is significant figures. Atomic weights are known to five or six digits, so a result quoted to two decimals is already rounded. If you need a molarity to four figures, keep the full 18.015 and round only the final concentration, not the intermediate mass.

### Turning the weight into an amount

Divide grams by the molecular weight to get moles: 90 g of water is 90 ÷ 18.015 = 5.00 mol. Multiply moles by the weight to go the other way, so 0.25 mol of glucose is 45.04 g. Those two operations cover almost every laboratory conversion that starts from a balance reading.

Once you have moles, the stoichiometry calculator carries them across a balanced equation, and the molar mass converter handles unit changes on the same figure.

## FAQ

### What is the difference between molecular weight and molar mass?

Almost nothing numerically. Molecular weight is a ratio of masses, while molar mass is in g/mol, but water is 18.015 either way. The tool reports 18.02 for H2O, rounded from 18.015.

### How do I write a subscript?

Type the number plainly after the symbol, with no space: H2O, CO2, C6H12O6. The parser reads digits as counts, so a pasted subscript character such as the 2 in H2O may be ignored.

### Why does my formula give the wrong answer?

Check capitalisation first. Co is cobalt at 58.933 while CO is carbon monoxide at 28.010, a 30.9 g/mol gap. Also confirm that brackets are expanded, since Ca(OH)2 is not parsed as a group.

### Does it support hydrated salts like CuSO4&middot;5H2O?

Type it as CuSO45H2O and the counts add to 249.68 g/mol, which is correct for the hydrate because the five waters contribute 90.08. Drop the dot, not the digits.

### What is the molecular weight of water?

18.015 g/mol: 2 × 1.008 for hydrogen plus 15.999 for oxygen. That makes one mole 18.02 g and one molecule 2.99 × 10^−23 g.

### How many moles are in 100 g of glucose?

Divide by 180.156 to get 0.555 mol. The same method gives 5.55 mol for 100 g of water and 1.71 mol for 100 g of table salt at 58.440.

### Why does glucose weigh so much more than water?

Six carbons and six oxygens dominate. Glucose is C6H12O6 at 180.156 g/mol, ten times water&rsquo;s 18.015, even though both contain hydrogen and oxygen only in part.

### Do isotopes change the answer?

Yes, if the sample is enriched. Heavy water D2O weighs 20.03 g/mol against 18.015, so a fully deuterated litre is 1,111 g rather than 1,000 g.

### What is the molecular weight of air?

About 28.97 g/mol as a mixture, not a single formula. The tool cannot add a mixture, so use 28.97 directly in gas-law work, or compute N2 at 28.014 and O2 at 31.998 separately.

### Can I use this for a polymer?

Only for the repeat unit. Polyethylene&rsquo;s CH2 unit is 14.027 g/mol, but the polymer has a distribution of chain lengths, so its molecular weight is reported as an average such as 50,000 g/mol.

## Method and sources

Methodology: Physical constants follow CODATA 2022 recommended values, and formulas follow standard physics definitions.

Last updated: 2026-11-18.
- IUPAC standard atomic weights; molecular weight = sum of (atomic weight × atom count).
