Molecular weight, molar mass and formula mass
These three terms get used almost interchangeably, and for everyday chemistry the arithmetic behind them is genuinely identical, but they are not quite the same idea. Molecular weight, more precisely called relative molecular mass, is a plain ratio with no units attached: the mass of one molecule measured against a twelfth of the mass of a carbon-12 atom. Molar mass takes that same number and gives it a unit and a scale that a lab can actually weigh out, grams per mole, the mass of an Avogadro's-number-sized batch of the substance. Formula mass is the honest term for compounds that do not exist as discrete molecules at all, ionic solids such as table salt, which is really an endless lattice of sodium and chloride ions rather than separate NaCl units drifting about. Calling that a "molecular weight" is technically wrong, but the calculation, add up the atomic weights in the formula, is exactly the same sum either way, which is why this tool and most others use "molecular weight" as the everyday label for all three.
Why atomic weights aren't whole numbers
Hydrogen's atomic weight is 1.008, not 1, and chlorine's is 35.45, not 35 or 37. Every element on Earth turns up as a fixed natural mix of isotopes, atoms with the same number of protons but different numbers of neutrons, and the atomic weight printed on a periodic table is the abundance-weighted average of those isotope masses, not the mass of any single atom. Chlorine is a clear example: about three-quarters of natural chlorine atoms are chlorine-35 and about one-quarter are the heavier chlorine-37, and averaging the two by how often each turns up lands on 35.45. Carbon is mostly carbon-12 with a small, steady trace of heavier carbon-13, which is why its atomic weight is 12.011 rather than a clean 12. None of this is measurement error or rounding sloppiness; it is what "average" genuinely means when the thing being averaged is a mix of isotopes that never changes on a human timescale.
How the calculator reads a formula
A formula is read left to right using four rules. A capital letter always begins an element symbol; an optional single lower-case letter straight after it can complete a two-letter symbol, so Na is sodium, Cl is chlorine and Fe is iron, each read as one unit rather than two separate letters. A number placed immediately after a symbol multiplies that element alone, so H2 means two hydrogen atoms. Parentheses group a fragment so a following number multiplies everything inside at once: Ca(OH)2 means one calcium atom plus two of each element inside the brackets, which expands out to one calcium, two oxygens and two hydrogens.
The fourth rule covers hydrates, compounds crystallised with a fixed number of water molecules locked into the structure. A raised dot, an asterisk or a plain full stop written before that water, all treated the same way here, separates the anhydrous compound from its water of crystallisation, so copper sulfate pentahydrate, CuSO4·5H2O, is copper sulfate plus five whole water molecules, not five oxygen atoms bolted onto the formula some other way.
Case matters: Co is not CO
Chemistry's classic warning about capitalisation is cobalt against carbon monoxide. Co, capital C followed by lower-case o, is the element symbol for cobalt, atomic weight 58.93. CO, two capital letters, is an entirely different thing, one carbon atom and one oxygen atom bonded together as carbon monoxide, with a combined mass of roughly 28.01. Typing the wrong case turns a single metal atom into a two-atom molecule of a completely different substance, so this calculator treats case exactly as written rather than guessing at intent, and a formula that starts a symbol with a lower-case letter is flagged as an error rather than silently corrected.
What percentage composition is used for
Once the molar mass is known, dividing each element's subtotal mass by the total gives the percentage that element contributes to the compound's overall mass, the composition table and chart below do this for every element in the formula. That percentage runs in both directions in real chemistry: given a formula you can predict the mass breakdown, and given only the measured mass breakdown of an unknown sample, chemists work backwards to the simplest whole-number ratio of atoms, the empirical formula, which is exactly how early chemists worked out formulas before modern instruments existed. The same percentages show up on a fertiliser bag's N-P-K numbers, which state the mass percentage of nitrogen, phosphorus (as P2O5) and potassium (as K2O) that a blend contains.
Moles: the bridge to the lab bench
Molar mass is what turns a recipe written in atoms into a quantity a scale can actually measure: weigh out a compound's molar mass in grams and you have exactly one mole of it, 6.022 × 1023 formula units, ready to react in known proportions with anything else measured out the same way. That single conversion factor, grams per mole, is the constant chemists reach for every time a reaction on paper has to become a real measurement in a flask.
Common mistakes this tool guards against
- An unknown element symbol. A token that matches no entry in the atomic-weight table, such as a typo or a placeholder letter, is named directly in the error rather than silently ignored.
- Unbalanced parentheses. Every opening bracket needs a matching close; a missing or extra one is flagged rather than guessed at.
- Starting a symbol with a lower-case letter. Real element symbols never begin lower case, so a formula typed as, say, "co" instead of "Co" is treated as the error it actually is.
- A number with nothing in front of it. A count has to follow an element or a closing bracket; a stray digit at the start of a formula or straight after another digit has nothing to multiply.
- An empty box. Nothing typed means nothing to parse, shown as a prompt rather than a silent zero.
Questions people ask
What is the difference between molecular weight and molar mass?
Molecular weight (relative molecular mass) is a unitless ratio comparing one molecule's mass to a twelfth of a carbon-12 atom's mass. Molar mass is the same number with grams-per-mole attached, describing the mass of a mole of the substance, the amount a scale can actually weigh out. In everyday use, including on this page, the two numbers are identical; only the units and the scale of thinking differ.
Why is chlorine's atomic weight 35.45 instead of 35 or 37?
Natural chlorine is a fixed mix of two isotopes, chlorine-35 and chlorine-37, roughly three parts to one. The atomic weight is the abundance-weighted average of the two, not the mass of either isotope alone, which is why it lands on 35.45 rather than a whole number.
How do parentheses work in a formula like Ca(OH)2?
Everything inside the brackets is treated as one group, and the number straight after the closing bracket multiplies every element in that group. Ca(OH)2 has one calcium atom plus two of each element inside the brackets, expanding to one calcium, two oxygens and two hydrogens.
What does the dot mean in a formula like CuSO4·5H2O?
It marks a hydrate, a compound crystallised with a fixed number of whole water molecules locked into its structure. CuSO4·5H2O is copper sulfate plus five water molecules of crystallisation; this calculator accepts a raised dot, an asterisk or a plain full stop written the same way.
Why does capitalisation matter, as in Co versus CO?
Co, a capital letter followed by a lower-case one, is the element symbol for cobalt. CO, two capital letters, is carbon monoxide, one carbon atom bonded to one oxygen atom, a completely different substance with a different mass. Getting the case wrong changes what is actually being calculated, so this calculator reads case exactly as typed.
What is percentage composition used for?
It shows what share of a compound's total mass each element contributes. Chemists use it to work backwards from a measured mass breakdown to a compound's simplest formula, and it is the same idea behind the N-P-K percentages printed on a bag of fertiliser.
How does molar mass connect to moles?
Weighing out a compound's molar mass in grams gives exactly one mole of it, 6.022 × 1023 formula units. That conversion, grams to moles and back, is how a reaction planned on paper turns into an actual measured quantity in a lab.
Atomic weights are the IUPAC 2021 standard (conventional, abridged) values, an abundance-weighted average across each element's naturally occurring isotopes, not the mass of any single atom. Values for radioactive elements with no stable isotope use the mass number of their longest-lived known isotope, shown in this tool without brackets for readability.