Empirical formula calculator with molecular formula

This empirical formula calculator follows the steps in OpenStax Chemistry: moles of each element, divide by the smallest, multiply to whole numbers. Nicotine with 74.02 % C, 8.710 % H and 17.27 % N gives C5H7N; with the molar mass 162.28 g/mol the molecular formula is C10H14N2.

Source: OpenStax, Chemistry 2e, section 3.2 “Determining Empirical and Molecular Formulas” (Examples 3.11–3.13: hematite Fe2O3, CO2 from 27.29 % C, nicotine C5H7N → C10H14N2; Cl2O7, N2O5, caffeine C8H10N4O2) (read 09.10.2026). Updated: .

element symbol followed by its value, e.g. Fe 34.97 O 15.03 (grams) or C 40% H 6.71% O 53.3%
g/mol
for the molecular formula; 0 = empirical formula only
My ToolboxYour inputs are saved in this browser only.

Result

Formula
Empirical formula C5H7N · molecular formula C10H14N2
Steps
Elementg or %Atomic massmol÷ smallestSubscript
C74.02012.0116.16274.9985
H8.7101.0088.64097.0087
N17.27014.0071.23301.0001
Empirical formula mass81.118 g/mol
n = molar mass ÷ formula mass162.28 ÷ 81.118 = 2.001 → 2
Molecular formulaC10H14N2
Calculated with IUPAC standard atomic weights; ratios within 0.1 of a whole number count as whole. Measured data with larger errors can give a different formula.

How it is calculated

Three steps from composition to empirical formula: (1) divide each mass by the atomic mass to get moles, (2) divide every mole number by the smallest one, (3) if a ratio such as 1.5 remains, multiply all of them by the smallest whole number that clears it. Percentages work the same way – they are the grams in a 100 g sample.

Worked examples (rows 1–5 from OpenStax Chemistry 2e)

InputMole ratioEmpirical formulaMolar massMolecular formula
Fe 34.97 g, O 15.03 g1 : 1.500Fe2O3––
C 27.29 %, O 72.71 %1 : 2.000CO2––
N 0.130 g, O 0.370 g1 : 2.492N2O5––
C 74.02 %, H 8.710 %, N 17.27 %4.998 : 7.008 : 1C5H7N162.28 g/molC10H14N2
C 49.47 %, H 5.201 %, N 28.84 %, O 16.48 %3.999 : 5.009 : 1.999 : 1C4H5N2O194.2 g/molC8H10N4O2
C 40.0 %, H 6.71 %, O 53.3 %1 : 1.999 : 1CH2O180.16 g/molC6H12O6

From empirical to molecular formula

The molecular formula is a whole multiple of the empirical formula: n = molar mass ÷ empirical formula mass. For nicotine C5H7N the formula mass is 81.118 g/mol; 162.28 ÷ 81.118 = 2.0005, so the molecular formula is C10H14N2. OpenStax gets the molar mass from 40.57 g = 0.2500 mol. The atomic masses here are the IUPAC standard atomic weights (C 12.011, H 1.0080, N 14.007, O 15.999, Fe 55.845). The reverse calculation – percent from a formula – is done by the percent composition calculator; the molar mass of any formula by the molar mass calculator.

Frequently asked questions

How do you find the empirical formula from percent?

Treat the percentages as grams in 100 g, convert to moles and divide by the smallest. 27.29 % C and 72.71 % O give 2.272 and 4.545 mol, ratio 1 : 2, so CO2.

What if the ratio is not a whole number?

Multiply all ratios by the same small integer: 1 : 1.5 becomes 2 : 3 (Fe2O3), 1 : 3.5 becomes 2 : 7 (Cl2O7), 1.33 needs a factor of 3.

How do I get the molecular formula?

Divide the molar mass by the empirical formula mass and multiply the subscripts by the result: 180.16 ÷ 30.026 = 6, CH2O × 6 = C6H12O6.

Can I enter grams instead of percent?

Yes. Fe 34.97 O 15.03 (grams of hematite) gives the same Fe2O3 as percentages would.

Which atomic masses are used?

The IUPAC CIAAW standard atomic weights, e.g. C 12.011, H 1.0080, O 15.999. Textbooks with rounded values can differ in the last digit of the ratios.

Is the empirical formula always the molecular formula?

No. CO2 and Fe2O3 are equal to their empirical formulas, but glucose C6H12O6 has the empirical formula CH2O.

Sources and legal basis

As of: · Editorial policy

Related tools