Back to Content

MathML

files/en-us/web/mathml/index.md

latest6.6 KB
Original Source

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.

Tutorials

The MathML tutorials are designed to walk you through topics assuming that you have no prior experience, starting from the basics and progressing to more advanced techniques.

  • MathML for beginners
    • : This tutorial will guide you through creating math formulas using structured markup. It starts with an introduction to adding MathML to an HTML document, followed by a deep dive into key components: fractions and roots, scripted elements, and text containers. The tutorial then covers tabular layouts for matrices and advanced math formatting. Finally, a challenge tests your understanding by having you recreate three famous mathematical formulas using the learned concepts.

Guides

The MathML guides are resources that help you author MathML on your web pages, including guidance on writing, editors, fonts and more.

  • Authoring MathML
    • : 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.

Reference

The MathML reference is a comprehensive list of MathML elements and attributes that are documented on MDN.

Examples

Below you'll find some examples you can look at to help you to understand how to use MathML.

MathML formulas

The following demos display increasingly complex mathematical concepts in Web content.

Other Web technologies

The following demos mix MathML with other Web technologies to produce advanced content.

Getting help from the community

Tools

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}