Markdown to LaTeX Converter
Convert markdown to LaTeX and LaTeX to markdown online. Headings, lists, tables, code and math map to a compilable LaTeX document. Free, no signup.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{hyperref}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{listings}
\usepackage{xcolor}
\lstset{basicstyle=\ttfamily\small,breaklines=true,frame=single,columns=fullflexible}
\title{Heat transfer in thin films}
\author{R. Okonkwo}
\date{September 2026}
\begin{document}
\maketitle
\section{Introduction}
Thin films conduct heat \emph{anisotropically}; the in-plane conductivity $k_\parallel$ can exceed the cross-plane value $k_\perp$ by \textbf{an order of magnitude} \footnote{See Cahill et al., *Nanoscale thermal transport*, 2003.}. The ratio depends on film thickness $d$ and the phonon mean free path $\Lambda$.
\subsection{Model}
The steady-state temperature field satisfies
\[\nabla \cdot (k \nabla T) = -q\]
where $q$ is the volumetric heat source. We solve it with a finite-difference scheme:
\begin{lstlisting}[language=Python]
def solve(k, q, dx, iterations=1000):
T = np.zeros_like(q)
for _ in range(iterations):
T[1:-1] = 0.5 * (T[2:] + T[:-2] + dx**2 * q[1:-1] / k)
return T
\end{lstlisting}
\subsection{Results}
\begin{table}[h]
\centering
\begin{tabular}{rrr}
\toprule
Thickness (nm) & $k_\parallel$ (W/mK) & $k_\perp$ (W/mK) \\
\midrule
50 & 148 & 21 \\
200 & 152 & 63 \\
800 & 155 & 140 \\
\bottomrule
\end{tabular}
\end{table}
\begin{itemize}
\item Conductivity converges to the bulk value above 800 nm
\item Below 100 nm boundary scattering dominates
\begin{itemize}
\item Roughness matters more than composition
\end{itemize}
\end{itemize}
\begin{quote}
Measurements were taken at 300 K with a 3ω method; see \href{https://example.org/setup}{the setup}.
\end{quote}
\begin{figure}[h]
\centering
\includegraphics[width=0.8\linewidth]{figures/profile.png}
\caption{Temperature profile}
\end{figure}
\end{document}
Math in $…$ and $$…$$ passes through unchanged. Conversion runs in your browser.
What Is a Markdown to LaTeX Converter?
A markdown to latex converter rewrites markdown structure as LaTeX commands: headings become \section and \subsection, emphasis becomes \emph and \textbf, lists become itemize and enumerate environments, tables become tabular blocks, links become \href and code becomes lstlisting or minted. Writers draft in markdown because it is fast, then need md to tex output for a thesis template, a journal submission or a colleague who works in Overleaf.
The converter builds on the same parser the editor uses, so anything that renders here converts predictably, and math written for KaTeX passes through as LaTeX math without changes.
How to Convert Markdown to LaTeX
- Paste markdown into the left pane or open a .md file. Front matter with title, author and date fills \title, \author and \date.
- Pick the document class: article for papers, report or book when # should be a chapter.
- Choose how code blocks are written (lstlisting, minted, verbatim) and whether tables use booktabs rules.
- Leave Full document on for a compilable file, or turn it off to paste a fragment into an existing project.
- Copy the LaTeX or download document.tex and compile it with pdflatex or in Overleaf.
Markdown to LaTeX Syntax Map
| Markdown | LaTeX | Package |
|---|---|---|
| # / ## / ### | \section / \subsection / \subsubsection | — |
| **bold** *em* ~~del~~ | \textbf \emph \sout | ulem |
| `code` | \texttt{code} | — |
| ```python | lstlisting[language=Python] / minted | listings / minted |
| - item / 1. item | itemize / enumerate | — |
| [text](url) | \href{url}{text} | hyperref |
|  | figure + \includegraphics + \caption | graphicx |
| | table | | tabular with \toprule \midrule \bottomrule | booktabs |
| > quote | quote environment | — |
| [^1] | \footnote{...} | — |
| $x$ and $$x$$ | $x$ and \[x\] | amsmath |
LaTeX to Markdown and LaTeX to HTML
The reverse direction is a pragmatic parser rather than a full TeX engine: it recognises the commands most documents use and leaves the rest as text, which is enough to move a paper into a blog post, a wiki or a README. For latex to html, convert to markdown first and then use the Markdown to HTML converter; math stays in $ delimiters so KaTeX or MathJax can render it on the page.
When to Use Markdown to LaTeX
Use the markdown to latex converter when the final document must be typeset: thesis chapters, conference papers with a required class file, lab reports with numbered equations, or documentation that a publisher wants as .tex. Write and review in markdown, convert once the text is stable, and keep the markdown as the source for the web version. Everything runs in your browser and the tool never modifies your math.
Frequently Asked Questions
Does the markdown to latex converter produce a compilable document?
Yes when Full document is on. The markdown to latex output starts with \documentclass, loads only the packages the body needs (hyperref, graphicx, booktabs, listings or minted, ulem) and wraps the content in \begin{document}. Paste it into Overleaf or run pdflatex; minted additionally needs --shell-escape and Pygments.
What happens to math?
Inline $...$ and display $$...$$ math are copied through untouched, so KaTeX-style formulas written in markdown compile as LaTeX math. Display blocks are written as \[ ... \]. Special characters in ordinary text (%, &, _, #, $) are escaped.
Can I convert LaTeX to markdown?
Switch the direction. The latex to markdown parser handles sections, emphasis, \texttt, itemize and enumerate (nested), \href and \url, verbatim and lstlisting, simple tabular tables, quotes, figures and footnotes, removes comments and strips common layout macros. Complex macros and custom environments are left as text.
How are headings mapped?
With the article class, # becomes \section, ## \subsection and ### \subsubsection. Choose report or book to start at \chapter so # becomes \chapter and ## \section. Deeper levels map to \paragraph and \subparagraph.
Is md to tex conversion done on a server?
No. Both directions run in your browser; nothing is uploaded. Download the .tex file or copy it straight into your editor.