Stock solution mass
calc_molarity
Works out the mass to weigh for a stock solution, or the volume or concentration a weighed mass gives.
- Runs
- On the server
- Level
- Checked against a reference: Python's exact rational arithmetic
What it is
Required: mode (mass, volume, concentration). Stock solutions from a formula weight: computes the mass to weigh (m = C·V*FW/purity), the volume for a weighed mass, or the concentration a mass gives. Weight comes from a molecular formula (exact CIAAW 2021 sum) or a typed vial weight (typed wins). With a formula and lighter parent formula, gives parent-equivalent mass and salt fraction; a parent not lighter is withheld, and values outside double range are refused.
Field: Solutions. It is the same calculation as Drybench Calc, called by an AI assistant through the server.
What it does
You give
mode(required): Calculation mode ('mass', 'volume', or 'concentration').concentration: Target concentration (required in mass and volume modes).volume: Final volume (required in mass and concentration modes).mass: Mass weighed (required in volume and concentration modes).formula: Molecular formula of what is weighed (salt or hydrate included), e.g. 'C29H31N7O.CH4O3S'.parentFormula: Optional formula of the parent compound, for the parent-equivalent mass.
and 2 more, listed below
Asked with
- mode
- mass
- concentration
- 10 mM
- volume
- 10 mL
- formula
- C29H31N7O.CH4O3S
- parentFormula
- C29H31N7O
- purity
- 99.5 %
It answered (computed)
- mode
- mass
- mass
- 0.05927 g
- parentMass
- 0.04961 g
- formulaWeight
- 589.7 g/mol
Computed by this tool when the page was built. The steps between are not recorded, so this is not a worked example. The reply carries more values than are shown here.
Limits
- The compound dissolves completely; the purity's impurities carry none of the compound.
- The material has the isotopic composition of normal terrestrial material, which the standard atomic weights describe; an enriched or unusual sample has a different mass.
- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.
It will not answer when
- Neither a formula nor a formula weight is given.
- The concentration or volume the mode reads is missing (status incomplete).
- Modes volume and concentration without the mass weighed (status incomplete).
- Purity at or below 0, or above 100 percent (status incomplete).
Every input, with its units8 inputs
mode(required): Calculation mode ('mass', 'volume', or 'concentration').concentration: Target concentration (required in mass and volume modes).volume: Final volume (required in mass and concentration modes).mass: Mass weighed (required in volume and concentration modes).formula: Molecular formula of what is weighed (salt or hydrate included), e.g. 'C29H31N7O.CH4O3S'.parentFormula: Optional formula of the parent compound, for the parent-equivalent mass.formulaWeight: Formula weight from the vial or certificate; wins over formula.purity: Purity percentage in (0, 100]; defaults to 100 %.
Every refusal, with its code10 refusals
| Code | When |
|---|---|
MISSING_ARGUMENT | Neither a formula nor a formula weight is given. |
needs: inputs | The concentration or volume the mode reads is missing (status incomplete). |
needs: mass | Modes volume and concentration without the mass weighed (status incomplete). |
needs: purity | Purity at or below 0, or above 100 percent (status incomplete). |
INVALID_UNIT | A quantity's unit is not one the mode reads. |
OUT_OF_RANGE | A concentration, volume or mass given at or below zero, in any mode (since 1.1.0; 1.0.0 answered a negative concentration with a negative mass). |
INVALID_FORMULA | The formula or the parent formula cannot be read by formula-mass; since 1.1.3, through formula-mass@1.3.0, a formula starting with a digit (13CH4) among them, which 1.1.2 weighed as 13 × CH4. |
magnitude | The mass, volume, concentration or parent-equivalent mass is outside the normal range of a double (status refused, no number; since 1.1.2: 1.1.1 gave 0 g for a true 1e-200 g). |
INVALID_FORMULA | The formula cannot be read: an unknown or misspelt element; an element with no standard atomic weight (Tc, Pm, Po onward); a count, multiplier or charge starting with 0; a zero count, multiplier or written "+0"/"-0"; a count or weight beyond exact integer range; one element with a count and a bare sign ("Fe3+"), refused as ambiguous with "Fe+3" suggested; a formula starting with a digit ("13CH4", "2H2O"), refused at position 0 since 1.3.0 (1.2.0 read the number as a multiplier of the first part). |
MISSING_ARGUMENT | No formula is given. |
The calculation
2 methods, each with its equations, constants and worked example.
Equation 1
| Symbol | Meaning |
|---|---|
m | mass to weigh, g |
C | wanted concentration, mol/L |
V | final volume the solution is made up to, L |
M | formula weight of the form weighed, salt and hydrate included, g/mol |
p | purity, the mass fraction of the weighed form that is the compound, 1 |
Equation 2
| Symbol | Meaning |
|---|---|
V | volume to make up to, L |
m | mass actually weighed, g |
Equation 3
| Symbol | Meaning |
|---|---|
C | concentration a weighed mass gives in the volume, mol/L |
Equation 4
shortfall = 1 − M_parent / M
| Symbol | Meaning |
|---|---|
m_parent | mass of the parent compound in the weighed mass of a salt or hydrate, g |
M_parent | formula weight of the parent compound, g/mol |
shortfall | the fraction of amount lost by weighing the parent's mass of the salt by mistake, 1 |
Conventions
- Convention chosen by this project: when both are given, a formula weight typed from the vial is used in place of the weight computed from a formula. Using the formula's weight would change the mass by the difference between the two, for example the water of a hydrate the formula leaves out.
A definition, not a model: the equation states what the quantity means. A different convention gives a different number.
Worked example
Worked example: one case of stock-salt-purity@1.1.3, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.
Inputs
- mode = mass
- concentration = 100 mM
- volume = 250 mL
- formula = CaCl2·2H2O
- purityPercent = 99
Steps
- units: units = C = 0.100 mol/L; V = 0.250 L; p = 0.99, from C = 100 mM, V = 250 mL, purity = 99 %.
- M = 147.008 g/mol, from formula = CaCl2·2H2O; taken from formula-mass@1.2.0, which has a page of its own.
- n: n = C·V = 0.025 mol, from C = 0.100, V = 0.250.
- m: m = n·M / p = 3.7123232 g, from n = 0.025, M = 147.008, p = 0.99; gives result.massG.
The working, as the case writes it:
n = C·V
m = n·M / p, with p the mass fraction of the weighed form.
Answer
result.massG = 3.7123232 g
Where these values came from: our own exact-arithmetic script and a hand-worked case.
The build has not run this example through the tool.
over every element i in the formula, where nᵢ is the element's count summed over the formula's groups and adducts, each multiplied by its multiplier.
| Symbol | Meaning |
|---|---|
M | formula weight of the formula as written, salt and hydrate included, g/mol |
n_i | number of atoms of element i in one formula unit, 1 |
A_r(i) | the element's abridged standard atomic weight, used as g/mol, g/mol |
| Constant | Value | From |
|---|---|---|
Abridged standard atomic weights, 84 elements; an element whose weight is an interval takes the value CIAAW's abridged table prints A_r | a table of values, part of the method | Source 1 |
Conventions
- Convention chosen by this project: an ASCII '.' with a digit on each side is read as an adduct, never a decimal count, and the reply warns. CuSO4.5H2O is read as CuSO4·5H2O, 249.68 g/mol; read as a decimal, it would be 185.62 g/mol.
A definition, not a model: the equation states what the quantity means. A different convention gives a different number.
Worked example
Worked example: one case of formula-mass@1.3.0, from its inputs through each step to the answer. Values are written as a person writes them; the working carries more digits, so your own figure may differ in the last digit shown.
Inputs
- formula = CaCl2·2H2O
Steps
- count: counts = Ca 1, Cl 2, H 4, O 2 (the hydrate's 2 multiplies H2O), from formula = CaCl2·2H2O.
- ca: sum = 40.078 g/mol, from n = 1, A_r(Ca) = 40.078.
- cl: sum = 70.9 g/mol, from n = 2, A_r(Cl) = 35.45.
- h: sum = 4.032 g/mol, from n = 4, A_r(H) = 1.0080.
- o: sum = 31.998 g/mol, from n = 2, A_r(O) = 15.999.
- M: sum = 147.008 g/mol, from terms = ca,cl,h,o; gives result.formulaWeightGPerMol.
The working, as the case writes it:
M = Σ nᵢ·A_r(i), each A_r as CIAAW prints it.
Answer
result.formulaWeightGPerMol = 147.008 g/mol
Where these values came from: our own exact-arithmetic script and a hand-worked case; CIAAW, Abridged Standard Atomic Weights 2024 (ciaaw.org), read 11 November 2026.
The build has not run this example through the tool.
Sources
IUPAC Commission on Isotopic Abundances and Atomic Weights (CIAAW). Abridged Standard Atomic Weights 2024.
Used for: Formula weight from the molecular formula. At: table Abridged Standard Atomic Weights 2024, section column "Abridged Standard Atomic Weight".
Read in full, 11 November 2026
Cited, not read
Prohaska T, Irrgeher J, Benefield J, et al. Standard atomic weights of the elements 2021 (IUPAC Technical Report). Pure Appl Chem 2022;94:573-600.
Used for: Formula weight from the molecular formula.
The publisher's site (degruyter.com) answered 202 with an empty body to a plain request on 11 November 2026; the session does not work round a bot check. Listed for a person to read.
Not read
How it is checked
- Level
Checked against a reference, the lowest of its 2 methods.
- Checked against
Stock mass with salt form, hydrate and purity: Python's exact rational arithmetic (fractions.Fraction) to nine significant figures on 31 fixtures (6 October 2026).
Formula weight from the molecular formula: A CIAAW 2021 sum in Python's decimal module, with the formula from RDKit 2026.03.6, exactly on 58 fixtures (6 October 2026). The refusals and the decimal-dot warning added in 1.2.0 are unit-tested, not checked against an independent reader (10 November 2026).
- Cases
Stock mass with salt form, hydrate and purity: No case set is linked to this version.
Formula weight from the molecular formula: No case set is linked to this version.
- Hostile inputs
Sent 61 malformed, extreme and misspelt calls. None broke it, and every call with an undeclared argument, or with text in place of a number or a true/false value, was declined with a reason.
Run 2026-11-12-2 of 12 November 2026, server 0.11.0.
- Same answer
Called twice and with its arguments in another order, it gave the same result; rewriting its quantities in other units changed no number (5 rewrites).
Run 2026-11-12-2 of 12 November 2026, server 0.11.0.
- Not checked
Stock mass with salt form, hydrate and purity: The 1.1.0 refusals and parent rule are unit-tested and have two hand cases (a negative concentration; NaCl with parent KCl), not a published case set. No published case set names stock-salt-purity@1.1.0.
Formula weight from the molecular formula: No published case set names formula-mass@1.3.0. The 58 cases of stored reference values (lab-calculators 0.1.0 and 0.2.0) name no method version, and stored reference values (0.11.0) is for formula-mass@1.1.0; neither is tied to this version yet.
What was not checked, in fullfrom the method records
Stock mass with salt form, hydrate and purity
- The 1.1.0 refusals and parent rule are unit-tested and have two hand cases (a negative concentration; NaCl with parent KCl), not a published case set.
- No published case set names stock-salt-purity@1.1.0.
- Its 31 cases in stored reference values name the method by an older label ("mass-for-molarity") and are not tied to this version yet.
- The defaults of mode (mass) and purity (100 percent) are not echoed as unstated in the reply (the audit's finding 7).
- Dried-basis purity and water content are not handled: the method takes purity as given.
- No case runs this method through the served tool on its production runtime.
Formula weight from the molecular formula
- No published case set names formula-mass@1.3.0.
- The 58 cases of stored reference values (lab-calculators 0.1.0 and 0.2.0) name no method version, and stored reference values (0.11.0) is for formula-mass@1.1.0; neither is tied to this version yet.
- The change notes for 1.2.0 and 1.3.0 say every published mass is unchanged (none of those formulas starts with a digit); tying the sets needs a re-run tool-case file under this project's ruling of 11 November 2026, section S6.
- The 1.3.0 refusal of a formula starting with a digit is unit-tested and has two hand cases (13CH4, 2H2O), not a published case set.
- The 58 cases' expected values are CIAAW sums in Python's decimal module over formulas taken from RDKit 2026.03.6: RDKit supplied the formula, not the mass.
- The 1.2.0 refusals and the decimal-dot warning are unit-tested only, not checked against an independent formula reader.
- The IUPAC 2021 report (Prohaska et al.
- 2022) was not read: its publisher's site refused a plain request.
- The table was checked element by element against CIAAW's abridged table page instead, on 11 November 2026: all 84 values agree.
- No case runs this method through the served tool on its production runtime.
What this project's records still lack2 things
- A run of the worked example through the tool for both methods.
- A case set linked to this version for both methods.
Cite a number from this toolthe cite line
Every reply carries a cite line naming the tool, the server version, each method with its version and level, and the receipt. Quote it with any number taken from the reply.
calc_molarity, server 1.0.0; stock-salt-purity@1.1.3 (Checked against a reference); formula-mass@1.3.0 (Checked against a reference); receipt 481c7501e7c9/8e4073de8f59; methods https://www.drybench.com/methods/calculators; page https://www.drybench.com/methods/tools/calc-molarity. Quote this line with any number taken from this reply.Changes to its methods2 changes
- 25 November 2026, formula-mass@1.3.0: In 1.3.0 a formula starting with a digit is now refused; every other mass is unchanged. The refusal gives position 0 and both readings: an isotope label is not read, and a count of molecules is not a formula. A multiplier after a middle dot, a period or an asterisk (CuSO4·5H2O, CaCl2·2H2O) is read as before, and every formula 1.2.0 refused keeps its refusal and message.
- 25 November 2026, stock-salt-purity@1.1.3: In 1.1.3, through formula-mass 1.3.0, a formula starting with a digit is now refused (INVALID_FORMULA at position 0); every other mass is unchanged.