Molar Mass Calculator
Parse a chemical formula for its molar mass, element breakdown and mole conversions.
Chemical formula
1 line · 3 charsSupports nested brackets, hydrate dots (·, ., *), charges and isotopes D/T.
The formula is mirrored into the URL so you can bookmark or share an exact calculation.
Molar mass
18.0150 g/molMolar mass of H2O
18.0150 g/mol
Element breakdown
| Symbol | Element | Count | Atomic mass | Subtotal | Mass % |
|---|---|---|---|---|---|
| H | Hydrogen | 2 | 1.0080 | 2.0160 | 11.19% |
| O | Oxygen | 1 | 15.9990 | 15.9990 | 88.81% |
Each subtotal is count × atomic mass; mass % is subtotal ÷ total × 100.
Convert amount
Editing a field makes it the source; the others update from it. 1 mol = 6.02214076 × 10²³ particles.
Examples
Water
H2O18.0150 g/mol — H 2 × 1.008 = 2.016, O 1 × 15.999 = 15.999Oxygen accounts for about 88.81 percent of the mass; the two hydrogens account for the rest.
Copper sulfate pentahydrate
CuSO4·5H2O249.6770 g/mol (249.68 to 2 dp) — CuSO4 159.602 + 5 × H2O 18.015The hydrate dot adds five separate water molecules. The parts list shows one CuSO4 and five H2O, and the oxygen count includes both groups.
Grams to moles to particles
NaCl, 5.844 g0.1 mol — about 6.0221 × 10²² formula unitsWith NaCl at 58.44 g/mol, dividing 5.844 grams by the molar mass gives exactly one tenth of a mole.
About this tool
Molar mass is the mass of one mole of a substance, expressed in grams per mole. To find it by hand you multiply each element's atomic mass by the number of atoms of that element in the formula and add the products. This calculator performs the same arithmetic and exposes every step: the parsed formula, each element's count and atomic mass, its subtotal, and its share of the total as a percentage. A student can check a homework answer line by line instead of trusting an opaque number.
The formula parser is deliberately more capable than a simple symbol scanner. It accepts nested round and square brackets — Ca(OH)2 doubles both oxygen and hydrogen, while K4[Fe(CN)6] keeps the six cyanide groups inside the iron complex — and hydrate dots written as ·, ., or *. CuSO4·5H2O is split into copper sulfate plus five water molecules, with the water shown as its own part so waters of crystallization are visible instead of folded into a single oxygen count. Charge notation such as SO4^2-, NH4+, or [Fe(CN)6]4- is stripped with a notice because charge does not change mass.
Atomic weights are the IUPAC/CIAAW 2021 abridged standard values, the same numbers most textbooks quote. Several elements have no standard atomic weight because they have no stable, naturally occurring isotope; for those the tool uses the mass number of the most stable isotope and says so explicitly. A few standard weights are true interval ranges in the full IUPAC table; the abridged single values are used here. You can display totals with 2, 3, or 4 decimal places, and the tool tells you that coursework may require a different precision.
The converter covers grams, moles, and particles, using n = m / M and N = n × 6.02214076 × 10²³. Editing any one of the three fields makes it the source and recomputes the other two, so there is no ambiguous double binding. The formula is mirrored into the page URL as ?formula=..., which means a result can be bookmarked or sent to a classmate. Nothing is uploaded: formulas, weights, and conversions all stay in your browser tab.
What this tool does not do
- Uses abridged standard atomic weights, not isotope-specific masses; D and T are the only isotope aliases supported.
- Elements without a standard atomic weight use the most stable isotope's mass number and are flagged as approximate.
- Charges are ignored, and polymer notation, reaction equations, and arbitrary isotope labels are outside the supported formula grammar.
How to use this tool
Type a formula
Enter a formula such as H2O, Ca(OH)2, or CuSO4·5H2O. The result updates as you type; separators ·, ., and * are all accepted.
Read the breakdown
The table lists each element in order of first appearance with its count, atomic mass, subtotal, and mass percentage. Totals use the decimal precision chosen in the options row.
Convert an amount
Enter grams, moles, or particles in the converter. The field you edit becomes the source; the other two update from it using the current molar mass.
Share the calculation
Copy the element breakdown as text for homework, or copy the page URL, which carries the exact formula in its query string.
Use cases
Stoichiometry homework
Check a hand-calculated molar mass and see the per-element working a teacher expects, including the mass percentage column and an explicit rounding choice.
Solution preparation
Convert a required number of moles into grams for a reagent, or work backwards from a mass on the balance to moles and particle counts.
Verifying hydrate problems
Separate the anhydrous salt from its waters of crystallization so a pentahydrate is not mistaken for the anhydrous compound.
Formula syntax the parser understands
| Syntax | Example |
|---|---|
| Element and count | C6H12O6 |
| Round brackets | Ca(OH)2 |
| Square brackets | K4[Fe(CN)6] |
| Hydrate dot | CuSO4·5H2O |
| Charge suffix | SO4^2- or NH4+ |
| Isotope alias | D2O |
Lowercase input is capitalised with a warning: co2 is read as CO2, not Co2 (cobalt); nacl is read as NaCl. Type exact casing to choose a different element.
Common mistakes
Mistake:Confusing Co2 with CO2 when typing lowercase.
Fix:Element casing is meaningful: Co is cobalt and CO is carbon plus oxygen. The tool reads lowercase co2 as CO2 and warns that Co2 was also plausible; type CO2 or Co2 exactly when the distinction matters.
Mistake:Using the anhydrous mass for a hydrate.
Fix:CuSO4 is about 159.60 g/mol, but CuSO4·5H2O is about 249.68 g/mol. Include the hydrate dot and its count so the water mass is added.
Mistake:Treating a rounded total as exact.
Fix:Abridged atomic weights carry 3–6 significant figures and some are interval ranges. Pick a display precision that matches the course or lab convention, and remember that particle counts use the exact defined Avogadro constant.
Frequently asked questions
How do you calculate molar mass?
Write the formula, count the atoms of each element, multiply each count by that element's atomic mass in grams per mole, and add the products. For H2O that is 2 × 1.008 + 15.999 = 18.015 g/mol. This tool shows each multiplication and subtotal in a table, together with the percentage each element contributes to the total.
How are hydrates like CuSO4·5H2O handled?
The dot separates the anhydrous salt from its waters of crystallization. The parser reads CuSO4 plus five H2O units, multiplies the water mass by five, and adds it to the salt: about 159.602 + 5 × 18.015 = 249.677 g/mol. The water molecules are listed as a separate part, and the oxygen and hydrogen counts include them. Dots written as . or * work as well.
Why do atomic weights have decimals?
Atomic weights are averages over the naturally occurring isotopes of an element, weighted by abundance, so they are rarely whole numbers. IUPAC publishes interval ranges for some elements; the abridged single values used here are the ones most textbooks quote. Radioactive elements with no standard atomic weight use the mass number of their most stable isotope, and the tool labels those values as approximate.
How do I convert grams to moles?
Divide the mass in grams by the molar mass in g/mol: n = m / M. For sodium chloride, 5.844 g ÷ 58.44 g/mol = 0.1 mol. To go the other way, multiply moles by molar mass. The converter also shows particles using the defined Avogadro constant, 6.02214076 × 10²³ per mole; editing any field makes it the source and updates the rest.
Are parentheses and brackets supported?
Yes. Round and square brackets can nest, and a count after a closing bracket multiplies everything inside. Ca(OH)2 gives two oxygen and two hydrogen atoms, and K4[Fe(CN)6] gives four potassium, one iron, six carbon, and six nitrogen atoms. Charge suffixes such as ^2- or + are ignored with a notice, since they do not affect mass.
What happens if I type lowercase formulas?
Lowercase element symbols are ambiguous, so the tool tries to recover a valid reading and warns you. co2 is read as CO2 (carbon dioxide), not Co2 (cobalt), and nacl is read as NaCl. The notice lists plausible alternatives; typing exact capitalization chooses the one you intend.
Can I share a calculation?
Yes. The current formula is mirrored into the URL as a ?formula= query parameter, so a copied link opens the same calculation. You can also copy the element breakdown as plain text, including each subtotal and mass percentage, for pasting into homework or a lab notebook. Nothing is sent to a server.
References & standards
Related tools
3D Affine Transform Visualizer
Compose 4x4 matrices and inspect 3D affine transformations with a live cube wireframe. Multiply, invert, and apply translate, rotate, scale, and skew transforms in your browser.
Bayes Theorem Calculator
Update a prior probability with test evidence: posterior P(A|B), natural frequencies, a confusion matrix and a worked formula breakdown — all computed locally.
Chemical Equation Balancer
Balance chemical equations with integer coefficients and see the matrix method, element totals and worked solution.
Data Storage Converter
Convert bits, bytes, KB, MB, GB, TB and KiB, MiB, GiB, TiB with exact decimal and binary values side by side
Dilution Calculator
Solve C1V1=C2V2 for any variable, plan serial dilution plates with pipette-friendly volumes, and mix concentration units without manual conversions.
DNA Sequence Translator
Reverse complement, GC content, six-frame DNA-to-protein translation, ORF finder and codon usage — all in your browser.