Monoisotopic mass and ion m/z of a formula, version 1.0.2
ion-mz@1.0.2: this version's equations with their symbols, each constant's value, their sources and whether each was read, a worked example where the record holds one, its level and what it was checked against, the number of cases, and what was not checked. This version's record is not rewritten; a correction is added under Changes.
What this page can and cannot show
Level: Checked against a reference; AME2020 and CODATA re-read; molmass 2026.11.1, pyteomics 5.0.2; monoisotopic only. Research arithmetic. Reference kind: 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.
Not fully recorded, and not independently reviewed. Items marked "Not recorded" are missing from this project's records for the version named. Apart from any worked example shown, the cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed these methods or checks.
Every version of this method · Every method · What the levels mean
Version 1.0.2
Level: Checked against a reference; AME2020 and CODATA re-read; molmass 2026.11.1, pyteomics 5.0.2; monoisotopic only. Research arithmetic. Reference kind: 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. ion-mz@1.0.2
Built, not hosted. Generated from a snapshot of the library's records taken on 2026-11-25, as committed on 2026-11-25. A later snapshot replaces this one, so these records and this page can change.
Verification statement: Monoisotopic mass and ion m/z from AME2020 atomic masses (every nuclide compared with mass_1.mas20.txt) and the CODATA 2022 electron mass, re-read at source 14 November 2026. The ion's mass as atoms less electrons is Drybench's construction; binding energies are not modelled. Compared with molmass 2026.11.1 (its own AME2020 copy), pyteomics 5.0.2 (an older NIST table, within a computed tolerance) and a second implementation in Python by a separate agent of the same model family (132 cases at 1.0.1, 26 at the edges, and 67 at 1.0.0). The bound covers the atomic-mass constants only. Research arithmetic.
The monoisotopic mass of a formula with stated isotope labels, and the m/z of each stated ion: k molecules, added and removed atoms, z electrons removed or added, divided by z.
- How results are reported: Exact arithmetic in units of 1e-16 u. The number of decimals d is chosen on the exact, unrounded bound: the largest d from 6 down to 1 for which that bound is below 5 x 10^-(d+1) (in Da or Th), otherwise 0. Each mass and m/z is rounded half away from zero to d decimals, and d is reported beside it. The bound is then reported rounded up to two significant figures (toward larger magnitude at the second significant figure). A reported bound of 5.0e-7 can therefore stand beside 6 decimals when the unrounded bound is just under 5e-7 (CuCl: unrounded 4.95e-7). Formulas print in Hill order: C, then H, then the other elements alphabetically; with no carbon, every element alphabetically; each labelled nuclide is written as [A]X with its count, straight after its element's unlabelled atoms, in ascending mass number. Isotope labels go only in the labels argument: D, T and bracketed nuclides in a formula are refused as FORMULA_UNREADABLE. Carbon counts as present for Hill order when any carbon atom, labelled or not, is in the formula. White space inside a formula or group is ignored (C6 H6 reads as C6H6); a count with a leading zero, such as C06, is refused as FORMULA_UNREADABLE. In ion notations a group typed as one element symbol followed by digits is written digits first (H3 as 3H, Na1 as 1Na); any other group, a bare symbol included, is written as typed (Na, NH4, HCOO). An add or remove left out means none; an empty string is refused as INVALID_STRING. Worked steps print at most eight significant figures of the stored value, or as many as the expected output reports where a step is mapped to one; those strings are display only. Refusals are checked in this order, the first failure answered: the formula; then each label in the order given; then each ion in the order given (its added group, its removed group, then REMOVES_ABSENT_ATOMS). Within one formula or group: a charge written at its end (CHARGED_FORMULA); a symbol that is no element (FORMULA_UNREADABLE); each element in the order written, lead answered MONOISOTOPE_NOT_FIXED and an element without a representative composition ELEMENT_NOT_IN_TABLE; then the parse, where an unclosed bracket or other parse error is FORMULA_UNREADABLE (one the parser reads as a misplaced charge is CHARGED_FORMULA), a charge inside the formula is CHARGED_FORMULA and a zero count is FORMULA_UNREADABLE; an empty formula is FORMULA_UNREADABLE. Within one label: an element the formula lacks, or more atoms than it has, is LABEL_EXCEEDS_COUNT, then NUCLIDE_NOT_IN_TABLE, then ESTIMATED_MASS. So 'Tc(' is ELEMENT_NOT_IN_TABLE. Ahead of all of these, each argument is read in turn: a multimer outside 1 to 10, a charge outside 1 to 100, a label's mass number outside 1 to 300 or its count outside 1 to 10000 is invalid-input OUT_OF_RANGE.
- Uncertainty: a bound from the AME2020 atomic-mass uncertainties and the electron mass's, summed linearly (the file gives no covariances); it excludes measurement, composition, and the binding energies of electrons and bonds (of order 1e-8 u per charge), which this method does not model; its coverage is not checked
- Computes through this project's own routines: reads each formula (symbols, counts, round and square brackets, nested groups, hydrate and adduct parts); the domain's refusals are added in stored reference values
- Reference, as its record states it: molmass 2026.11.1 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
- Level confirmed by this project's ruling of 25 November 2026
What this page can and cannot show
What was checked
238 cases in 4 files, linked by this exact version.
Run through the tool at build 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: 212 agree within the tolerance the file states, 26 refuse as the case expects, 0 differ, 0 were not run.
File 1, 37 cases
- Where the expected values came from: our own exact-arithmetic script and a hand-worked case
- Recorded on: 2026-11-10
- Reference: exact decimal script (Python decimal), 3.13.18; licence PSF-2.0
- Tolerance as the file states it: 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
File 2, 2 cases
- Where the expected values came from: our own exact-arithmetic script and a hand-worked case
- Recorded on: 2026-11-11
- Reference: exact decimal script (Python decimal), 3.13.18; licence PSF-2.0
- Tolerance as the file states it: 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
File 3, 67 cases
- Where the expected values came from: an outside program, second implementation (Python 3.13) 2026-11-14
- Recorded on: 2026-11-14
- Reference: second implementation (Python 3.13), 2026-11-14; licence BSD-3-Clause
- Tolerance as the file states it: every number relative 1e-12 (absolute 1e-15 below 1e-3, in each value's unit); counts, labels, formulas, strings, flags, statuses and codes exact
File 4, 132 cases
- Where the expected values came from: an outside program, second implementation (Python 3.13) 2026-11-14
- Recorded on: 2026-11-14
- Reference: second implementation (Python 3.13), 2026-11-14; licence BSD-3-Clause
- Tolerance as the file states it: every number relative 1e-12 (absolute 1e-15 below 1e-3, in each value's unit); counts, labels, formulas, strings, flags, statuses and codes exact
Apart from the worked example, the cases and their values are not printed here. This shows agreement with this project's recorded cases. It does not show that a method suits your work, and it is not a qualification.
What was 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.
Definition or model
A closed form: the result follows from the inputs by the equations alone.
Equations
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
| Symbol | Meaning and unit |
|---|---|
| M | monoisotopic neutral mass, Da |
| n_i | count of element i |
| n_l | count of a labelled nuclide |
| m(nuclide) | AME2020 atomic mass of the neutral atom, Da |
Source: 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, table mass_1.mas20.txt, column ATOMIC MASS (micro-u) and its uncertainty, every nuclide, AME2020, the mass_1.mas20.txt file the IAEA AMDC distributes; read in full on 2026-11-10 by an AI-assisted session; not yet checked by a person. Read from the data file of release AME2020, SHA-256 beginning e8599c6d7f72. Free to read (CC BY 3.0), checked 2026-11-10. No erratum found (searched web search: the title with erratum or corrigendum, Chinese Physics C, the IAEA AMDC AME2020 page), 2026-11-11.
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
| Symbol | Meaning and unit |
|---|---|
| k | multimer |
| z | charge number |
| q | signed charge |
| M | monoisotopic neutral mass, Da |
| m(e) | electron mass, Da |
| m/z | m/z, the dimensionless quotient of IUPAC 2013 entry 356 (the name 'mass-to-charge ratio' is deprecated there), Th |
Source: 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, 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, version of record, read from a mirror copy (research.cbc.osu.edu) whose title page matches the DOI, not from the publisher's host; read in full on 2026-11-14 by an AI-assisted session; not yet checked by a person. Read from the file itself, SHA-256 beginning 33f26ca2d82e. Free to read (free to read (IUPAC Recommendations); © IUPAC), checked 2026-11-11. No erratum found (searched web search: the title with erratum, the DOI landing page's listing, as search results show it), 2026-11-11.
Equation 3
Definition: the ion's electron parity (oddElectron).
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
| Symbol | Meaning and unit |
|---|---|
| electrons | the ion's electron count |
| Z | atomic number of each atom |
| q | signed 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)
| Symbol | Meaning and unit |
|---|---|
| u_i | AME2020 uncertainty of the nuclide, Da |
| bound | bound from the atomic-mass constants only, Th |
Source: 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, table mass_1.mas20.txt, column ATOMIC MASS (micro-u) and its uncertainty, every nuclide, AME2020, the mass_1.mas20.txt file the IAEA AMDC distributes; read in full on 2026-11-10 by an AI-assisted session; not yet checked by a person. Read from the data file of release AME2020, SHA-256 beginning e8599c6d7f72. Free to read (CC BY 3.0), checked 2026-11-10. No erratum found (searched web search: the title with erratum or corrigendum, Chinese Physics C, the IAEA AMDC AME2020 page), 2026-11-11.
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
| Symbol | Meaning and unit |
|---|---|
| u_i | AME2020 uncertainty of the nuclide of atom i, Da |
| n_i | count of that nuclide |
| u(m(e)) | standard uncertainty of the electron mass (the constant's stated uncertainty), Da |
Source: 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, table mass_1.mas20.txt, column ATOMIC MASS (micro-u) and its uncertainty, every nuclide, AME2020, the mass_1.mas20.txt file the IAEA AMDC distributes; read in full on 2026-11-10 by an AI-assisted session; not yet checked by a person. Read from the data file of release AME2020, SHA-256 beginning e8599c6d7f72. Free to read (CC BY 3.0), checked 2026-11-10. No erratum found (searched web search: the title with erratum or corrigendum, Chinese Physics C, the IAEA AMDC AME2020 page), 2026-11-11.
Constants
| Constant | Value and unit | Source | Date read |
|---|---|---|---|
| AME2020 atomic masses and uncertainties, every nuclide the file tabulates, with its estimated (#) mark (m(nuclide)) | a table of values, part of the method | 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, table mass_1.mas20.txt, column ATOMIC MASS (micro-u) and its uncertainty, every nuclide | 2026-11-10 |
| electron mass (m(e)) | 0.0005485799090441 Da | Mohr PJ, Newell DB, Taylor BN, Tiesinga E. CODATA recommended values of the fundamental physical constants: 2022 (NIST web table), electron mass in u, table electron mass in u, value and standard uncertainty | 2026-11-11 |
| 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) (monoisotope) | a table of values, part of the method | 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, table Isotopic Composition column, every element | 2026-11-10 |
| the 2024 ranges against which each monoisotope's lead is checked (CIAAW 2024 ranges) | a table of values, part of the method | CIAAW (IUPAC Commission on Isotopic Abundances and Atomic Weights), Isotopic Compositions of the Elements, table Representative isotopic composition, every element | 2026-11-10 |
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
- carbon = 96 Da, from formula; by equation 1.
- hydrogen = 10.078250 Da, from formula; by equation 1.
- nitrogen = 56.012296 Da, from formula; by equation 1.
- oxygen = 31.989829 Da, from formula; by equation 1.
- M = 194.08038 Da, from carbon, hydrogen, nitrogen, oxygen; by equation 1; gives monoisotopicMass.
- h-less-electron = 1.0072765 Da, from ions[0].add; by equation 2.
- 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 Daions[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.
Who worked this case: not recorded.
What it refuses, and its input ranges
CHARGED_FORMULA: the formula, an added or a removed group has a charge written in it: the charge belongs to the ion Next: Write the neutral formula and give the charge as the ion's charge and polarity.FORMULA_UNREADABLE: a symbol that is no element, an empty formula, a zero count or multiplier, an unclosed bracket or any other parse error Next: Correct the formula: element symbols with their counts, brackets closed, adducts joined by a dot.ELEMENT_NOT_IN_TABLE: an element with no representative isotopic composition (technetium and the like) Next: No change of input makes this computable on these data.MONOISOTOPE_NOT_FIXED: an element whose most abundant isotope can change within its CIAAW 2024 range (lead) Next: Use ms_isotope_pattern on the ion's own formula, stating the element's isotopic composition in the material measured.LABEL_EXCEEDS_COUNT: more labelled atoms than the formula has of that element, or a label on an element the formula lacks Next: Label no more atoms of an element than the formula has, and only elements it contains.NUCLIDE_NOT_IN_TABLE: a labelled nuclide AME2020 does not tabulate Next: Label a nuclide that AME2020 tabulates.ESTIMATED_MASS: a labelled nuclide whose AME2020 mass is marked estimated (#), not measured Next: Label a nuclide whose AME2020 mass is measured, not estimated.REMOVES_ABSENT_ATOMS: an ion removes monoisotopic atoms it does not have (labelled atoms counted apart), or nothing is left Next: Correct the formula or the removed group so that the ion removes only atoms it has.
Changes
2026-11-25-ion-mz@1.0.2-1
2026-11-25 · ion-mz@1.0.2 · Corrections to our methods
- What was wrong: A number written before a formula was read as a multiplier of its first part. Caffeine written 13C8H10N4O2 was read as C104H130N52O26: a monoisotopic mass of 2523.044882 Da for 194.080376 Da, and [M+H]+ at 2524.052159 for 195.087652. An isotope label written that way was not read as a label either: labels are stated separately.
- Affected: ms_ion_mz at ion-mz 1.0.1 and earlier, only where the formula or an ion's added or removed formula starts with a digit. Every other output is unchanged.
- What changed: 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.
- How it was found: A review of the formula reader's grammar on 24 November 2026 found that no rule or test documented a number at the start of a formula, while the shared reader (formula-mass) applied the adduct multiplier to the first part as well; the scientific review ruled the same day that such a formula is refused. A sweep of the tools' worked examples with 13 written before each formula argument, before and after the fix, found which tools computed on it.
- Cases added: None in the fixtures: no published case starts a formula with a digit, and every pinned output hash is unchanged. The refusal is covered by the formula reader's hand cases and unit tests; the widened sweep records each tool's reply before and after.
Tools that use it
Cite this version
Monoisotopic mass and ion m/z of a formula. Drybench; ion-mz@1.0.2; https://www.drybench.com/methods/m/ion-mz/1.0.2 (accessed [date]).