Pure calculation functions from Molicheck. There is no user interface in this package. You pass numbers and strings in, and you get a result back. Nothing is uploaded.
The same formulas are available in the browser:
- Molarity (
/molarity) - Serial dilution (
/serial-dilution) - C1V1 (
/c1v1) - Primer Tm (
/primer-tm) - Ligation (
/ligation) - DNA copy number (
/dna-copy-number) - PCR master mix (
/pcr-master-mix)
You need Node.js 22.19 or newer, and pnpm.
pnpm install
pnpm test
pnpm typecheckpnpm test runs Vitest. pnpm typecheck runs the TypeScript compiler with strict and does not emit JavaScript.
Mass, volume, and concentration displays use 4 significant figures, with ties rounded half away from zero. Primer Tm is shown to 1 decimal place with the same tie rule.
src/lib/molarity.ts solves for concentration. src/lib/molarity-solve.ts solves for mass or for volume. The three forms are the same equation.
c (mol/L) = mass (g) / (molecular weight (g/mol) × volume (L))
mass (g) = c (mol/L) × molecular weight (g/mol) × volume (L)
volume (L) = mass (g) / (molecular weight (g/mol) × c (mol/L))
Mass may be entered as g, mg, µg, or ng. Volume may be entered as L, mL, or µL. Concentration may be entered as mol/L, mmol/L, µmol/L, or nmol/L. Each unit is scaled by an exact power of ten before the equation, and scaled back for display.
src/lib/serial-dilution.ts builds one row for each step i from 1 to N.
concentration_i = starting concentration / (dilution factor ^ i)
transfer volume = final volume / dilution factor
diluent volume = final volume − transfer volume
The dilution factor must be greater than 1. Transfer volume is the same on every row. Diluent volume is the same on every row, and it is not compared with the pipette minimum. A row is marked only when the transfer volume is strictly below the minimum you enter.
src/lib/c1v1.ts solves one step of a single dilution. Any three of C1, V1, C2, and V2 are inputs. The fourth is the unknown.
C1 × V1 = C2 × V2
diluent volume = V2 − V1
Both concentrations must be the same kind: molar (mol/L and its smaller units) or mass per volume (g/L, mg/L, µg/L, ng/L). They are not mixed. A dilution requires C2 to be lower than C1 after both are in the base unit. The stock volume V1 is marked only when it is strictly below the minimum pipette volume you enter.
src/lib/primer-tm.ts returns one nearest-neighbor melting temperature in °C for a DNA oligo (A, C, G, T). A sequence shorter than 10 bases does not return a Tm.
The parameter table is the unified oligonucleotide set from SantaLucia, Proc. Natl. Acad. Sci. USA 1998;95:1460–1465 (doi:10.1073/pnas.95.4.1460). Enthalpy is in kcal/mol and entropy is in cal/(mol·K). The gas constant R is 1.987 cal/(mol·K).
Tm (°C) = 1000 × ΔH / (ΔS + R × ln(C)) − 273.15
C is the strand concentration in mol/L. A blank primer concentration uses 250 nM, so C = 250 × 10⁻⁹ mol/L. The complementary strand is ignored (its concentration is 0). That is the primer-in-excess case, not the equal-strand case. Self-complementarity is off, so there is no symmetry term.
A blank monovalent field uses 50 mM. With magnesium blank or 0, salt correction is the SantaLucia 1998 entropy term. [Na+] below is the monovalent concentration in mol/L, and N is the number of bases.
ΔS = ΔS_nearest_neighbor + 0.368 × (N − 1) × ln([monovalent])
When the entered Mg2+ is greater than 0, and the entered dNTP is lower than that Mg2+, the unsalted nearest-neighbor Tm is corrected with Owczarzy et al., Biochemistry 2008;47:5336–5353 (doi:10.1021/bi702363u).
Tm_corrected = 1 / (1 / Tm_unsalted_kelvin + correction) − 273.15
Free magnesium is the total Mg2+ when dNTP is 0. When dNTP is present and lower than Mg2+, free Mg2+ is the positive root of the binding quadratic with Ka = 3×10⁴ M⁻¹. If the entered dNTP is at least the entered Mg2+, and Mg2+ is above 0, free Mg2+ is treated as not positive. The function then uses the monovalent SantaLucia path above, and does not invent a negative magnesium term.
Let R_ion = √[Mg2+] / [monovalent], with both concentrations in mol/L. When R_ion is below 0.22, the 2008 decision tree uses the monovalent equation from Owczarzy et al., Biochemistry 2004;43:3537–3554 (doi:10.1021/bi034621r). fGC is the fraction of G and C.
correction = (4.29 × fGC − 3.95) × 10⁻⁵ × ln([monovalent]) + 9.40 × 10⁻⁶ × (ln([monovalent]))²
Otherwise the 2008 magnesium equation is used. a, b, c, d, e, f, g start at 3.92, −0.911, 6.26, 1.42, −48.2, 52.5, 8.31. For 0.22 ≤ R_ion < 6 those a, d, and g values are adjusted as in the 2008 paper. [Mg2+] in the logarithm is the free concentration.
correction = 10⁻⁵ × (a + b × ln[Mg2+] + fGC × (c + d × ln[Mg2+]) + (e + f × ln[Mg2+] + g × (ln[Mg2+])²) / (2 × (N − 1)))
A suggested annealing temperature is the lower of the forward and reverse Tm values, minus 5 °C. With no reverse primer, it is that one Tm minus 5 °C. It is a starting point, not a polymerase-kit setpoint. If the two unrounded Tm values differ by more than 5 °C, the result still includes the annealing temperature and also a short warning.
src/lib/ligation.ts converts a vector mass into the insert mass for a chosen insert:vector molar ratio. Lengths are base pairs. Picomoles come from src/lib/dsdna.ts.
insert ng = vector ng × ratio × insert bp / vector bp
pmol = ng × 1000 / (bp × 650 g/mol)
fmol = pmol × 1000
If you also enter an insert stock in ng/µL, the insert volume is insert ng divided by that stock. That volume is marked only when it is strictly below the minimum pipette volume you enter.
src/lib/dsdna.ts converts double-stranded DNA mass and length. src/lib/dna-copy-number.ts converts among nanograms, copies, and picomoles. One base pair is 650 g/mol. There is no end correction. The Avogadro constant is the exact SI defining value, 6.02214076×10²³ per mole.
pmol = ng × 1000 / (bp × 650)
ng = pmol × bp × 650 / 1000
copies = pmol × 6.02214076×10²³ / 10¹²
copies = ng × 6.02214076×10²³ / (bp × 650 × 10⁹)
An optional solution volume adds copies per microlitre. The length must be a positive whole number of base pairs. Single-stranded DNA and RNA are not accepted.
src/lib/pcr-master-mix.ts turns a per-reaction recipe into microlitres, then scales the master mix.
For dNTPs, primers, and MgCl2, both concentrations are molar and are converted to mol/L first:
µL per reaction = reaction µL × final concentration / stock concentration
The buffer is a fold concentration, not a molar unit:
buffer µL = reaction µL × final X / stock X
Polymerase does not scale with the reaction volume:
polymerase µL = units per reaction / (stock units per µL)
Water fills whatever is left:
water µL = reaction µL − (every other per-reaction µL)
Components that go into the master mix are multiplied by the number of reactions and by the overage:
mix reactions = reactions × (100 + overage percent) / 100
total µL = µL per reaction × mix reactions
Template left out of the mix is multiplied by the reaction count only. The volume to dispense into each tube is the reaction volume minus any template added separately. A component whose final concentration is above its stock, or whose volumes no longer fit in the reaction, returns an error instead of a table.
- One DNA base pair is 650 g/mol of double-stranded DNA. Ends are not corrected. This is the average written in NEB protocol E1202.
- The Avogadro constant is 6.02214076×10²³ mol⁻¹.
- A blank primer concentration is 250 nM. The complement is ignored, so the primer is in excess.
- A blank monovalent salt is 50 mM. The field is the total of Na+ and K+.
- Magnesium left blank or set to 0 keeps the SantaLucia 1998 entropy correction. Magnesium above 0, with dNTP lower than that magnesium, uses Owczarzy 2008. dNTP at least as high as that magnesium falls back to the 1998 path.
- SantaLucia J Jr. A unified view of polymer, dumbbell, and oligonucleotide DNA nearest-neighbor thermodynamics. Proc. Natl. Acad. Sci. USA. 1998;95(4):1460–1465. doi:10.1073/pnas.95.4.1460
- Owczarzy R, Moreira BG, You Y, Behlke MA, Walder JA. Predicting stability of DNA duplexes in solutions containing magnesium and monovalent cations. Biochemistry. 2008;47(19):5336–5353. doi:10.1021/bi702363u
- Owczarzy R, You Y, Moreira BG, Manthey JA, Huang L, Behlke MA, Walder JA. Effects of sodium ions on DNA duplex oligomers: improved predictions of melting temperatures. Biochemistry. 2004;43(12):3537–3554. doi:10.1021/bi034621r. Used only for the R_ion < 0.22 branch of the 2008 correction.
Serial dilution, C1V1, ligation, and PCR master mix can compare a volume with a minimum you type in. The comparison is strict. Both volumes are converted to litres, and the result is marked only when the calculated volume is smaller than the minimum. An equal volume is not marked. Leaving the minimum blank skips the comparison. This package does not store a default threshold.
src/lib/decimal.ts exact fractions and significant figures
src/lib/units.ts unit scales, display ladders, pipette comparison
src/lib/molarity.ts concentration
src/lib/molarity-solve.ts mass or volume
src/lib/serial-dilution.ts dilution series
src/lib/c1v1.ts one dilution step
src/lib/primer-tm.ts primer Tm
src/lib/dsdna.ts dsDNA ng and pmol
src/lib/dna-copy-number.ts copies
src/lib/ligation.ts insert:vector
src/lib/pcr-master-mix.ts master-mix volumes
tests/ Vitest checks for those modules
MIT. © 2026 Molicheck. See LICENSE.