MathML (source code)

= MathML
{c}
{wiki}

<MathML> is a <markup language> for mathematical notation, structure and content on the web. Its elements describe expressions within a document rather than reducing a formula to a flat character string. <MathML Core> specifies a subset suited to <web browser> implementation; the cited 24June2025 document is a Candidate Recommendation Snapshot.<MathML Core by World Wide Web Consortium>[Abstract; Status of This Document]{ref}

Consider the <typeset fraction> $\frac{x+1}{2}$. A presentation encoding is `<math xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mrow><mi>x</mi><mo>+</mo><mn>1</mn></mrow><mn>2</mn></mfrac></math>`. The `mi`, `mo` and `mn` elements identify a symbolic name, an operator and numbers. The `mrow` groups the <numerator>; the two children of `mfrac` provide the <numerator> and <denominator>.<MathML Core by World Wide Web Consortium>[§§3.2.2–3.2.4, token elements; §§3.3.1–3.3.2, mrow and mfrac]{ref}

Grouping changes the represented expression. At $x=3$, the intended <fraction> gives $(3+1)/2=2$, whereas $x+1/2=7/2$. This arithmetic illustrates the meaning assigned to the structure; <MathML> presentation markup does not itself execute the calculation. Maintaining a structured representation helps document tools manipulate a formula and lets layout follow its mathematical grouping.