{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"molarity"},"result":{"entity_type":"calculator","id":"molarity","calculator_id":"molarity","canonical_url":"https://tttkmbb.com/chemistry/molarity","name":"Molarity Calculator","title":"Molarity Calculator – Solution Concentration in mol/L from Moles or Mass and Volume","category":"chemistry","category_name":"Chemistry","tool_name":"calculate_molarity","featured_mcp_tool":false,"description":"Computes molar concentration (mol/L) of a solution from the amount of solute (moles, or mass with a formula or molar mass) and the solution volume, or the moles and mass of solute needed to prepare a target molarity.","use_when":"You need the molarity of a solution from what was dissolved, or the grams of solute required for a given volume and target concentration.","do_not_use_when":"You are diluting an existing stock solution (use dilution), or you need a mass-based concentration such as % w/w, ppm or ppb (use mass-percent).","inputs":[{"name":"volume_l","label":"Solution volume","type":"number","unit":"L","required":true,"exclusive_min":0,"description":"Total volume of the solution in litres (250 mL = 0.25).","example":0.5},{"name":"moles","label":"Moles of solute","type":"number","unit":"mol","required":false,"exclusive_min":0,"description":"Amount of solute in moles. Takes precedence over mass_g."},{"name":"mass_g","label":"Mass of solute","type":"number","unit":"g","required":false,"exclusive_min":0,"description":"Mass of solute in grams; requires formula or molar_mass_g_mol.","example":5.844},{"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":"NaCl"},{"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":"target_molarity_mol_per_l","label":"Target molarity","type":"number","unit":"mol/L","required":false,"exclusive_min":0,"description":"Desired concentration; when given, the calculator returns the moles and mass of solute needed for volume_l instead (moles and mass_g are ignored)."}],"outputs":[{"name":"molarity_mol_per_l","label":"Molarity","type":"number","unit":"mol/L","decimals":6,"description":"Moles of solute per litre of solution (M)."},{"name":"millimolar","label":"Concentration","type":"number","unit":"mmol/L","decimals":4,"description":"Same concentration in millimoles per litre (mM)."},{"name":"moles","label":"Moles of solute","type":"number","unit":"mol","decimals":6,"description":"Amount of solute in the solution."},{"name":"mass_g","label":"Mass of solute","type":"number","unit":"g","decimals":4,"description":"Mass of solute (only when the molar mass is known)."},{"name":"molar_mass_g_mol","label":"Molar mass","type":"number","unit":"g/mol","decimals":3,"description":"Molar mass used (only when formula or molar_mass_g_mol was given)."},{"name":"mass_concentration_g_per_l","label":"Mass concentration","type":"number","unit":"g/L","decimals":4,"description":"Grams of solute per litre of solution (only when the molar mass is known)."},{"name":"volume_ml","label":"Volume","type":"number","unit":"mL","decimals":2,"description":"Solution volume in millilitres."},{"name":"solved_for","label":"Solved for","type":"string","decimals":4,"description":"molarity_mol_per_l when computing a concentration, mass_g when computing what to weigh for a target molarity."}],"input_schema":{"type":"object","properties":{"volume_l":{"description":"Total volume of the solution in litres (250 mL = 0.25). Unit: L.","type":"number","exclusiveMinimum":0,"examples":[0.5],"x-unit":"L"},"moles":{"description":"Amount of solute in moles. Takes precedence over mass_g. Unit: mol.","type":"number","exclusiveMinimum":0,"x-unit":"mol"},"mass_g":{"description":"Mass of solute in grams; requires formula or molar_mass_g_mol. Unit: g.","type":"number","exclusiveMinimum":0,"examples":[5.844],"x-unit":"g"},"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":["NaCl"]},"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"},"target_molarity_mol_per_l":{"description":"Desired concentration; when given, the calculator returns the moles and mass of solute needed for volume_l instead (moles and mass_g are ignored). Unit: mol/L.","type":"number","exclusiveMinimum":0,"x-unit":"mol/L"}},"additionalProperties":false,"required":["volume_l"]},"output_schema":{"type":"object","properties":{"molarity_mol_per_l":{"description":"Moles of solute per litre of solution (M). Unit: mol/L.","type":"number","x-unit":"mol/L"},"millimolar":{"description":"Same concentration in millimoles per litre (mM). Unit: mmol/L.","type":"number","x-unit":"mmol/L"},"moles":{"description":"Amount of solute in the solution. Unit: mol.","type":"number","x-unit":"mol"},"mass_g":{"description":"Mass of solute (only when the molar mass is known). Unit: g.","type":"number","x-unit":"g"},"molar_mass_g_mol":{"description":"Molar mass used (only when formula or molar_mass_g_mol was given). Unit: g/mol.","type":"number","x-unit":"g/mol"},"mass_concentration_g_per_l":{"description":"Grams of solute per litre of solution (only when the molar mass is known). Unit: g/L.","type":"number","x-unit":"g/L"},"volume_ml":{"description":"Solution volume in millilitres. Unit: mL.","type":"number","x-unit":"mL"},"solved_for":{"description":"molarity_mol_per_l when computing a concentration, mass_g when computing what to weigh for a target molarity.","type":"string"}}},"formula":"molarity = moles / volume_l, with moles = mass_g / molar_mass_g_mol; for a target: moles = target_molarity × volume_l and mass_g = moles × molar_mass_g_mol","method":"Molarity refers to the final volume of solution, not the volume of solvent added; volume changes with temperature, so molarity is usually stated at 20–25 °C.","sources":[{"name":"OpenStax Chemistry 2e – 3.3 Molarity","url":"https://openstax.org/books/chemistry-2e/pages/3-3-molarity","type":"textbook","retrieved_at":"2026-09-23"},{"name":"Wikipedia – Molar concentration","url":"https://en.wikipedia.org/wiki/Molar_concentration","type":"reference","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"}],"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":"5.844 g NaCl in 0.5 L","inputs":{"volume_l":0.5,"mass_g":5.844,"formula":"NaCl"},"expected":{"molarity_mol_per_l":0.2,"millimolar":200,"moles":0.1,"molar_mass_g_mol":58.44,"mass_concentration_g_per_l":11.688,"solved_for":"molarity_mol_per_l"},"url":"https://tttkmbb.com/api/v1/calculate/molarity?volume_l=0.5&mass_g=5.844&formula=NaCl"},{"name":"Prepare 250 mL of 0.1 M NaOH","inputs":{"volume_l":0.25,"target_molarity_mol_per_l":0.1,"formula":"NaOH"},"expected":{"moles":0.025,"mass_g":0.9999,"molar_mass_g_mol":39.997,"molarity_mol_per_l":0.1,"solved_for":"mass_g"},"url":"https://tttkmbb.com/api/v1/calculate/molarity?volume_l=0.25&target_molarity_mol_per_l=0.1&formula=NaOH"}],"faq":[{"q":"Is the volume the water added or the final solution?","a":"The final solution volume. Dissolve the solute in less solvent than needed, then make up to the mark in a volumetric flask."},{"q":"What if I know the mass but not the formula?","a":"Enter molar_mass_g_mol instead of formula. Without either, only moles can be used to compute molarity."}],"tags":["molarity","molar concentration","mol/L","solution preparation","how many grams for 1 M"],"related":[{"calculator_id":"dilution","reason":"Dilute the resulting stock to a lower concentration with C1V1 = C2V2."},{"calculator_id":"molar-mass","reason":"Check the molar mass used for the mass-to-moles conversion."},{"calculator_id":"moles-mass","reason":"Plain gram/mole conversion without a volume."}],"links":{"html":"https://tttkmbb.com/chemistry/molarity","markdown":"https://tttkmbb.com/chemistry/molarity.md","json":"https://tttkmbb.com/chemistry/molarity.json","api":"https://tttkmbb.com/api/v1/calculate/molarity","schema":"https://tttkmbb.com/api/v1/calculators/molarity","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-23"},"timestamp":"2026-09-23T23:30:56Z"}