Snipget.ai

Compute exact mass and m/z

Exact
chemistry_exact_mass

Deterministic and authoritative — the canonical answer for this input.

Compute a molecular formula's mass-spectrometry masses, fully locally (no upstream call): average mass, neutral monoisotopic mass, nominal (integer) mass, and — for a charged species — the ion mass and m/z. Specify a named adduct ([M+H]+, [M+Na]+, [M-H]-, ...) or a bare charge (mutually exclusive — the adduct defines the charge; passing both returns an invalid-input result); both apply the electron-mass correction. Unlike chemistry_formula_weight (average molar mass), this is the exact mass for MS work. Unparseable formula, unknown element, or unknown adduct -> confidence 0.0. Batch via chemistry_exact_mass_batch. Charges 1 cost_unit.

Parameters

formulastringrequired

The molecular formula (e.g. 'C6H12O6', 'Ca(OH)2').

chargeintegeroptional

Bare ionic charge (e.g. 1 for the EI molecular ion [M]+). Mutually exclusive with `adduct` — a nonzero charge alongside an adduct is rejected as ambiguous. Default 0 (neutral).

adductstringoptional

Named LC-MS adduct: [M+H]+, [M+Na]+, [M+K]+, [M+NH4]+, [M-H]-, [M+Cl]-, [M+2H]2+, [M-2H]2-. Determines charge + mass shift; m/z is reported. Default null (neutral).

precisionintegeroptional

Decimal places for the reported masses. Default 6 (clamped 0-10).

Call it

curl -X POST https://api.snipget.ai/v1/chemistry/exact-mass \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"formula":"C6H12O6","adduct":"[M+H]+"}'

The Batch tab sends up to 1000 inputs in one call via /v1/chemistry/exact-mass/batch.

Example response

{
  "input": "C6H12O6",
  "formula": "C6H12O6",
  "is_valid": true,
  "charge": 1,
  "adduct": "[M+H]+",
  "average_mass": 180.156162,
  "element_counts": {
    "C": 6,
    "H": 12,
    "O": 6
  },
  "monoisotopic_mass": 180.06339,
  "nominal_mass": 180,
  "ion_mass": 181.070666,
  "mz": 181.070666
}

FAQ

What is this for?

It computes the mass-spectrometry masses for a formula: average mass, monoisotopic mass, nominal mass, and for a charged species the ion mass and m/z. It even applies the electron-mass correction, which is easy to forget by hand.

How do I specify the ion?

Pass a named adduct like [M+H]+, [M+Na]+, [M+K]+, [M+NH4]+, [M-H]-, [M+Cl]-, [M+2H]2+, or [M-2H]2-, or give a bare charge for an EI molecular ion. The adduct sets both the charge and the mass shift, so give one or the other: a nonzero charge alongside an adduct is rejected as ambiguous, returning confidence 0 with a why_invalid reason.

Is it exact?

Yes. It is a deterministic calculation against a bundled isotope table, so the same formula and adduct always return the same m/z. No internet lookup is involved.

How is this different from formula_weight?

formula_weight gives the average molar mass for weighing things out. This gives the monoisotopic exact mass and m/z you actually match against a spectrum.

What if I give an adduct it does not know?

An unknown adduct, an unparseable formula, or an unknown element returns confidence 0 with a why_invalid reason listing the supported adducts, not an error.

Related tools