{"uid":"cap_RAm-BxJw_wE6bfOGVf7z4","slug":"chemistry-calculators-empirical-formula-from-composition-1b7d0b5c","name":"Chemistry Calculators: Empirical Formula from Composition","description":"Empirical formula from percent or gram composition by element, and the molecular formula if you give the molar mass.","url":"https://chemistry-calc.x402tookit.com/empirical-formula?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["composition"],"properties":{"molarMass":{"type":"number","description":"Known molar mass in g/mol to find the molecular formula"},"composition":{"type":"string","description":"element:percent (or grams) pairs, e.g. C:40.0,H:6.7,O:53.3"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"source":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"inputSum":{"type":["null","number"]},"disclaimer":{"type":["null","string"]},"moleRatios":{"type":["null","object"],"properties":{"C":{"type":["null","number"]},"H":{"type":["null","number"]},"O":{"type":["null","number"]}}},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"subscripts":{"type":["null","object"],"properties":{"C":{"type":["null","number"]},"H":{"type":["null","number"]},"O":{"type":["null","number"]}}},"multiplierUsed":{"type":["null","number"]},"empiricalFormula":{"type":["null","string"]},"molecularFormula":{},"molecularMultiplier":{},"empiricalMassGPerMol":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_LIOoStNX6jm9PsY1d6doS","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the empirical formula (and optionally molecular formula) of a compound from its elemental percent or gram composition","exampleAgentPrompt":"What is the empirical formula for a compound that is 40.0% carbon, 6.7% hydrogen, and 53.3% oxygen by mass? Also give me the molecular formula if the molar mass is 180.16 g/mol.","exampleUseCases":[{"title":"Identify unknown compound from combustion analysis","prompt":"I ran a combustion analysis and got 52.2% carbon, 13.0% hydrogen, and 34.8% oxygen by mass. What's the empirical formula for this compound?"},{"title":"Derive molecular formula from elemental analysis","prompt":"A compound is 38.7% carbon, 9.7% hydrogen, and 51.6% oxygen, and its molar mass is 62 g/mol. What are both the empirical and molecular formulas?"},{"title":"Check formula from gram composition lab data","prompt":"I have a sample with 2.4 grams of carbon, 0.4 grams of hydrogen, and 3.2 grams of oxygen. What empirical formula does that give me?"}],"resultDescription":"Returns the empirical formula string, subscripts per element, mole ratios, multiplier used to reach whole-number ratios, empirical molar mass in g/mol, and — if molar mass was provided — the molecular formula and the molecular multiplier. Also includes the input composition sum and any validation notes.","failureModes":["Missing or malformed composition string returns an error — each element must be formatted as 'Element:value' pairs separated by commas","Composition values that don't sum close to 100% may trigger a warning or degraded flag","Unrecognized element symbols in the composition string will fail validation","Non-numeric molar mass value causes a parameter error","Molar mass provided but incompatible with computed empirical mass may yield null molecular formula"],"whenToPreferThis":"Use this endpoint when you need to convert elemental percent or gram composition data into an empirical or molecular chemical formula. Ideal for analytical chemistry workflows, lab data interpretation, homework assistance, or any agent pipeline that needs to identify a compound from its elemental breakdown. Prefer this over manual ratio calculation whenever mole ratio reduction and formula derivation are needed programmatically.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T00:35:49.792Z","isFirstParty":false,"canonicalSlug":"chemistry-calculators-empirical-formula-from-composition-1b7d0b5c"}