styleLatex
All free tools

LaTeX to HTML

Paste LaTeX or upload a .tex file and this LaTeX to HTML converter writes clean, semantic HTML as you type, with a live preview. Choose how equations are rendered and whether you want a fragment for an existing site or a complete page.

Converted in your browser. Nothing is uploaded.

Preview

HTML

<h1>The Gaussian integral</h1>
<p>The integral <span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∫</mo><mrow><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><mi mathvariant="normal">∞</mi></msubsup><msup><mi>e</mi><mrow><mo>−</mo><msup><mi>x</mi><mn>2</mn></msup></mrow></msup><mtext> </mtext><mi>d</mi><mi>x</mi></mrow><annotation encoding="application/x-tex">\int_{-\infty}^{\infty} e^{-x^2}\,dx</annotation></semantics></math></span> appears throughout
probability.<sup class="footnote-ref"><a href="#fn1" id="fnref1">1</a></sup></p>
<div class="math display"><span class="katex"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mo>∫</mo><mrow><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><mi mathvariant="normal">∞</mi></msubsup><msup><mi>e</mi><mrow><mo>−</mo><msup><mi>x</mi><mn>2</mn></msup></mrow></msup><mtext> </mtext><mi>d</mi><mi>x</mi><mo>=</mo><msqrt><mi>π</mi></msqrt></mrow><annotation encoding="application/x-tex">\int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi}</annotation></semantics></math></span></div>
<h2>Two proofs</h2>
<ol>
<li><strong>Polar coordinates</strong>: square the integral.</li>
<li><em>Feynman's trick</em>: differentiate under the integral.</li>
</ol>
<table>
<thead>
<tr>
<th>Method</th>
<th style="text-align:right">Steps</th>
</tr>
</thead>
<tbody>
<tr>
<td>Polar</td>
<td style="text-align:right">3</td>
</tr>
<tr>
<td>Series</td>
<td style="text-align:right">5</td>
</tr>
</tbody>
</table>
<section class="footnotes">
<ol>
<li id="fn1">See also <a href="https://en.wikipedia.org/wiki/Gaussian_integral">https://en.wikipedia.org/wiki/Gaussian_integral</a>. <a href="#fnref1" class="footnote-back">↩</a></li>
</ol>
</section>

Starting from a PDF or a scan rather than .tex? Convert it to LaTeX first.

Convert a PDF

How to convert LaTeX to HTML

Paste or upload the LaTeX

Paste a whole paper or a few paragraphs, or upload a .tex file. The preamble is skipped, the title and authors are read, and the body is converted as you type. The LaTeX to HTML conversion runs in your browser, so drafts and unpublished papers stay on your computer.

Choose how math is rendered

MathML is understood by every current browser and screen reader and needs nothing else. KaTeX HTML looks identical everywhere but needs the KaTeX stylesheet. Leave for MathJax keeps \(…\) and \[…\] for a page that already loads MathJax.

Check the preview, then copy

The preview shows the converted page in a sandbox. Copy an HTML fragment to paste into a blog, CMS or static site template, or a complete page with a readable built-in style that you can open or upload as it is.

What the HTML contains

Structure and text

Sections become h1 to h6, paragraphs become p, \emph and \textbf become em and strong, \texttt becomes code, and \href becomes a link. Lists, quotes and theorem labels carry over, and footnotes become numbered superscripts with a notes section and back links at the end.

Equations

Inline and display math, including align and gather environments, are rendered by KaTeX at conversion time, so the LaTeX to HTML output shows equations without any script. Every formula keeps its LaTeX source in an annotation, which helps copying and search.

Tables, figures and code

tabular environments become HTML tables with each column's alignment, figures become img elements with the caption as alt text, and verbatim or lstlisting blocks become pre and code with the language noted. Text is always escaped, so nothing in the LaTeX can inject markup.

Publishing the result

On a website or blog

Paste the fragment into WordPress, Ghost or a static site template, or upload the complete page as it is. A personal academic page can link the PDF and show the abstract and key results in HTML, which search engines index far better than a PDF.

Accessibility

HTML reflows on phones and works with screen readers. MathML in particular lets readers such as NVDA with MathCAT or VoiceOver speak equations, which a PDF rarely allows. That is a common reason to run a LaTeX to HTML conversion for course material.

Limits worth knowing

Custom macros keep only their text, TikZ pictures and page layout are dropped, and \ref shows the label instead of a number. If your site is built from Markdown, convert to Markdown instead and let the site generator write the HTML.

LaTeX to Markdown

Official references: HTML Living Standard · Pandoc manual

LaTeX to HTML: styleLatex card with the tool's purpose and a code sample | LaTeX to HTML

LaTeX and HTML questions

Is LaTeX similar to HTML?
Both are markup languages that mix text with commands, but LaTeX typesets pages for print and PDF while HTML describes content for browsers. Their structure maps well, which is why a LaTeX to HTML conversion keeps sections, lists and tables.
How to use LaTeX in HTML?
For equations, load MathJax or KaTeX on the page and write \(…\) or \[…\], or convert the math to MathML ahead of time as this tool does. Whole LaTeX documents need converting rather than embedding.
How to make a LaTeX table in HTML?
Paste the tabular environment into the LaTeX to HTML converter and you get a table with thead and tbody and each column's alignment. Merged cells are flattened, since this conversion writes simple tables.
How to compile LaTeX PDF HTML personal website?
Keep the PDF for download, and convert the abstract or full text to HTML for the page itself. A complete page from this converter can be uploaded directly, or the fragment placed in your site template.
How do I convert LaTeX to HTML with Pandoc?
For a LaTeX to HTML conversion with Pandoc, run pandoc paper.tex -s --mathml -o paper.html, or --mathjax for MathJax. Pandoc follows \input files and handles bibliographies with --citeproc.
How do I convert LaTeX to HTML in Python?
Call Pandoc through pypandoc: pypandoc.convert_text(tex, 'html', format='latex', extra_args=['--mathml']). plasTeX is a pure Python alternative.
Can Overleaf export LaTeX to HTML?
No, Overleaf compiles to PDF only. Download the project source, open main.tex, and convert it here or with Pandoc.
How does arXiv turn LaTeX papers into HTML?
arXiv runs LaTeXML on the submitted source to build its HTML versions, with math as MathML. Papers that use unusual packages sometimes convert with gaps.
Is LaTeX converted to HTML more accessible than a PDF?
Usually yes. HTML reflows for zoom and small screens, and screen readers can navigate headings and speak MathML equations, which most PDFs do not support well.
How do I put a single LaTeX equation into HTML?
Paste just the equation between \[ and \] here and copy the fragment, or use the share page to get it as an image or a link.
Is there a JavaScript or npm library for LaTeX to HTML?
For math only, KaTeX and MathJax are the standard libraries. latex.js renders whole LaTeX documents in the browser, with a limited set of packages.
Is this LaTeX to HTML converter free online?
Yes. It is free, needs no sign-up and processes the file in your browser.
Should I choose MathML, KaTeX or MathJax for the math?
MathML for the simplest, most accessible result with no extra files. KaTeX HTML for identical rendering in every browser, at the cost of a stylesheet. MathJax when your site already loads it.
What happens to figures and PDF images?
In LaTeX to HTML output, each \includegraphics becomes an img with the same path and the caption as alt text. Browsers do not display PDF images, so export figures as PNG or SVG and update the paths.

Have a whole page of notes, a scan or a PDF? Convert it to LaTeX that compiles.

Convert a file