{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"moles-mass"},"result":{"entity_type":"calculator","id":"moles-mass","calculator_id":"moles-mass","canonical_url":"https://tttkmbb.com/chemistry/moles-mass","name":"Moles to Grams Calculator","title":"Moles to Grams Calculator – Convert Mass, Moles and Number of Molecules via Molar Mass","category":"chemistry","category_name":"Chemistry","tool_name":"convert_moles_and_mass","featured_mcp_tool":false,"description":"Converts between mass in grams and amount in moles using the molar mass (from a formula or given directly), and reports the number of molecules or formula units from the Avogadro constant. Any two of molar mass, mass and moles give the third.","use_when":"You need to convert grams to moles or moles to grams for a substance, count the molecules in a sample, or back out a molar mass from a measured mass and amount.","do_not_use_when":"You only need the molar mass of a formula (use molar-mass), or you want a concentration in mol/L (use molarity).","inputs":[{"name":"formula","label":"Chemical formula","type":"string","required":false,"description":"Chemical formula, e.g. NaCl, C6H12O6, Ca(OH)2 or CuSO4·5H2O (case-sensitive element symbols). Alternative to molar_mass_g_mol.","example":"H2O"},{"name":"molar_mass_g_mol","label":"Molar mass","type":"number","unit":"g/mol","required":false,"max":10000000,"exclusive_min":0,"description":"Molar mass of the substance; use instead of formula when it is already known."},{"name":"mass_g","label":"Mass","type":"number","unit":"g","required":false,"exclusive_min":0,"description":"Mass of the sample in grams. Leave empty to solve for it.","example":36.03},{"name":"moles","label":"Amount of substance","type":"number","unit":"mol","required":false,"exclusive_min":0,"description":"Amount in moles. Leave empty to solve for it."}],"outputs":[{"name":"molar_mass_g_mol","label":"Molar mass","type":"number","unit":"g/mol","decimals":3,"description":"Molar mass used or derived (mass_g / moles)."},{"name":"mass_g","label":"Mass","type":"number","unit":"g","decimals":4,"description":"Mass of the sample."},{"name":"moles","label":"Moles","type":"number","unit":"mol","decimals":6,"description":"Amount of substance."},{"name":"millimoles","label":"Millimoles","type":"number","unit":"mmol","decimals":3,"description":"Amount in millimoles."},{"name":"molecules","label":"Molecules / formula units","type":"number","decimals":0,"description":"moles × 6.02214076×10²³ (molecules for molecular substances, formula units for ionic compounds, atoms for elements)."},{"name":"molecules_scientific","label":"Molecules (scientific)","type":"string","decimals":4,"description":"The same count in scientific notation."},{"name":"solved_for","label":"Solved for","type":"string","decimals":4,"description":"Which quantity was computed: mass_g, moles or molar_mass_g_mol."}],"input_schema":{"type":"object","properties":{"formula":{"description":"Chemical formula, e.g. NaCl, C6H12O6, Ca(OH)2 or CuSO4·5H2O (case-sensitive element symbols). Alternative to molar_mass_g_mol.","type":"string","examples":["H2O"]},"molar_mass_g_mol":{"description":"Molar mass of the substance; use instead of formula when it is already known. Unit: g/mol.","type":"number","maximum":10000000,"exclusiveMinimum":0,"x-unit":"g/mol"},"mass_g":{"description":"Mass of the sample in grams. Leave empty to solve for it. Unit: g.","type":"number","exclusiveMinimum":0,"examples":[36.03],"x-unit":"g"},"moles":{"description":"Amount in moles. Leave empty to solve for it. Unit: mol.","type":"number","exclusiveMinimum":0,"x-unit":"mol"}},"additionalProperties":false},"output_schema":{"type":"object","properties":{"molar_mass_g_mol":{"description":"Molar mass used or derived (mass_g / moles). Unit: g/mol.","type":"number","x-unit":"g/mol"},"mass_g":{"description":"Mass of the sample. Unit: g.","type":"number","x-unit":"g"},"moles":{"description":"Amount of substance. Unit: mol.","type":"number","x-unit":"mol"},"millimoles":{"description":"Amount in millimoles. Unit: mmol.","type":"number","x-unit":"mmol"},"molecules":{"description":"moles × 6.02214076×10²³ (molecules for molecular substances, formula units for ionic compounds, atoms for elements).","type":"number"},"molecules_scientific":{"description":"The same count in scientific notation.","type":"string"},"solved_for":{"description":"Which quantity was computed: mass_g, moles or molar_mass_g_mol.","type":"string"}}},"formula":"moles = mass_g / molar_mass_g_mol; mass_g = moles × molar_mass_g_mol; molecules = moles × N_A (N_A = 6.02214076×10²³ mol⁻¹)","sources":[{"name":"NIST – CODATA internationally recommended values of the fundamental physical constants (Avogadro constant N_A = 6.02214076×10²³ mol⁻¹, exact)","url":"https://physics.nist.gov/cuu/Constants/index.html","type":"standard","retrieved_at":"2026-09-23"},{"name":"IUPAC – Atomic Weights of the Elements (2021 table with 2023 revisions, Queen Mary University of London mirror)","url":"https://iupac.qmul.ac.uk/AtWt/","type":"standard","retrieved_at":"2026-09-23"},{"name":"OpenStax Chemistry 2e – 3.1 Formula Mass and the Mole Concept","url":"https://openstax.org/books/chemistry-2e/pages/3-1-formula-mass-and-the-mole-concept","type":"textbook","retrieved_at":"2026-09-23"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"36.03 g of water","inputs":{"formula":"H2O","mass_g":36.03},"expected":{"molar_mass_g_mol":18.015,"moles":2,"millimoles":2000,"molecules":1.204428152e+24,"solved_for":"moles"},"url":"https://tttkmbb.com/api/v1/calculate/moles-mass?formula=H2O&mass_g=36.03"},{"name":"0.5 mol of CO2","inputs":{"formula":"CO2","moles":0.5},"expected":{"molar_mass_g_mol":44.009,"mass_g":22.0045,"molecules":3.01107038e+23,"solved_for":"mass_g"},"url":"https://tttkmbb.com/api/v1/calculate/moles-mass?formula=CO2&moles=0.5"}],"faq":[{"q":"How do I get the molar mass without a formula?","a":"Give molar_mass_g_mol directly, or give both mass_g and moles and the calculator returns molar_mass_g_mol = mass_g / moles (useful for identifying an unknown)."},{"q":"Does 'molecules' apply to ionic compounds?","a":"For NaCl or CaCO3 the count is formula units rather than discrete molecules; for a monatomic element it is the number of atoms."}],"tags":["moles to grams","grams to moles","mole conversion","avogadro number","number of molecules"],"related":[{"calculator_id":"molar-mass","reason":"Look up or check the molar mass and composition of the formula."},{"calculator_id":"molarity","reason":"Use the moles to compute a solution concentration."},{"calculator_id":"ideal-gas-law","reason":"Relate moles of a gas to its pressure, volume and temperature."}],"links":{"html":"https://tttkmbb.com/chemistry/moles-mass","markdown":"https://tttkmbb.com/chemistry/moles-mass.md","json":"https://tttkmbb.com/chemistry/moles-mass.json","api":"https://tttkmbb.com/api/v1/calculate/moles-mass","schema":"https://tttkmbb.com/api/v1/calculators/moles-mass","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-23"},"timestamp":"2026-09-23T23:31:58Z","next_actions":[{"tool":"run_calculator","calculator_id":"moles-mass","reason":"Run Moles to Grams Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/chemistry/moles-mass.md"}}