Skip to content

Monoisotopic mass and ion m/z of a formula

ms_ion_mz

Works out the monoisotopic mass of a formula and the m/z of each stated ion.

Runs
On the server
Level
Checked against a reference: molmass 2026.11.1 (its own AME2020 copy, ion-mz-1.json) and pyteomics 5.0.2 (an older NIST table, within a computed tolerance); a second implementation in Python by a separate agent of the same model family (ion-mz-3.json at 1.0.0, ion-mz-5.json at 1.0.1)
Ask your assistant

What it is

Returns a formula's monoisotopic mass and each stated ion's m/z, from AME2020 atomic masses. Use when an ion's m/z is to be predicted from a formula, with adducts, multimers, charge and labels stated. Not for a mass to weigh out: use `calc_formula_mass`; from a structure, use `molecule_descriptors`; for isotope peaks, use `ms_isotope_pattern`; against a measurement, use `ms_mass_error`; from a sequence, use `ms_peptide_mass`. Refuses a charged formula and lead; charge 1 to 100 and polarity are required.

Field: Analytical chemistry.

What it does

You give

  • formula (required): The neutral molecule's elemental formula, e.g. C8H10N4O2 or CuSO4·5H2O; no charge. Leading and trailing white space is removed before the pattern is checked.
  • labels (required): Isotope labels; an empty list for none.
  • ions (required): The ions to compute, at least one.

No request is recorded for this tool.

Limits

  • Research arithmetic: each number follows from the formula, sequence or values you give, by the method and any constants named on the tool, and describes those inputs rather than the sample or instrument they came from.
  • It is not an identification, a validated quantification or a check of an instrument, and it is not for diagnosis or treatment decisions.
  • Monoisotopic only: each element's most abundant isotope in the IUPAC 2009 representative composition, refused where it can change within CIAAW 2024 (lead), plus stated labels; added and removed atoms are monoisotopic and the charge is applied by removing or adding electrons; the bound is from the atomic-mass constants only and excludes measurement; above about 10–20 kDa the monoisotopic peak is usually not observed (estimate); for the average mass use calc_formula_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

  • the formula, an added or a removed group has a charge written in it: the charge belongs to the ion.
  • a symbol that is no element, an empty formula, a zero count or multiplier, an unclosed bracket or any other parse error.
  • an element with no representative isotopic composition (technetium and the like).
  • an element whose most abundant isotope can change within its CIAAW 2024 range (lead).
Every input, with its units3 inputs
  • formula (required): The neutral molecule's elemental formula, e.g. C8H10N4O2 or CuSO4·5H2O; no charge. Leading and trailing white space is removed before the pattern is checked.
  • labels (required): Isotope labels; an empty list for none.
  • ions (required): The ions to compute, at least one.
Every refusal, with its code8 refusals
CodeWhen
CHARGED_FORMULAthe formula, an added or a removed group has a charge written in it: the charge belongs to the ion.
FORMULA_UNREADABLEa symbol that is no element, an empty formula, a zero count or multiplier, an unclosed bracket or any other parse error.
ELEMENT_NOT_IN_TABLEan element with no representative isotopic composition (technetium and the like).
MONOISOTOPE_NOT_FIXEDan element whose most abundant isotope can change within its CIAAW 2024 range (lead).
LABEL_EXCEEDS_COUNTmore labelled atoms than the formula has of that element, or a label on an element the formula lacks.
NUCLIDE_NOT_IN_TABLEa labelled nuclide AME2020 does not tabulate.
ESTIMATED_MASSa labelled nuclide whose AME2020 mass is marked estimated (#), not measured.
REMOVES_ABSENT_ATOMSan ion removes monoisotopic atoms it does not have (labelled atoms counted apart), or nothing is left.

The calculation

The method's equations, constants and worked example.

Monoisotopic mass and ion m/z of a formulaion-mz@1.0.2

Equation 1

M = sum over elements of n_i x m(monoisotope of i) + sum over labels of n_l x m(labelled nuclide), each label replacing that many atoms of its element

SymbolMeaning
Mmonoisotopic neutral mass, Da
n_icount of element i
n_lcount of a labelled nuclide
m(nuclide)AME2020 atomic mass of the neutral atom, Da

Source 1.

Equation 2

m/z = (k x M + m(added atoms) - m(removed atoms) - q x m(e)) / z, with q = +z for a positive ion and -z for a negative one: m/z is the ion's mass over the unified atomic mass unit divided by its charge number (IUPAC 2013, entry 356)

the ion's mass as k x M plus added less removed atoms, less q electrons, is Drybench's construction, binding energies not modelled. The reply's unit Th is the thomson, which entry 356's Note 3 deprecates

it is kept as the label of that dimensionless quotient

SymbolMeaning
kmultimer
zcharge number
qsigned charge
Mmonoisotopic neutral mass, Da
m(e)electron mass, Da
m/zm/z, the dimensionless quotient of IUPAC 2013 entry 356 (the name 'mass-to-charge ratio' is deprecated there), Th

Source 2.

Equation 3

electrons = sum over the ion's atoms of atomic number Z, less q (q = +z for a positive ion, -z for a negative one)

oddElectron is true when that count is odd

SymbolMeaning
electronsthe ion's electron count
Zatomic number of each atom
qsigned charge

Equation 4

bound = (k x sum n_i u_i + sum over added and removed atoms of u + z x u(m(e))) / z, summed linearly

reported rounded up to two significant figures (toward larger magnitude at the second significant figure)

SymbolMeaning
u_iAME2020 uncertainty of the nuclide, Da
boundbound from the atomic-mass constants only, Th

Source 1.

Equation 5

bound(M) = sum over atoms of n_i x u_i, summed linearly from the AME2020 uncertainties, rounded up to two significant figures (toward larger magnitude at the second significant figure)

the ion's bound adds the added and removed atoms' u and z x u(m(e)) and divides by z

SymbolMeaning
u_iAME2020 uncertainty of the nuclide of atom i, Da
n_icount of that nuclide
u(m(e))standard uncertainty of the electron mass (the constant's stated uncertainty), Da

Source 1.

ConstantValueFrom
AME2020 atomic masses and uncertainties, every nuclide the file tabulates, with its estimated (#) mark m(nuclide)a table of values, part of the methodSource 1
electron mass m(e)0.0005485799090441 DaSource 3
each element's most abundant isotope: the argmax of its IUPAC 2009 representative composition, kept only where it keeps its lead across the CIAAW 2024 ranges (lead fails) monoisotopea table of values, part of the methodSource 4
the 2024 ranges against which each monoisotope's lead is checked CIAAW 2024 rangesa table of values, part of the methodSource 5

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 ion-mz@1.0.2, 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 = C8H10N4O2
  • ions[0].multimer = 1
  • ions[0].add = H
  • ions[0].charge = 1
  • ions[0].polarity = positive
  • ions[1].multimer = 1
  • ions[1].add = Na
  • ions[1].charge = 1
  • ions[1].polarity = positive
  • ions[2].multimer = 1
  • ions[2].add = K
  • ions[2].charge = 1
  • ions[2].polarity = positive
  • ions[3].multimer = 1
  • ions[3].add = NH4
  • ions[3].charge = 1
  • ions[3].polarity = positive
  • ions[4].multimer = 2
  • ions[4].add = H
  • ions[4].charge = 1
  • ions[4].polarity = positive
  • ions[5].multimer = 1
  • ions[5].add = H2
  • ions[5].charge = 2
  • ions[5].polarity = positive
  • ions[6].multimer = 1
  • ions[6].add = H3
  • ions[6].charge = 3
  • ions[6].polarity = positive

Steps

  1. carbon = 96 Da, from formula; by equation 1.
  2. hydrogen = 10.078250 Da, from formula; by equation 1.
  3. nitrogen = 56.012296 Da, from formula; by equation 1.
  4. oxygen = 31.989829 Da, from formula; by equation 1.
  5. M = 194.08038 Da, from carbon, hydrogen, nitrogen, oxygen; by equation 1; gives monoisotopicMass.
  6. h-less-electron = 1.0072765 Da, from ions[0].add; by equation 2.
  7. mz = 195.08765 Th, from M, h-less-electron, ions[0].charge; by equation 2; gives ions[0].mz.

The working, as the case writes it:

M = 8 x 12 + 10 x 1.007825031898 + 4 x 14.00307400425 + 2 x 15.99491461926 = 194.080375574 Da (AME2020)

[M+H]+ = M + 1.007825031898 - 0.0005485799090441 = 195.087652026 Th, reported 195.087652 Carry the AME2020 values in full

the printed partials are rounded and can differ in the last reported decimal.

Answer

monoisotopicMass = 194.08038 Da

ions[0].mz = 195.08765 Th

Where these values came from: our own exact-arithmetic script and a hand-worked case; exact decimal on AME2020 masses (mass_1.mas20.txt) and CODATA 2022 m_e, by this script.

At build the tool returned this answer within the tolerance the file states: masses and m/z equal at the reported decimals (absolute 1e-9 Da or Th on the rounded values); bounds, decimals, formulas, parity, statuses and codes exact.

Sources

  1. Wang M, Huang WJ, Kondev FG, Audi G, Naimi S. The AME 2020 atomic mass evaluation (II). Tables, graphs and references. Chin Phys C 2021;45:030003

    Used for: Monoisotopic mass and ion m/z of a formula. At: table mass_1.mas20.txt, column ATOMIC MASS (micro-u) and its uncertainty, every nuclide.

    Read in full, 10 November 2026
  2. Murray KK, Boyd RK, Eberlin MN, Langley GJ, Li L, Naito Y. Definitions of terms relating to mass spectrometry (IUPAC Recommendations 2013). Pure Appl Chem 2013;85:1515-1609

    Used for: Monoisotopic mass and ion m/z of a formula. At: p. 1570-1571, section entry 356, m/z: the ion's mass over the unified atomic mass unit, divided by its charge number (regardless of sign); Note 3, the thomson (Th) deprecated.

    Read in full, 14 November 2026
  3. Mohr PJ, Newell DB, Taylor BN, Tiesinga E. CODATA recommended values of the fundamental physical constants: 2022 (NIST web table), electron mass in u

    Used for: Monoisotopic mass and ion m/z of a formula. At: table electron mass in u, value and standard uncertainty.

    Read in full, 11 November 2026
  4. Coursey JS, Schwab DJ, Tsai JJ, Dragoset RA. Atomic Weights and Isotopic Compositions (NIST), whose compositions are Berglund M, Wieser ME, Isotopic compositions of the elements 2009, Pure Appl Chem 2011;83:397-410, as NIST states

    Used for: Monoisotopic mass and ion m/z of a formula. At: table Isotopic Composition column, every element.

    Read in full, 10 November 2026
  5. CIAAW (IUPAC Commission on Isotopic Abundances and Atomic Weights), Isotopic Compositions of the Elements

    Used for: Monoisotopic mass and ion m/z of a formula. At: table Representative isotopic composition, every element.

    Read in full, 10 November 2026

How it is checked

Level

Checked against a reference.

Checked against

Our own exact-arithmetic script and a hand-worked case; a reference program this project wrote itself, second implementation (Python 3.13), 2026-11-14, exact rationals (Python fractions) on the exact value of each input double, each output rounded once to the nearest double; not an outside program.

Cases

No case set is linked to this version.

Not checked

One session wrote the first script and the engine; a second implementation in Python by a separate agent of the same model family agrees on 132 cases at 1.0.1, and another on 67 at 1.0.0; no measured spectrum was compared; above about 10 to 20 kDa the monoisotopic peak is usually not observed (Drybench's estimate); the ion's mass is Drybench's construction (IUPAC 2013 entry 356 defines m/z only); a count with a leading zero (C06) is refused as FORMULA_UNREADABLE, white space inside a formula is ignored, and a label whose mass number is the monoisotope's (one 12C on C6H6) leaves the formula and every mass as without it, each with no case; an empty add or remove string, refused as INVALID_STRING, has no case. A formula starting with a digit (13CH4) is refused FORMULA_UNREADABLE since 1.0.2, through formula-mass 1.3.0, with no case in this method's fixtures; the refusal is covered by stored reference values and unit tests only.

Changes to its methods1 change
  • 25 November 2026, ion-mz@1.0.2: In 1.0.2, through formula-mass 1.3.0, a formula starting with a digit is now refused (FORMULA_UNREADABLE); every other output is unchanged, and every pinned output hash is the same.