Formula mass adds atomic masses multiplied by the number of each atom in the chemical formula. Parentheses multiply the atoms inside the group.
Example to check
Water has two hydrogen atoms and one oxygen atom, giving an approximate molar mass of 18.015 g/mol with commonly used atomic weights.
Before using the result
Isotopic composition and rounding affect precision. Chemical formula parsing does not determine purity, hydration state or whether a substance is safe to handle.