Mathematics
Molar mass calculator
Work out a molar mass in g/mol from formula counts and atom molar masses, and convert a sample mass in grams to moles.
Formula up to 256 characters, 32 symbols, 8 nested groups and 1 billion total counts. Enter Symbol=molar mass in g/mol, each 1e-9–1e6. Example H=1,O=16 are chosen arithmetic values, not standard atomic weight data.
Result
Formula / calculation:
Educational arithmetic with entered values and floating approximations. No substance identification, standard atomic weight or isotope dataset, pH or equilibrium model, preparation instructions, health or safety decision.
Decimal results are approximate. Inputs stay in this browser tab.
How it works
Educational arithmetic with entered values and floating approximations. No substance identification, standard atomic weight or isotope dataset, pH or equilibrium model, preparation instructions, health or safety decision.
About this calculation
The molar mass calculator adds up the contributions of each symbol in a chemical formula and converts a sample mass in grams into moles. It suits students and anyone checking formula arithmetic who already knows the atomic masses they want to use.
You enter the formula, which may have up to 256 characters, 32 symbols and 8 nested groups, and a list of Symbol=molar mass pairs in g/mol, each between 1e-9 and 1e6. The tool multiplies every formula count by its entered mass, sums the contributions and shows each symbol's share of the total mass. With H=1 and O=16, H2O gives 18 g/mol and 36 g correspond to 2 mol.
The result is educational arithmetic with floating approximations. The masses are your own values rather than standard atomic weights or isotope data, and there is no substance identification, pH or equilibrium model, preparation advice or safety decision.
Worked example
With these example values the calculator gives the result below. You can change any value in the form above.
Inputs
- Composition formula
- H2O
- Entered atom molar masses: Symbol=value in g/mol, one per line
- H=1 O=16
- Sample mass (g)
- 36
Result
- Entered molar mass (g/mol)
- 18 g/mol
- Amount of substance
- 2 mol
- Total formula count
- 3
Frequently asked questions
How do I calculate the molar mass of a formula?
Enter the formula and a molar mass in g/mol for each symbol, such as H=1,O=16. The molar mass calculator multiplies each formula count by the entered mass and adds the contributions, so H2O with those values gives 18 g/mol.
How do I convert grams into moles?
Enter the sample mass in grams and the molar mass calculator divides it by the calculated molar mass. In the worked example, 36 g of H2O with H=1 and O=16 gives 2 mol.
Does the molar mass calculator use standard atomic weights?
No. You enter the atom molar masses yourself. The example values H=1 and O=16 are chosen arithmetic values, not standard atomic weight data, and no isotope dataset is included.
How long can the chemical formula be?
The formula can have up to 256 characters, 32 symbols, 8 nested groups and 1 billion total counts. Each entered molar mass must lie between 1e-9 and 1e6 g/mol.
Can the molar mass calculator identify a substance?
No. It is educational arithmetic with entered values and floating approximations. It does not identify substances, model pH or equilibrium, give preparation instructions or make health or safety decisions.