Skip to main content

Search 400 pages — tools, formats, elements, namespaces, directory, comparisons, XPath, datatypes, glossary, parse errors, schema errors, use cases, guides, blog and product.

XML format

MathML

The XML vocabulary for mathematical notation, with presentation markup for layout and content markup for mathematical meaning.

MathML presentation elements describe a visual expression as rows, fractions, roots, scripts, operators, and identifiers. Content MathML describes operations and operands, although browser-native support centers on presentation markup.

MathML can be a standalone document or embedded in HTML and other XML vocabularies such as EPUB and JATS. In XML serialization, its namespace URI identifies the vocabulary regardless of prefix.

Constraints that bite

  • Standalone XML MathML uses the MathML namespace on the <math> root.
  • Token elements such as mi, mn, and mo have different typographic semantics.
  • Presentation structure is not a substitute for accessible alternative text or semantic annotation.
  • When embedded in HTML, parsing and namespace behavior follow the HTML integration rules.
Root element
<math>
Media type
application/mathml+xml
Extensions
.mml, .mathml, .xml
Namespaces
  • http://www.w3.org/1998/Math/MathML
XMLDir label
xml

Specification: W3C MathML Core

A minimal valid document

Every example on this site is checked against the same parser the workspace uses, so what you see below is known to be well-formed.

mathml.xml
<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mfrac><mi>x</mi><mn>2</mn></mfrac>
</math>

Get started

Bring order to the XML your team can't afford to ignore.

Create a free account and get a private workspace to search, validate, diff, and monitor your XML feeds, sitemaps, schemas, and vendor integrations.