LaTeX → MathML Converter
Turn a LaTeX math expression into clean MathML markup — accessible, selectable, and ready to paste into HTML, EPUB or Office documents. Runs entirely in your browser, no server, no sign-up.
About this tool
Paste a LaTeX math expression and get back MathML — the W3C standard for mathematics on the web. Unlike a rendered image, MathML stays text: it's read correctly by screen readers, can be selected, copied and searched, scales with the surrounding font, and drops straight into HTML pages, EPUB e-books, DocBook and Office documents.
Write the expression in math mode with no surrounding $ — for example
\frac{a}{b}, x^2, \sqrt{x+1}, \sum_{i=1}^{n} i, \alpha + \beta, or
\left(\frac{a}{b}\right). The converter outputs a single
<math xmlns="http://www.w3.org/1998/Math/MathML">…</math> element.
What it supports
- Fractions (
\frac,\binom), roots (\sqrt, with optional index) - Superscripts and subscripts, including grouped
{…}exponents - Greek letters, blackboard/bold/calligraphic fonts (
\mathbb,\mathbf, …) - Big operators with limits (
\sum,\prod,\int) and relations/arrows - Scalable delimiters via
\left…\right - Matrix and align environments, and explicit spacing
Options
- Display mode —
block(default) emits a centred standalone equation (display="block");inlineflows the equation within a line of text. - Pretty-print — indent the output with one element per line for readable, diff-friendly markup. Off by default for compact single-line output.
Everything runs locally in your browser via WebAssembly — your expressions are never uploaded.
FAQ
Do I include the $ … $ (or \[ … \]) delimiters?
No — paste only the math-mode content itself, e.g. \frac{a}{b} rather than
$\frac{a}{b}$. Whether the equation is standalone or in-text is controlled
by the Display mode option instead of delimiters.
What's the difference between block and inline mode?
block (the default) emits <math display="block"> — a centred, standalone
equation with large operator limits. inline emits <math display="inline">,
sized to flow inside a line of text. It changes only the display attribute
and rendering style; the expression markup is the same.
Is every LaTeX command supported?
Math mode is covered well — fractions, \binom, roots with indices,
sub/superscripts, Greek letters, font styles like \mathbb, big operators
with limits, \left…\right delimiters, and matrix/align environments. Custom
\newcommand macros and text-mode LaTeX (sections, itemize, …) are out of
scope, and an unrecognized command is reported as a conversion error rather
than silently dropped.
When should I turn on pretty-print?
Turn it on when the MathML will be read or diffed by humans — it indents the output with one element per line. Leave it off (the default) when embedding in a page, where the compact single-line form keeps payloads smaller. The two forms are semantically identical.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool latex-to-mathml '\frac{-b \pm \sqrt{b^2 - 4ac}}{2a}'New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/latex-to-mathml/?latex=%5Cfrac%7B-b%20%5Cpm%20%5Csqrt%7Bb%5E2%20-%204ac%7D%7D%7B2a%7D&display=block&pretty=trueMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
