MathML
Baseline 2023
Newly available
Since January 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Mathematical Markup Language (MathML) is an XML-based language for describing mathematical notation.
MathML was originally designed as a general-purpose specification for browsers, office suites, computer algebra systems, EPUB readers, LaTeX-based generators. However, this approach was not very adapted to the Web: the subset focusing on semantics has never been implemented in browsers while the subset focusing on math layout led to incomplete and inconsistent browser implementations.
MathML Core is a subset with increased implementation details based on rules from LaTeX and the Open Font Format. It is tailored for browsers and designed specifically to work well with other web standards including HTML, CSS, DOM, JavaScript.
Below you will find links to documentation, examples, and tools to work with MathML. MDN uses MathML Core as a reference specification but, due to an erratic standardization history, legacy MathML features may still show up in existing implementations and web content.
Note: It is highly recommended that developers and authors switch to MathML Core, perhaps relying on other web technologies to cover missing use cases. The Math WG is maintaining a set of MathML polyfills to facilitate that transition.
Beginner's tutorials
- Getting started with MathML
-
In this article, we will take a simple HTML document and see how to add MathML formulas into it, introducing a few elements along the way.
- Text containers
-
Now that you get a better idea of MathML, we move on to text containers (variables, numbers, operators, ...) which are used as building blocks of MathML formulas.
- Fractions and roots
-
Relying on text containers, this article describes how to build more complex MathML expressions by nesting fractions and roots.
- Scripts
-
We continue the review of basic math notations and focuses on building MathML elements with scripts.
- Tables
-
Once all basic math notations are known, it remains to consider tabular layout which can be used for matrix-like expressions and other advanced math layout.
- Three famous mathematical formulas Challenge
-
With the things you have learned in the last few articles, you should already be able to write relatively sophisticated MathML formulas. This challenge gives you a chance to do that.
Guides
-
Suggestions and tips for writing MathML, including suggested MathML editors and how to integrate their output into Web content.
- Fonts for MathML
-
How users can install such math fonts to properly display MathML in browsers.
MathML reference
- MathML element reference
-
Details about each MathML element and compatibility information for desktop and mobile browsers.
- MathML attribute reference
-
Information about MathML attributes that modify the appearance or behavior of elements.
- MathML attribute values
-
Further information about MathML atribute values.
- MathML examples
-
MathML samples and examples to help you understand how it works.
Getting help from the community
Tools
Related topics
Browser compatibility
BCD tables only load in the browser