Help

LaTeX to MathML Converter: Paste Equations Into Word

Type or paste a LaTeX equation and this converter turns it into MathML as you type, with a preview so you can check it before you copy. The copied MathML is one standalone <math> element, ready to paste into Microsoft Word, where it becomes an editable equation, or into any web page or editor that reads MathML. It converts the math expression only, not a whole LaTeX document.

How to Convert LaTeX to MathML

  1. Type or paste your equation into the LaTeX expression box, for example \int_0^1 x^2 \, dx = \frac{1}{3}. It takes up to 5,000 characters.
  2. Check the Preview box. It is your browser's own rendering of the exact MathML that will be copied, so what you see is what you paste.
  3. Leave Display mode ticked for a block equation on its own line, or untick it for an inline equation that sits inside a sentence.
  4. Press Copy MathML. The button reads Copied! for a moment. The same markup, indented, is shown in the MathML code box if you want to select it by hand.

There is no Convert button: the result updates a split second after you stop typing. If the LaTeX has a mistake, the Preview shows a message instead and Copy MathML stays disabled until it is fixed.

How to Paste MathML Into Word

  1. Press Copy MathML in this tool.
  2. Click where the equation should go in your Word document.
  3. Paste with Ctrl+V (Cmd+V on a Mac). Word reads the MathML and inserts an editable equation, not a picture.

The copied text is plain text and contains only the <math> element, with no TeX annotation or extra wrapper, so nothing but the equation arrives. MathML is a W3C standard and Word, like most MathML-aware editors, accepts it. A web page can use it directly, because current browsers draw <math> natively.

What the MathML Looks Like

Each part of the equation becomes a tag. These are the core elements this tool produces for three small equations (inside the <math> wrapper, which also carries the xmlns and display attributes):

You typeMathML produced
x^2 + y^2 = z^2<mrow><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo>…
\frac{a}{b}<mfrac><mi>a</mi><mi>b</mi></mfrac>
\sqrt[3]{x}<mroot><mi>x</mi><mn>3</mn></mroot>

The tool shows this as indented, multi-line markup. It is presentation MathML: it describes how the equation looks, which is what Word and web pages need.

Block or Inline: What Display Mode Does

With Display mode ticked, the output is <math display="block">, an equation set on its own line. Unticked, it is <math display="inline">, made to sit inside running text. Switching it changes the copied markup straight away, and the Preview follows.

What LaTeX It Understands

The conversion uses KaTeX, so it reads the math commands KaTeX supports:

The align environment only works with Display mode ticked; with it unticked you get Invalid syntax. Use aligned if you need aligned rows in an inline equation. A macro that expands forever is stopped and also reports Invalid syntax.

Fixing Invalid Syntax

The message Invalid syntax near character N points at where parsing stopped. For example \foo stops at character 1, and \frac{a}{ stops at the end of the input because a brace is never closed. Check for a missing }, a misspelled command, or text that should be wrapped in \text{}. An input over 5,000 characters shows That is too long. The limit is 5,000 characters.

What It Does Not Do

It converts one LaTeX math expression to MathML and nothing else.

Writing the surrounding document in Markdown instead? Try Markdown to PDF. Checking the arithmetic in pasted text? Try the Text Math Checker.

Frequently Asked Questions

How do I convert a LaTeX equation to a Word equation?

Type or paste the LaTeX into the LaTeX expression box, check the Preview, and press Copy MathML. Then paste into your Word document: Word reads MathML pasted as text and turns it into an editable equation. If your version of Word leaves the markup as plain text, it does not read pasted MathML.

How do I paste MathML in Word?

Press Copy MathML, click where the equation should go in your Word document and paste with Ctrl+V (Cmd+V on a Mac). The copied text is a single standalone math element with nothing else around it, so only the equation is inserted.

What is MathML?

MathML is the W3C standard for writing equations as markup. It describes each fraction, root, sum and symbol as a tag, so browsers can draw it and word processors and screen readers can read it. LaTeX is a shorter notation for the same equation, which is why it is converted to MathML before it goes into Word.

What is the difference between MathML and LaTeX?

LaTeX is compact text made for typing, such as \frac{a}{b}. MathML is verbose XML made for software to read, such as an mfrac element holding two mi elements. They can describe the same equation. This tool goes from LaTeX to MathML only.

Does this convert MathML back to LaTeX?

No. It only converts LaTeX to MathML. It does not read MathML as input, and it does not write Word's own equation format or a .docx file.

Why does it say Invalid syntax?

The LaTeX could not be parsed. The message points to the character where parsing stopped when it can. The usual causes are a missing closing brace, a misspelled command such as \fraq, or an environment that needs Display mode. Copy MathML stays disabled until the LaTeX is valid.

Why does \begin{align} give Invalid syntax?

The align environment only works in display mode. Turn Display mode on, or use \begin{aligned} inside an inline equation instead.

Is my equation uploaded anywhere?

No. The conversion runs in your browser with KaTeX and nothing is sent or saved. The box accepts up to 5,000 characters.

Recommended

Helps keep the tools free. ✨

Images are for illustration only. As an Amazon Associate I earn from qualifying purchases.