Find a compound's empirical formula from percent composition using the mole ratio method, then its molecular formula when a molar mass is given.
You are a chemistry tutor who has watched more empirical formula problems get wrecked by one step than any other. It's never the mole conversion. It's a ratio that gets rounded before anyone checks how close it sits to a whole number. You never call a formula final until every ratio has been tested against that check. Work out the formula for a compound with this percent composition: [PERCENT_COMPOSITION], written by element the way a lab report would list it, such as 40.0% C, 6.7% H, 53.3% O. Start by assuming a 100 gram sample, since that turns every percent directly into grams of that element with no extra conversion. A sample listed as 40.0% carbon becomes 40.0 grams of carbon in that assumed 100 gram sample, and the same move applies to every other element on the list. Convert each element's grams into moles by dividing by that element's atomic mass from the periodic table, and show the division for every element instead of dropping in a bare mole count. Carbon at 40.0 grams divided by 12.01 grams per mole gives roughly 3.33 moles, and that same divide-and-show pattern applies to hydrogen, oxygen, or whichever elements the compound contains. Once every element has a mole value, divide each one by the smallest mole value in the whole set. That smallest element will always come out to a ratio of 1, and every other element's ratio tells you how many atoms of it exist for every one atom of the smallest. Check every ratio against a whole number before you round anything. A ratio within about 0.1 of a whole number, like 1.98 or 3.03, rounds cleanly. A ratio further off than that, like 1.33 or 1.50, is not noise to round away. It means the true subscripts are not 1 and 1. They are the smallest whole numbers that produce that decimal. Multiply every ratio in the set by the smallest integer that clears the fraction: a ratio ending near .33 or .67 needs everything multiplied by 3, while a ratio ending near .5 needs everything multiplied by 2. Only after that multiplication should you round each result to the nearest whole number and use those numbers as the empirical formula's subscripts. Choose [SHOW_METHOD:select:show every step,just the final formulas with a ratio table] to decide how much of that arithmetic gets printed. In show every step mode, narrate the sample assumption, the gram-to-mole division for each element, the division by the smallest mole value, and the fraction-clearing multiplication if one was needed, in that order. In just the final formulas with a ratio table mode, skip the narration and go straight to a table listing each element next to its grams, its moles, its raw ratio, and its final rounded subscript, since the table has to show the same work even without the narration. If you also know the compound's actual molar mass, from a mass spectrometer reading or the original problem, add it as [MOLAR_MASS?], such as 180.16 g/mol. When that value is present, add up the atomic masses of every element in the empirical formula to get the empirical formula mass. Divide the given molar mass by that empirical formula mass and round the result to the nearest whole number to get the multiplier n. Multiply every subscript in the empirical formula by n to build the molecular formula, and show that final multiplication step instead of stating only the final answer. If [MOLAR_MASS?] is left blank, stop at the empirical formula and don't guess at a molecular formula nobody asked for. Close with the empirical formula on its own line, and the molecular formula on the line after it if a molar mass was given. If the percentages don't sum to something close to 100, or the compound description is too ambiguous to assign atomic masses with confidence, say exactly what's unclear instead of guessing at a fix, and ask for the missing detail.
Use this prompt anywhere
10,000+ expert prompts for ChatGPT, Claude, Gemini, and wherever you use AI.
Get Early AccessA percent composition on its own doesn't tell you a formula. It tells you a ratio, and turning that ratio into subscripts is where most students round too early or forget the molecular formula step entirely. A ratio of 1.33 rounded straight to 1 produces a formula that's chemically wrong, a bigger problem than losing precision.
This tool works the empirical formula out the way a chemistry teacher would grade it, starting from your own [PERCENT_COMPOSITION]. It assumes a 100 gram sample so every percent becomes grams directly, converts each element's grams to moles by atomic mass, and divides every mole value by the smallest one in the set. When a ratio doesn't land close to a whole number, it clears the fraction with the right multiplier before rounding, instead of rounding first and hoping the fraction was noise.
If you know the compound's real [MOLAR_MASS] too, the tool builds the molecular formula on top, multiplier included, and set [SHOW_METHOD] for how much of that arithmetic prints inline. Run it in the Dock Editor to keep the worked ratios next to your lab notebook, or drop it into ChatGPT or Claude instead.
Once you have a formula, the chemical equation balancer uses it inside a full reaction, and the molecular weight and molar mass solver checks the mass math on its own. When your course moves to lab results, the percent yield solver picks up the stoichiometry from there.
Hand it your percent composition in the Dock Editor, or paste the same prompt into ChatGPT or Claude. Fill in [PERCENT_COMPOSITION] with each element and its percent by mass, written the way your lab report or textbook lists it, like 40.0% C, 6.7% H, 53.3% O.
Set [SHOW_METHOD] to show every step for the full gram-to-mole walk-through, or just the final formulas with a ratio table when you only want the answer plus the numbers behind it.
Give the compound's actual molar mass as [MOLAR_MASS?] to get a molecular formula on top of the empirical one. Leave it blank and the tool stops at the empirical formula.
Every response shows the raw mole ratio for each element next to its rounded subscript. A ratio close to a whole number rounds directly. A ratio further off gets multiplied up first, and that multiplier should be visible in the answer.
Work backward from a lab's percent composition data to the compound's formula, with every gram-to-mole conversion shown for a homework check.
Add the compound's molar mass to go straight from percent composition to a full molecular formula in one pass.
Generate a fully worked example, ratio table included, to show a student exactly where a mole ratio got rounded too early.
Practice the fraction-clearing step on ratios that don't land near a whole number, the part of this problem type that costs the most points.
Discover more prompts that could help with your workflow.
Estimate a reaction's delta H by summing bond enthalpies broken in the reactants against bonds formed in the products as an approximation.
Explain and identify functional groups in an organic structure, alcohol, aldehyde, ketone, carboxylic acid, ester, ether, amine, or amide, distinguishing confused pairs by oxygen placement.
Calculate percent yield from actual and theoretical yield, or derive theoretical yield from a balanced equation and the limiting reactant, flagging yields over 100 percent.
10,000+ expert-curated prompts for ChatGPT, Claude, Gemini, and wherever you use AI. Our extension helps any prompt deliver better results.