Open In App

HTML5 MathML Complete Reference

Last Updated : 18 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The MathML comes in HTML5. The current MathML version is 3. It was introduced in the year 2015. MathML stands for Mathematics Markup Language. It is used to represent mathematical equations or expressions in web browsers, like other HTML elements. MathML is used to describe mathematics as a basis for machine-to-machine communication. It is intended to be handled by specialized authoring tools such as equation editors, and it is meaningful to other applications as well.

Example:

html
<!DOCTYPE html>
<html>

<head>
    <title>HTML5 MathML</title>
</head>

<body style="text-align:center;">

    <h1 style="color:green">
        GeeksforGeeks
    </h1>

    <h3>HTML5 MathML</h3>

    <!--start tag of the whole representation-->
    <math>

        <!-- Creating Matrix -->
        <mrow>
            <mi>A</mi>
            <mo>=</mo>

            <mfenced open="[" close="]">

                <mtable>
                    <mtr>
                        <mtd>
                            <mi>a</mi>
                        </mtd>
                        <mtd>
                            <mi>b</mi>
                        </mtd>
                    </mtr>

                    <mtr>
                        <mtd>
                            <mi>x</mi>
                        </mtd>
                        <mtd>
                            <mi>y</mi>
                        </mtd>
                    </mtr>

                </mtable>

            </mfenced>
        </mrow>

        <!-- Creating equation -->
        <br><br>
        <msub>
            <mi>Geeks</mi>
            <mn>4</mn>
        </msub>
        <mo>+</mo>
        <mn>Geeks</mn>
        <mo>=</mo>
        <msub>
            <mi>G</mi>
        </msub>
        <mo>→</mo>
        <msub>
            <mi>e</mi>
            <mn>2</mn>
        </msub>
        <mo>→</mo>
        <mi>k</mi>
        <mi>s</mi>
        <mn>4
        </mn>
        <msub>
            <mi>G</mi>
        </msub>
        <mo>→</mo>
        <msub>
            <mi>e</mi>
            <mn>2</mn>
        </msub>
        <mo>→</mo>
        <mi>k</mi>
        <mi>s</mi>
    </math>
</body>

</html>

Output:

MathML Tag

Description

mathWrite a single mathematical formula.
mactionShow the bind action of any expression.
mencloseRender the contents inside an enclosing notation specified by the notation attribute.
merrorWrap the expression in a box, makes that expression eye-catching.
mfenchedAdd custom open and closing parentheses.
mfracAdd fraction symbols between two digits or equations
mglyphPrint non-standard symbols.
miSuch as any kind of symbol or function.
mlabeledtrRepresent a label in a row, either on the left or on the right side inside of the <mtable> element.
mmultiscriptsCreate multi-dimensional matrices.
mnDisplay a numeric character which is normally a sequence of digits with a possible separator.
moPrint operator between elements.
moverThis tag is used to attach an accent or a limit over an expression.
mpaddedExtra padding and to set the general adjustment of the position and size of enclosed contents.
mphantomTo render invisibly but the dimensional are still kept.
mrootDisplay the power of the root like root squire.
mrowCreate a row that contains some mathematical expression or any random text.
msRepresent a string that will represent the mathematical expression by programming languages
mspaceIt is used to print blank space.
msqrtDisplay the root squire of the element content.
styleChange the styles of the children’s elements.
msubPrint the base power on any expression.
msubsupPrint base power and power on any expression.
msupPrint power on any expression.
mtableCreate tables or matrices in HTML5
mtdCreate table data of a table or matrices in HTML5.
mtextPrint any text before or after any expression.
mtrCreate a row of a table or the matrices in HTML5.
mthCreate a header of a table or the matrices in HTML5. It is similar to <th> of a table tag.
munderAttach any accent or limit under the expression.
munderoverAttach any accent or limit under the expression plus over the expression.
semanticsMarkup mathematics there are two possible ways to markup mathematics.


Next Article

Similar Reads