Favorites

HTML <math> Tag

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
<math>
HTML TagThis tag is supported by all modern browsers.
Updated 22nd November 2026

Description

The <math> element is the top-level element of MathML, the markup language for mathematical notation. Everything inside it, such as <mi> (identifiers), <mn> (numbers), <mo> (operators), <mfrac> (fractions), <msup> (superscripts) and <msqrt> (square roots), is rendered as a formula by the browser, without images or JavaScript libraries.

The display attribute controls whether the formula is shown inline within the text (inline, the default) or as a centred block on its own line (block). Because MathML is real markup, formulas can be read by screen readers, scale with the text, and can be styled with CSS. MathML Core is supported in all major browsers since Chrome 109.

Properties

Permitted Parents
Any element that accepts phrasing content
Content
MathML elements
Start/End Tags
Start tag: required, End tag: required

Example

<p>The quadratic formula:
<math display="block">
<mi>x</mi><mo>=</mo>
<mfrac>
<mrow><mo>-</mo><mi>b</mi><mo>&#xB1;</mo><msqrt><msup><mi>b</mi><mn>2</mn></msup><mo>-</mo><mn>4</mn><mi>a</mi><mi>c</mi></msqrt></mrow>
<mrow><mn>2</mn><mi>a</mi></mrow>
</mfrac>
</math>
</p>
Open in editor

Attributes

display
Whether the formula is rendered inline or as a block.

Possible Values:
  • inline
  • block
alttext
A text alternative for the formula (deprecated in MathML Core; prefer making the markup itself accessible).

Global Attributes

The <math> tag also supports the Global Attributes in HTML5

Event Attributes

The <math> tag also supports the Event Attributes in HTML5

Browser Support

The following information will show you the current browser support for the HTML <math> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.

This tag is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee