LaTeX to HTML Converter
Convert LaTeX to HTML right here: paste a snippet or a whole .tex file and copy clean HTML with MathML for any web page.
How do you convert LaTeX to HTML?
- Paste your LaTeX into the left box, or press Example to load a full document.
- Check the preview. Anything the converter skipped is listed under it.
- Choose how math is written: MathML or KaTeX HTML.
- Press Copy HTML and paste the result into your page or CMS.
Should math be MathML or KaTeX HTML?
Pick MathML for most pages. Browsers draw it natively (Chrome and Edge since version 109, Firefox, Safari), screen readers can read it, and you add no CSS or scripts.
Pick KaTeX HTML when you need identical rendering everywhere. It needs the KaTeX stylesheet on your page, about 25 KB plus fonts.
Which LaTeX commands are supported?
| LaTeX | HTML you get |
|---|---|
\section, \subsection, \subsubsection | <h2> to <h4> |
$…$, \(…\) | inline math |
\[…\], $$…$$, equation, align, gather, multline | display math |
itemize, enumerate, description (nested too) | <ul>, <ol>, <dl> |
tabular with \multicolumn | <table> with colspan |
\textbf, \emph, \texttt, \underline | <strong>, <em>, <code>, <u> |
\href, \url, \footnote | links and numbered footnotes |
verbatim, \verb, figure, \caption | <pre>, <figure>, <figcaption> |
Which LaTeX features are not supported?
- Your own macros from
\newcommandare not expanded. \citeand\refshow the key in brackets, since HTML has no reference numbering.- TikZ and pgfplots drawings, and files pulled in with
\input. - Page layout such as margins, fonts and
\newpage. A web page has no pages.
Can you convert a whole .tex file?
Yes. Paste the full file: this LaTeX to HTML converter skips the preamble, keeps everything between \begin{document} and \end{document}, and turns \title into the page heading.
Images keep their file paths, so upload the image files next to the page.
How do you add the HTML to a web page?
Paste it inside your page's <main> or article area. With MathML nothing else is needed. With KaTeX HTML, add the KaTeX stylesheet to the page's <head>. In WordPress, use a Custom HTML block so the editor keeps the tags as they are.
More LaTeX tools
Free, in the browser, no sign-up.
Math symbols
Copy a symbol, or take its LaTeX command and HTML code.
Learn LaTeX
Short answers with code you can copy.
Text drafted with AI from the KaTeX and HTML documentation; checked by Cem Demir. See the editorial policy.