---
title: "HTML 5 MathML"  
description: "The HTML syntax of HTML5 allows MathML (Mathematical Markup Language) element to be used inside a document using  tag. It aims at integrating mathemat"  
author: "Anonymous User"  
published: 2011-07-23  
updated: 2020-06-12  
canonical: https://www.mindstick.com/articles/581/html-5-mathml  
category: "html5"  
tags: ["html5"]  
reading_time: 2 minutes  

---

# HTML 5 MathML

The HTML syntax of HTML5 allows MathML (Mathematical [Markup Language](https://www.mindstick.com/interview/234/what-is-markup-language)) element to be used inside a [document](https://www.mindstick.com/articles/328642/what-to-consider-while-choosing-a-software-documentation-tool) using <math> tag. It aims at integrating mathematical formulae into [World Wide Web](https://www.mindstick.com/forum/156264/what-is-the-world-wide-web) pages and other document. MathML deals not only with the presentation but also the meaning of formula [components](https://www.mindstick.com/blog/74096/understanding-the-role-of-some-integral-ac-components) (the latter part of MathML is [known as](https://answers.mindstick.com/qa/38482/name-the-world-s-lightest-material-which-was-manufactured-by-isro-scientists-at-the-vikram-sarabhai-space-centre-thiruvananthapuram-and-is-also-known-as-blue-air) “Content MathML”). Because the meaning of the equation is preserved separate from the presentation, how the content is communicated can be left up to the user.\

For valid XML [documents](https://www.mindstick.com/articles/156931/the-main-types-of-business-documents) as per the W3C specifications, a MathML file must have a <! DOCTYPE> declaration:

```
  <?xml version="1.0" encoding="UTF-8"?>  <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN"           "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">
```

Thus, the [expression](https://www.mindstick.com/blog/181/lambda-expression-in-c-sharp) ax2+bx+c could be represented in a valid MathML file as:

```
 <?xml version="1.0" encoding="UTF-8"?>  <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN"           "http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">  <math xmlns="http://www.w3.org/1998/Math/MathML">    <mrow>      <mi>a</mi>       <mo>&#x2062;<!-- &InvisibleTimes; --></mo>      <msup>         <mi>x</mi>         <mn>2</mn>      </msup>      <mo>+</mo>      <mi>b</mi>       <mo>&#x2062;<!-- &InvisibleTimes; --></mo>      <mi>x</mi>      <mo>+</mo>      <mi>c</mi>    </mrow>  </math>
```

This example will display a2+b3+c4=z9 could be represented in a valid MathML file as:

```
<head>     <title>MathML Examples</title></head><body>     <math><!--using math tag-->   <mrow>   <msup>   <mi>a</mi><mn>2</mn>   <mo>+</mo>   </msup>   <msup>   <mi>b</mi><mi>3</mi>   <mo>+</mo>   </msup>   <msup>   <mi>c</mi><mi>4</mi>   <mo>=</mo>   </msup>   <msup><mi>z</mi><mi>9</mi></msup>   </mrow>   </math></body>
```

This would [produce](https://yourviews.mindstick.com/view/83488/how-much-power-do-solar-panels-produce) following result as shown below:

![HTML 5 MathML](https://www.mindstick.com/mindstickarticle/eeeb5d31-2815-4604-86cc-35d3966c27c3/images/11e10a64-2404-4a6d-97cd-244fc6466d42.png)

\

---

Original Source: https://www.mindstick.com/articles/581/html-5-mathml

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
