Chemical Formula Calculator
Enter any chemical formula to parse it into its constituent elements and compute the molecular weight. This chemical formula calculator handles standard molecular formulas, condensed formulas, parenthetical groups, bracket notation for coordination compounds, and nested structures up to 5 levels deep. Get instant element breakdowns, atom counts, and mass composition.
上に化学式を入力して分子量を計算します
Real-Time Chemical Formula Analysis
Watch the formula get parsed and the molecular weight computed as you type.
The chemical formula calculator uses a recursive descent parser to analyze your input character by character. It identifies element symbols (one uppercase letter optionally followed by a lowercase letter), reads subscript numbers, and handles grouping symbols — parentheses (), brackets [], and braces {} — with proper nesting.
For complex formulas like K₄[Fe(CN)₆], the parser first resolves the innermost group (CN), multiplies by 6, adds Fe, then multiplies the entire bracket content by the outer context. The result: K:4, Fe:1, C:6, N:6 — producing a molecular weight of 368.35 g/mol.
Case sensitivity is critical: Co (cobalt, element 27) is different from CO (carbon monoxide, C + O). The parser strictly follows IUPAC element symbol conventions.
Element Symbols and Atomic Weights
Chemical formulas are built from element symbols — each with a unique atomic weight.
Chemical formulas use standardized element symbols: one or two letters, with the first always capitalized. Hydrogen is H, Carbon is C, Chlorine is Cl, Chromium is Cr. This convention prevents ambiguity — the parser distinguishes Co (cobalt) from CO (carbon + oxygen).
Each element symbol maps to a standard atomic weight from the IUPAC 2021 periodic table. These weights, combined with atom counts from the parsed formula, determine the total molecular weight of the compound.
Explore the element cards below to see common elements used in chemical formulas and their atomic weights.
How to Use the Chemical Formula Calculator
Enter, parse, and analyze any chemical formula in 3 steps.
Enter a Chemical Formula
Type the chemical formula exactly as it appears in chemical notation. Use uppercase for the first letter of each element symbol (Fe, not fe) and lowercase for the second letter if any (Mg, not MG). Subscripts are typed as regular numbers: H2O, C6H12O6, Ca(OH)2. The parser validates your formula in real time.
Chemical Formula Examples
Click any compound to parse its formula and see the element breakdown.
Chemical Formula Calculator FAQ
Questions about chemical formula notation, parsing, and molecular weight calculation.