Markdown to LaTeX
Paste Markdown and get clean LaTeX source — headings, lists, tables, code blocks, links, images, and math all converted. Runs entirely in your browser, no upload, no sign-up.
Markdown to LaTeX, right in your browser
Paste a Markdown document and get clean, ready-to-compile LaTeX source. The
conversion runs entirely on your device with WebAssembly — your text is never
uploaded, there is no account, and there are no limits. Copy the result straight
into Overleaf, a local TeX editor, or an existing .tex file.
What gets converted
- Headings — both ATX (
#…######) and setext (a line underlined with===or---) map to\section,\subsection,\subsubsection,\paragraph, and\subparagraph. Use the heading offset option to demote every heading by 1–5 levels when you are pasting into an existing chapter. - Lists — bullet, numbered, and nested lists become
itemize/enumerateenvironments. GitHub task lists (- [x]/- [ ]) render with check and empty-box markers. - Tables — GitHub pipe tables become a
tabularwithbooktabsrules (\toprule/\midrule/\bottomrule) and per-columnl/c/ralignment taken from the:---:delimiter row. - Code — fenced blocks become
lstlisting(with the language passed through when you tag the fence), and indented blocks becomeverbatim. Code is emitted literally, so the LaTeX special characters inside it are left untouched. - Inline formatting —
**bold**,*italic*, and`code`become\textbf,\textit, and\texttt, and~~strikethrough~~becomes\sout. - Footnotes — a
[^id]reference plus a[^id]: textdefinition line becomes an inline\footnote{…}. - Links and images —
[text](url)becomes\href,becomes\includegraphics, and<https://…>autolinks become\url. - Blockquotes become a
quoteenvironment, and---rules become a full-width horizontal line.
Math and special characters
Inline $…$ and display $$…$$ math is passed through verbatim, so your
equations land in the output exactly as written. Everywhere else, the ten LaTeX
special characters (& % $ # _ { } ~ ^ \) in your prose are escaped
automatically — so a 100% discount or a file_name.txt won't break the build.
Fragment or full document
Leave Wrap in a full document off to get just the body, ideal for pasting
into a file you already have. Turn it on to get a complete, compilable file with
a \documentclass{article} preamble that already loads hyperref, graphicx,
listings, booktabs, array, and ulem — everything the converted
constructs need.
Private by design
Like every gizza tool, the conversion happens locally in your browser. Nothing is sent to a server, so it works offline and your documents stay yours.
FAQ
Which LaTeX packages does the output need?
In fragment mode you're responsible for the preamble: converted constructs use
hyperref (links), graphicx (images), listings (fenced code), booktabs +
array (tables), and ulem (strikethrough). Turn on Wrap in a full
document and the generated \documentclass{article} preamble loads all of
them for you, so the file compiles as-is.
Are my equations rewritten or escaped?
Neither — inline $…$ and display $$…$$ math is passed through verbatim,
character for character. Escaping only applies to prose (the ten TeX specials
like %, &, _) and never to math or code blocks, so 100% in a sentence
is escaped but x_1^2 inside $…$ is untouched.
What does the heading offset actually do?
It demotes every heading by 1–5 levels: with offset 1, # becomes
\subsection instead of \section, ## becomes \subsubsection, and so on.
That's the right knob when you're pasting the converted fragment into an
existing chapter. Levels that would fall past \subparagraph stay at
\subparagraph rather than breaking.
Can the conversion fail on messy Markdown?
No — the converter never errors on content. Anything it can't recognize as a block or inline construct degrades gracefully to escaped literal text, the same forgiving behavior a Markdown renderer has, so you always get compilable output to clean up rather than an error message.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool markdown-to-latex '# Title
Some **bold** and *italic* text with `code`.
- one
- two
| a | b |
|---|---|
| 1 | 2 |'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/markdown-to-latex/?markdown=%23%20Title%0A%0ASome%20%2A%2Abold%2A%2A%20and%20%2Aitalic%2A%20text%20with%20%60code%60.%0A%0A-%20one%0A-%20two%0A%0A%7C%20a%20%7C%20b%20%7C%0A%7C---%7C---%7C%0A%7C%201%20%7C%202%20%7C&full_document=true&heading_offset=0Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
