MathML Support in Microsoft 365

Microsoft 365 applications (Word, PowerPoint, Excel, and OneNote) can import and export MathML (Mathematical Markup Language). This document describes what MathML elements, attributes, and patterns are supported, and what limitations apply.


MathML Import (MathML → Office Math)

Supported MathML version

The importer supports MathML 3 (Presentation MathML), including elements and attributes deprecated in MathML Core but still used, such as

<mfenced>, <maligngroup>, <malignmark>, and the mathvariant attribute.

Namespace handling

The <math> root element must use the MathML namespace http://www.w3.org/1998/Math/MathML. Namespace prefixes are accepted (e.g., <m:math xmlns:m="...">). A common authoring error — omitting the http: protocol — is automatically corrected before importing.

The display="block" attribute on <math> is recognized and produces a display-mode (centered) equation. Without it, the equation is inline.

Supported elements

Token elements

Element Description
<mi> Identifier (variable, function name)
<mo> Operator or fence character
<mn> Number
<mtext> Text
<ms> String literal (with lquote/rquote attributes)
<mspace> Explicit space (with width, height, depth)
<mglyph> Glyph reference

Layout elements

Element Description
<mrow> Horizontal group of sub-expressions
<mfrac> Fraction
<msqrt> Square root
<mroot> n-th root
<msub> Subscript
<msup> Superscript
<msubsup> Subscript and superscript
<munder> Underscript (limit below)
<mover> Overscript (limit above / accent)
<munderover> Under and over scripts
<mmultiscripts> Multiple prescripts and postscripts
<mprescripts/> Separator between postscripts and prescripts in <mmultiscripts>
<none/> Empty script placeholder in <mmultiscripts>
<mfenced> Fenced (delimited) expression — MathML 3 legacy
<menclose> Enclosure (box, circle, strike, etc.)
<mphantom> Invisible content (takes up space)
<mpadded> Adjustable spacing box
<mstyle> Style change (inheritable attributes)
<merror> Error display (rendered as boxed formula)

Table elements

Element Description
<mtable> Matrix or table
<mtr> Table row
<mlabeledtr> Labeled table row
<mtd> Table cell
<maligngroup> Alignment group marker
<malignmark> Alignment edge marker

Annotation elements

Element Description
<semantics> Semantic annotation wrapper
<annotation> Text annotation (e.g., LaTeX source)
<annotation-xml> XML annotation (e.g., Content MathML)

When <semantics> is present, the first child (Presentation MathML) is used for rendering. <annotation> and <annotation-xml> children are currently ignored.

Other

Element Description
<maction> Action element — first child used for rendering

Supported attributes

Global attributes

These attributes are accepted on most elements:

Attribute Values Description
mathvariant See table below Font variant
mathsize small, normal, big, or length Font size
mathcolor Color name or #RRGGBB Foreground color
mathbackground Color name or #RRGGBB Background color
dir ltr, rtl Text direction

mathvariant values

All 18 MathML 3 mathvariant values are recognized:

Value OMML mapping
normal Upright (plain)
bold Bold
italic Italic
bold-italic Bold italic
double-struck Double-struck (blackboard bold)
script Script (calligraphic)
bold-script Bold script → mapped to script
fraktur Fraktur
bold-fraktur Bold fraktur → mapped to fraktur
sans-serif Sans-serif
bold-sans-serif Bold sans-serif → mapped to bold
sans-serif-italic Sans-serif italic → mapped to italic
sans-serif-bold-italic Sans-serif bold italic → mapped to bold italic
monospace Monospace
initial Initial (Arabic)
tailed Tailed (Arabic)
looped Looped (Arabic)
stretched Stretched (Arabic)

Note: Several compound variants (bold-script, bold-fraktur, bold-sans-serif, sans-serif-italic, sans-serif-bold-italic) are mapped to simpler OMML styles because OMML does not support all MathML variant combinations.

<mo> operator attributes

Attribute Values Description
stretchy true, false Whether operator stretches
fence true, false Whether operator is a fence/bracket
separator true, false Whether operator is a separator
accent true, false Whether operator is an accent
largeop true, false Whether operator is a large operator
movablelimits true, false Whether limits can move
lspace Length Left spacing
rspace Length Right spacing
form prefix, infix, postfix Operator form

An operator dictionary provides default values for stretchy, fence, accent, largeop, and movablelimits based on the operator character. Explicit attributes override the defaults.

<mfrac> attributes

Attribute Values Description
linethickness Length, thin, medium, thick, or 0 Fraction bar thickness. 0 produces a binomial coefficient (no bar).
bevelled true, false Skewed (inline) fraction

<mfenced> attributes (MathML 3 legacy)

Attribute Default Description
open ( Opening delimiter character
close ) Closing delimiter character
separators , Separator character(s) between children

<mfenced> is internally expanded to the equivalent <mrow> with <mo> delimiters. For example:

<mfenced open="[" close="]" separators=",">
  <mi>a</mi><mi>b</mi><mi>c</mi>
</mfenced>

is equivalent to:

<mrow>
  <mo>[</mo><mi>a</mi><mo>,</mo><mi>b</mi><mo>,</mo><mi>c</mi><mo>]</mo>
</mrow>

Note: when U+251C ├ and U+2524 ┤ are used as fence delimiters they are rendered invisible. Earlier versions of Microsoft 365 apps may have exported them for invisible delimiters.

<menclose> attributes

Attribute Values Description
notation box, roundedbox, circle, left, right, top, bottom, updiagonalstrike, downdiagonalstrike, horizontalstrike, verticalstrike Enclosure style(s)

Multiple notation values can be combined (space-separated).

<munder> / <mover> / <munderover> attributes

Attribute Values Description
accent true, false Whether the overscript is an accent
accentunder true, false Whether the underscript is an accent

<msub> / <msup> / <msubsup> attributes

Attribute Description
subscriptshift Minimum subscript shift
superscriptshift Minimum superscript shift

<mtable> attributes

Attribute Values Description
rowalign top, center, bottom, baseline, axis Row alignment
columnalign left, center, right Column alignment
columnwidth Length or auto Column widths
rowspacing Length Row spacing
columnspacing Length Column spacing
width Length Table width
alignmentscope true, false Alignment scope
frame none, solid, dashed Table frame
framespacing Length Frame spacing

<mtr> and <mtd> attributes

Attribute Values Description
rowalign top, center, bottom, baseline, axis Row alignment override
columnalign left, center, right Column alignment override
rowspan Integer Row span
columnspan Integer Column span

<mpadded> attributes

Attribute Description
width Width adjustment
lspace Left space adjustment
height Height adjustment
depth Depth adjustment

<mspace> attributes

Attribute Description
width Width of the space
height Height of the space
depth Depth of the space

Character references

Standard XML numeric character references (&#x221A;, &#8730;) are supported in all MathML input.

HTML named character references (&alpha;, &le;, &InvisibleTimes;, etc.) are supported only when MathML is embedded in HTML. These are not part of the XML or MathML specifications and are not recognized when importing standalone MathML XML. See the HTML section below for details.

Named character references are never written during MathML export. All characters are written as literal Unicode.

Operator dictionary

The importer includes a built-in operator dictionary that provides default rendering properties for common operators. This includes:

  • Fence characters: (, ), [, ], {, }, |, , , , , , , , , , and CJK forms
  • Stretchy operators: Arrows, brackets, integral signs, radicals, over/under braces, and parentheses
  • Large operators: ∑, ∏, ∐, ∫, ∮, ∯, ⊕, ⊗, ⊙, ⋂, ⋃, ⋀, ⋁, etc.
  • Accent operators: Circumflex, tilde, macron, modifier letter macron, breve, dot, acute, grave, caron, arrows (as overscripts), braces, and brackets
  • Movable-limits operators: ∑, ∏, ⋂, ⋃, lim, max, min, and others

Spacing-to-combining accent translation

Spacing accent characters in MathML (e.g., U+02C6 circumflex, U+02DC tilde) are automatically translated to their combining forms for use in OMML accent constructs. This is necessary because MathML uses spacing forms in <mo> while OMML requires combining characters.


MathML Export (Office Math → MathML)

Output format

The MathML export produces MathML Core-compatible output in most cases. It avoids MathML 3 legacy features:

  • No <mfenced>: Delimited expressions are written as <mrow> with explicit <mo> opener, content, and <mo> closer, with the exception of OneNote copying math to the clipboard.

  • No <maligngroup> or <malignmark>: columns are added to the <mtable> to align content at the alignment points with 0 column spacing. Note that column spacing and alignment has limited support across the ecosystem.

  • No mathvariant attribute for styled characters: Instead of mathvariant="bold" on <mi>, the export emits Unicode Mathematical Alphanumeric Symbols from the supplementary plane (U+1D400–U+1D7FF). For example, bold italic x is written as U+1D499 rather than <mi mathvariant="bold-italic">x</mi>. The mathvariant="normal" attribute is used only for multi-character identifiers that should not be italicized.

OMML to MathML element mapping

The following table shows how OMML elements are converted to MathML.

OMML element MathML output
<m:oMathPara> <math display="block">
<m:oMath> (inline) <math>
<m:f> (fraction, bar) <mfrac>
<m:f> (fraction, no bar) <mfrac linethickness="0"> (binomial)
<m:f> (fraction, skewed) <mfrac bevelled="true">
<m:f> (fraction, linear) <mrow>num<mo>/</mo>den</mrow>
<m:rad> (no degree) <msqrt>
<m:rad> (with degree) <mroot>
<m:d> (delimiter) <mrow><mo>(</mo>...<mo>)</mo></mrow>
<m:d> (with separators) <mrow><mo>(</mo>...<mo>\|</mo>...<mo>)</mo></mrow>
<m:nary> <munderover>, <munder>, or <msub>/<msup> with <mo> operator
<m:acc> <mover accent="true">
<m:bar> (top) <mover> with <mo> bar character
<m:bar> (bottom) <munder> with <mo> bar character
<m:groupChr> <munder> or <mover> with grouping character
<m:limLow> <munder>
<m:limUpp> <mover>
<m:func> <mrow> with <mo>&#x2061;</mo> (ApplyFunction)
<m:sSub> <msub>
<m:sSup> <msup>
<m:sSubSup> <msubsup>
<m:sPre> <mmultiscripts> with <mprescripts/>
<m:m> (matrix) <mtable> / <mtr> / <mtd>
<m:eqArr> <mtable> with alignment
<m:borderBox> <menclose notation="box">
<m:box> <mpadded>
<m:phant> <mphantom>
<m:r> (run) <mi>, <mn>, <mo>, or <mtext> depending on content

Attributes written during export

Attribute When used
display="block" On <math> for display-mode equations
mathvariant="normal" Multi-character <mi> that should be upright (e.g., function names)
mathcolor When the run has a non-default foreground color
mathbackground When the run has a non-default background color
accent="true" On <mover> when the overscript is an accent
accentunder="true" On <munder> when the underscript is an accent
stretchy On <mo> for stretchy delimiters and operators
separator="true" On <mo> for separator characters in delimited expressions
fence="true" On <mo> for fence/bracket characters
linethickness="0" On <mfrac> for no-bar fractions (binomials)
bevelled="true" On <mfrac> for skewed/inline fractions
columnalign On <mtable> or <mtd> for column alignment
rowalign On <mtable> or <mtr> for row alignment
notation On <menclose> for box/strike styles

Font handling during export

Rather than using the mathvariant attribute for styled characters, the export converts characters to their Unicode Mathematical Alphanumeric equivalents:

OMML style Unicode block Example
Bold U+1D400–U+1D433 A → 𝐀
Italic U+1D434–U+1D467 a → 𝑎
Bold italic U+1D468–U+1D49B x → 𝒙
Script U+1D49C–U+1D4CF L → 𝓛
Fraktur U+1D504–U+1D537 g → 𝔤
Double-struck U+1D538–U+1D56B R → 𝕽
Sans-serif U+1D5A0–U+1D5D3 x → 𝗑
Monospace U+1D670–U+1D6A3 x → 𝚡

This approach produces output compatible with MathML Core and does not depend on renderer support for the mathvariant attribute.


Character Encoding

Import encoding

The MathML importer accepts input in the following encodings:

  • UTF-16LE — used when MathML is received via the clipboard.
  • UTF-8 — used when MathML is read from files (e.g., ODF documents, HTML files). The XML declaration (<?xml version="1.0" encoding="UTF-8"?>) at the start of the input is optional.

Both encodings support the full Unicode range, including supplementary plane characters (U+10000 and above) via UTF-16LE surrogate pairs.

Export encoding

  • UTF-16LE — the default for clipboard output.
  • UTF-8 — for file-based export (ODF, PDF attributes).

The exported MathML uses literal Unicode characters throughout. Named character references (such as &alpha;) are never written. Numeric character references are used only when required by the XML serializer (e.g., &#x2061; for invisible operators in some code paths).


Clipboard support

The apps can copy and paste MathML for good interoperability with other apps that support MathML.

MathML placed on the clipboard during copy

Clipboard format name Description
MathML MathML Presentation markup (UTF-16LE)
MathML Presentation Same content as MathML, registered as a separate format for compatibility with applications that use this name

The CF_TEXT and CF_UNICODETEXT formats are also populated with MathML if the user has enabled the option for it.

Formats accepted during paste

When pasting, the apps check the clipboard for math-specific formats in the following priority order:

  1. MathML or MathML Presentation
  2. CF_UNICODETEXT / CF_TEXT — import as MathML is attempted and if it succeeds is kept. Otherwise, the app proceeds with attempting import of other formats.

HTML

MathML in HTML import

When MathML is embedded in an HTML document (e.g., pasted from a web page or opened as an HTML file), the HTML parser extracts <math>...</math> blocks and passes them to the MathML importer. In this context, over 2,000 HTML named character references are recognized, including:

  • Greek letters: &alpha;, &beta;, &Gamma;, etc.
  • Operators: &plus;, &minus;, &times;, &InvisibleTimes;, etc.
  • Relations: &le;, &ge;, &ne;, &equiv;, &subset;, etc.
  • Arrows: &rarr;, &larr;, &harr;, &Rightarrow;, etc.
  • Letterlike: &Afr; (fraktur A), &Aopf; (double-struck A), &Ascr; (script A), etc.
  • Invisible operators: &InvisibleTimes; (U+2062), &ApplyFunction; (U+2061), &InvisibleComma; (U+2063)

These named character references are defined by the HTML specification, not by XML or MathML. They are not recognized when importing standalone MathML XML (which only supports numeric character references such as &#x03B1; and &#945;).

MathML as an XML data island with xmlns prefix in HTML is also imported even though it is not rendered as math natively by web browsers.

MathML in HTML export

MathML is not currently written when exporting HTML. Equations in HTML export are rendered as images or omitted, depending on the application and export settings.


Open Document Format (ODF)

When loading and saving documents in Open Document Format (.odt, .odp), MathML is used as the equation format. When loading and saving Open Document Format, MathML is imported and exported in the same way as described above.


Accessibility

UI Automation (Windows)

On Windows, the MathML representation of each equation is exposed in the accessibility tree through a custom UI Automation (UIA) property. Assistive technologies such as screen readers can read this property to obtain a structured mathematical description of the equation content.

PDF/UA export

When exporting to PDF, equations are written with a custom attribute MSFT_MathML in the PDF/UA tags tree. This attribute contains the MathML markup for the equation. PDF readers that support this attribute can use it to make the mathematical content accessible to assistive technologies.


Limitations

Import limitations

  1. Content MathML not supported. Only Presentation MathML is imported. Content MathML elements (<apply>, <ci>, <cn>, <csymbol>, etc.) inside <annotation-xml> are ignored.

  2. <maction> partially supported. Only the first child of <maction> is rendered. The actiontype attribute and selection/toggle behavior are not supported.

  3. <mlabeledtr> label ignored. The element is treated as a regular <mtr>. The label (first child) is not displayed separately.

  4. <mstyle> attribute inheritance. Most attributes are inherited through <mstyle>, but some complex inheritance chains may not be fully resolved.

  5. <mpadded> sizing. The width, height, depth, and lspace adjustments are parsed but mapped to OMML phantom constructs, which have limited sizing control compared to MathML's flexible model.

  6. Line breaking. MathML line-breaking attributes (linebreak, linebreakstyle, lineleading, etc.) are not supported.

  7. mathvariant compound forms. The bold-script, bold-fraktur, bold-sans-serif, sans-serif-italic, and sans-serif-bold-italic variants are mapped to simpler OMML styles (losing the compound nature).

  8. <menclose> notation coverage. Only a subset of notation values are supported. Unsupported values (e.g., phasorangle, longdiv, actuarial) are ignored.

  9. <ms> string rendering. The <ms> element is treated similarly to <mtext>. Custom lquote and rquote attributes are recognized but the quoting behavior may differ from the MathML specification.

  10. Column/row spanning. The rowspan and columnspan attributes on <mtd> are parsed but OMML matrices do not support spanning, so these are ignored.

  11. intent. the MathML 4 intent attribute is not supported.

Export limitations

  1. No <semantics> or <annotation>. The exported MathML does not include semantic annotations or alternative representations.

  2. No equation numbering. Equation numbers/tags are not exported.

  3. Color export. mathcolor and mathbackground are exported, but color values that require theme resolution may not export correctly.

  4. Matrix alignment. Column alignment from OMML is exported, but complex alignment patterns (multiple alignment groups, alignment scopes) may not be fully preserved.

  5. Invisible operators. OMML function-apply constructs are exported with <mo>&#x2061;</mo> (ApplyFunction), but not all invisible operator distinctions are preserved.

  6. No MathML in HTML export. When saving to HTML, equations are not written as MathML.

Round-trip considerations

  • Import → Export: MathML imported into Office Math and then exported back to MathML produces semantically equivalent output, but the markup structure may differ. For example, <mfenced> in the input becomes <mrow> with <mo> elements in the output.

  • mathvariant → Unicode alphanumerics: Input using mathvariant="bold" is exported using Unicode math-alphanumeric characters (U+1D400+).

  • Character references → Characters: Named character references in the HTML input (e.g., &alpha;) are exported as literal Unicode characters (α). Both are semantically identical.


Requirements

Unless otherwise noted, the features described here are supported in Microsoft 365 Version 2606 (Build 20131.xxxxx) for Windows and Version 16.110 for Mac and later. Earlier versions support some, but not all of the features described here.