A peptide dilution calculator answers a narrower question than a reconstitution calculator. Reconstitution starts from a dry vial and asks what concentration you get after adding a known volume of liquid. Dilution starts from a solution that already has a known concentration (a stock) and asks how much of it to take, and how much diluent to add, to reach a lower working concentration in a set final volume.
The math is one line. Most of the engineering is in what comes before it (unit normalization) and after it (validation, rounding, and knowing when one dilution step is the wrong plan). This post walks through a small TypeScript implementation, the checks I think it needs, and the test vectors I used.
It is the fourth post in a short series on calculator math. The first, the math behind a peptide reconstitution calculator, covered how vial mass and water volume produce a concentration. Dilution picks up from that number.
Disclosure: I work on Peptide Library, which is published by Superfime LLC. The calculator linked below is ours. Research use only: nothing here is dosing or medical advice. Every concentration and volume in this post is an arbitrary value chosen to exercise the code, not a suggested amount of anything.
The short answer
A dilution calculator should:
- Convert the stock concentration, target concentration and final volume into one consistent unit system before doing any arithmetic.
- Solve C1·V1 = C2·V2 for V1 (the stock volume), then compute diluent as V2 − V1.
- Reject impossible requests, the main one being a target concentration higher than the stock.
- Compare V1 to the smallest volume you can actually measure and suggest a serial dilution when a single step would need an unmeasurably small transfer.
- Report the dilution factor (C1/C2) so the result can be checked by hand.
Dilution vs. reconstitution
These get mixed up in search results and in calculator UIs, so it helps to separate them:
- Reconstitution: mass of dry material ÷ volume of liquid added = concentration. Inputs are a mass and a volume.
- Dilution: stock concentration × stock volume = target concentration × final volume. Inputs are two concentrations and a volume. No mass is involved, because the mass is already accounted for in the stock concentration.
If you don't yet know the stock concentration, that is a reconstitution problem first. The Peptide Library calculator works out that upstream number in the browser from vial mass and water volume, and the FAQ on calculating measurements after reconstitution explains the same relationship in plain language. Everything below assumes you already have a concentration you trust.
The equation and the unit problem
The relationship is conservation of the amount of solute: the amount you pull out of the stock is the amount that ends up in the final solution.
C1 · V1 = C2 · V2 V1 = C2 · V2 / C1 diluent = V2 − V1 factor = C1 / C2 The formula is unit-agnostic as long as C1 and C2 share a unit and V1 and V2 share a unit. That "as long as" is where real bugs come from. A form that accepts the stock in mg/mL and the target in mcg/mL, and then divides the raw numbers, is off by a factor of 1,000. So the first job is to normalize: I convert every concentration to mcg/mL and every volume to microliters (uL) internally, and only convert back for display.
Microliters as the internal volume unit is a deliberate choice. Dilution answers are often small (tens of microliters), and keeping them as whole-ish numbers in uL makes rounding behavior easier to reason about than juggling values like 0.0125 mL.
A typed implementation
type ConcUnit = "mg/mL" | "mcg/mL"; type VolUnit = "mL" | "uL"; const TO_MCG_PER_ML: Record<ConcUnit, number> = { "mg/mL": 1000, "mcg/mL": 1 }; const TO_UL: Record<VolUnit, number> = { mL: 1000, uL: 1 }; type Conc = { value: number; unit: ConcUnit }; type Vol = { value: number; unit: VolUnit }; type DilutionInput = { stock: Conc; // C1 target: Conc; // C2 finalVolume: Vol; // V2 minMeasurableUl?: number; // smallest volume you trust yourself to measure }; type DilutionResult = { stockVolumeUl: number; // V1 diluentVolumeUl: number; // V2 - V1 dilutionFactor: number; // C1 / C2 warnings: string[]; }; function positiveFinite(name: string, x: number): void { if (!Number.isFinite(x) || x <= 0) { throw new RangeError(`${name} must be a positive, finite number (got ${x})`); } } // Round to a fixed number of decimals without the 1.005 * 100 trap. function roundTo(x: number, decimals: number): number { const f = 10 ** decimals; return Math.round((x + Number.EPSILON * Math.abs(x)) * f) / f; } export function planDilution(input: DilutionInput): DilutionResult { const c1 = input.stock.value * TO_MCG_PER_ML[input.stock.unit]; const c2 = input.target.value * TO_MCG_PER_ML[input.target.unit]; const v2 = input.finalVolume.value * TO_UL[input.finalVolume.unit]; positiveFinite("stock concentration", c1); positiveFinite("target concentration", c2); positiveFinite("final volume", v2); if (c2 > c1) { throw new RangeError("target concentration is higher than the stock; adding diluent cannot concentrate a solution"); } const warnings: string[] = []; if (c2 === c1) warnings.push("target equals stock: no dilution needed"); const v1 = (c2 * v2) / c1; // C1·V1 = C2·V2 const diluent = v2 - v1; const factor = c1 / c2; const minUl = input.minMeasurableUl ?? 0; if (minUl > 0 && v1 < minUl) { warnings.push( `stock volume ${roundTo(v1, 2)} uL is below your ${minUl} uL measuring floor; consider a serial dilution` ); } return { stockVolumeUl: roundTo(v1, 3), diluentVolumeUl: roundTo(diluent, 3), dilutionFactor: roundTo(factor, 6), warnings, }; } // Split a large dilution factor into equal steps so each step's // transfer volume stays above a measuring floor. export function planSerial( totalFactor: number, stepVolumeUl: number, minMeasurableUl: number, maxSteps = 6 ): { steps: number; perStepFactor: number; transferUl: number } { positiveFinite("total dilution factor", totalFactor); positiveFinite("step volume", stepVolumeUl); positiveFinite("measuring floor", minMeasurableUl); if (totalFactor < 1) throw new RangeError("dilution factor must be >= 1"); for (let n = 1; n <= maxSteps; n++) { const perStep = totalFactor ** (1 / n); const transfer = stepVolumeUl / perStep; if (transfer >= minMeasurableUl) { return { steps: n, perStepFactor: roundTo(perStep, 4), transferUl: roundTo(transfer, 3) }; } } throw new RangeError(`no plan with <= ${maxSteps} steps keeps transfers above ${minMeasurableUl} uL`); } // Rough relative uncertainty of the final concentration, assuming each // step's relative errors are independent (combined in quadrature). export function serialRelUncertainty(stepRelUncertainties: number[]): number { const sumSq = stepRelUncertainties.reduce((s, u) => s + u * u, 0); return Math.sqrt(sumSq); } A few choices worth explaining:
- Validation throws instead of returning NaN.
positiveFiniterejects zero, negatives,NaNandInfinity. A dilution with a zero final volume or aNaNstock (the classic result ofparseFloat("")) should never render as a number on screen. - Target above stock is an error, not a warning. Adding diluent can only lower concentration. If C2 > C1, V1 comes out larger than V2 and diluent goes negative. Some calculators print that negative number. It is better to stop and say why.
- Equal concentrations are a warning. It is a valid but pointless request, and usually signals that the user picked the wrong unit in one dropdown.
- Rounding happens once, at the end. Intermediate values stay full precision. The
Number.EPSILONnudge inroundTohandles values like 1.005 that are stored slightly below their decimal form (see MDN on Number.EPSILON).
When one step is the wrong plan
Large dilution factors produce tiny stock volumes. Taking a 10 mg/mL stock down to 1 mcg/mL in 1 mL is a factor of 10,000, which works out to 0.1 uL of stock. The arithmetic is correct and the result is useless: few labs can measure 0.1 uL reliably with ordinary equipment.
That is why planDilution takes an optional minMeasurableUl. It is user input, not a constant, because the right floor depends on the equipment being used. When V1 falls below it, the calculator adds a warning instead of quietly printing the number.
The usual fix is a serial dilution: split the total factor into several smaller steps, each with a transfer volume you can measure. planSerial does the simplest version, equal steps. For a factor of 10,000 with 1,000 uL per step and a 10 uL floor, one step would need a 0.1 uL transfer, so it tries two steps of 100× each: transfer 10 uL into 990 uL of diluent, twice.
Equal steps aren't the only option. A UI might prefer round factors (10× then 1,000×) because they are easier to label and check. The point is that the calculator should notice the problem and propose something measurable.
Errors compound across steps
Serial dilution trades one unmeasurable step for several measurable ones, but every step carries its own volume uncertainty. If the relative uncertainties of the steps are independent, the usual first approximation is to combine them in quadrature, which is what serialRelUncertainty does. Two steps at 1% each give roughly 1.4% overall, not 1%. NIST's Technical Note 1297 covers how combined standard uncertainty is evaluated and reported. This is a rough model (it ignores correlated errors, such as using the same miscalibrated pipette for every step), so I show it as context, not as a guarantee.
Test vectors
These ran under Node 24 with --experimental-strip-types:
import { planDilution, planSerial, serialRelUncertainty } from "./dilution.ts"; import assert from "node:assert/strict"; // 5 mg/mL -> 1 mg/mL, 2 mL final: 400 uL stock + 1600 uL diluent, factor 5 let r = planDilution({ stock: { value: 5, unit: "mg/mL" }, target: { value: 1, unit: "mg/mL" }, finalVolume: { value: 2, unit: "mL" } }); assert.equal(r.stockVolumeUl, 400); assert.equal(r.diluentVolumeUl, 1600); assert.equal(r.dilutionFactor, 5); // Mixed units: 2 mg/mL -> 250 mcg/mL, 1000 uL final: 125 + 875 uL, factor 8 r = planDilution({ stock: { value: 2, unit: "mg/mL" }, target: { value: 250, unit: "mcg/mL" }, finalVolume: { value: 1000, unit: "uL" } }); assert.equal(r.stockVolumeUl, 125); assert.equal(r.diluentVolumeUl, 875); assert.equal(r.dilutionFactor, 8); // Factor 10,000 in 1 mL: 0.1 uL stock, flagged against a 10 uL floor r = planDilution({ stock: { value: 10, unit: "mg/mL" }, target: { value: 1, unit: "mcg/mL" }, finalVolume: { value: 1, unit: "mL" }, minMeasurableUl: 10 }); assert.equal(r.stockVolumeUl, 0.1); assert.equal(r.warnings.length, 1); // Serial plan: two 100x steps with 10 uL transfers assert.deepEqual(planSerial(10000, 1000, 10), { steps: 2, perStepFactor: 100, transferUl: 10 }); // Validation assert.throws(() => planDilution({ stock: { value: 1, unit: "mg/mL" }, target: { value: 2, unit: "mg/mL" }, finalVolume: { value: 1, unit: "mL" } }), RangeError); assert.throws(() => planDilution({ stock: { value: NaN, unit: "mg/mL" }, target: { value: 1, unit: "mg/mL" }, finalVolume: { value: 1, unit: "mL" } }), RangeError); // Two independent 1% steps -> ~1.41% assert.ok(Math.abs(serialRelUncertainty([0.01, 0.01]) - 0.014142) < 1e-5); The mixed-unit case is the one I would write first. It catches the most common real bug (forgetting the mg-to-mcg factor) and it is easy to verify by hand: 2 mg/mL is 2,000 mcg/mL, and 2,000 ÷ 250 = 8.
Display rules
- Show the unit on every number, and show the dilution factor next to the volumes so the answer can be sanity-checked.
- Print stock volume and diluent volume as separate lines. "Take 125 uL of stock, add 875 uL of diluent, final 1,000 uL" is harder to misread than a single number.
- Switch display units sensibly. 0.1 uL and 1,600 uL are both easier to read than 0.0001 mL and 1.6 mL in some contexts and harder in others; pick one rule and apply it consistently.
- Surface warnings next to the result, not in a toast that disappears.
What this math can't tell you
The calculator assumes the stock concentration is right, the volumes are measured accurately, mixing is complete, and the volumes add (a reasonable approximation for dilute aqueous solutions, not an exact law). It also assumes the solute stays in solution. For peptides, that last assumption is worth questioning at low concentrations: Kristensen and colleagues used HPLC to show that some cationic peptides can adsorb rapidly to glass and plastic container walls, with 90% or more lost from solution in some conditions (PLOS ONE, 2015). A calculator can't model that; it is a lab variable, measured by analytical methods, not arithmetic.
The bigger distinction is between lab math and clinical questions. A dilution calculator is a bookkeeping tool for solutions at the bench. Whether any concentration or amount of a peptide is appropriate, effective or safe in people is a clinical question, answered (where it is answered at all) by controlled human studies and qualified clinicians. Many peptides discussed online have only cell or animal data behind them, and a clean calculator output doesn't change that. For unit and rounding conventions in reported values, NIST's Guide for the Use of the International System of Units (SP 811) is a good reference.
Wrapping up
C1·V1 = C2·V2 is the easy part of a peptide dilution calculator. The useful parts are normalizing units before dividing, refusing requests that can't be made by adding diluent, comparing the answer against what can actually be measured, and offering a serial plan when it can't. If you build one, start your tests with a mixed-unit case and a large-factor case.
Research use only. Not medical advice. Peptide Library is published by Superfime LLC.

