The MathML <msup> element is used to attach a superscript to an expression.

It uses the following syntax: <msup> base superscript </msup>.


class, id, style

Provided for use with stylesheets.


A Boolean value specifying whether more vertical space is used for displayed equations or, if set to false, a more compact layout is used to display formulas. The main effect is that larger versions of operators are displayed, when displaystyle is set to true. See also movablelimits on <mo>.


Used to set a hyperlink to a specified URI.


The background color. You can use #rgb, #rrggbb and HTML color names.


The text color. You can use #rgb, #rrggbb and HTML color names.

superscriptshift Deprecated

The minimum space by which to shift the superscript up from the baseline of the expression, as a length value. This attribute is deprecated and will be removed in the future.


Sample rendering: x1

Rendering in your browser: X 2





MathML Core
# subscripts-and-superscripts-msub-msup-msubsup

Browser compatibility

BCD tables only load in the browser

See also