This tool computes the exact molecular weight of any compound based on its chemical formula. It accurately parses standard chemical notation, including parentheses for groups and subscripts, and calculates the total molar mass using precise atomic weights.
Users can enter formulas such as C6H12O6 (glucose), C9H8O4 (aspirin), or more complex ones like Al2(SO4)3 or C6H5(OH).
The tool provides:
- The molecular weight in g/mol with high precision
- The count of each atom in the molecule
- The mass percentage contribution of each element
The core calculation is based on the fundamental formula for molecular weight:
\[ MW = \sum (n_i \times A_i) \]
where:
- \( n_i \) is the number of atoms of element \( i \) in the molecule
- \( A_i \) is the atomic weight of element \( i \) (in g/mol)
The mass percentage of each element is calculated as:
\[ \%_{element} = \left( \frac{n_i \times A_i}{MW} \right) \times 100 \]
The parser fully supports nested parentheses (e.g., Mg(OH)2, Ca3(PO4)2) and correctly handles multipliers after groups. It follows standard chemical formula conventions (Hill system order is not required — input order is preserved for display).