LaTeX & KaTeX Math Equation Preview
Real-time LaTeX math Markdown viewer and previewer. Write math equations in Markdown and see a pixel-perfect preview — inline formulas, block equations, matrices, and integrals rendered instantly with KaTeX.
Stop Debugging Math Equations in Git Commits
A single misplaced backslash or unmatched brace in a LaTeX equation breaks the entire formula — and on GitHub or documentation sites, that means raw unrendered text visible to every reader. Preview every formula here before you push.
KaTeX — The Fastest Engine
KaTeX renders math up to 100x faster than MathJax with no layout reflow. Your equations display immediately without visual jank.
GitHub-Compatible Syntax
Uses the same $...$ and $$...$$ delimiter conventions supported by GitHub, Jupyter Notebooks, Obsidian, and Notion.
Full Matrix & Alignment
Preview complex pmatrix, bmatrix, aligned equations, cases, and augmented matrices that are impossible to verify without a renderer.
Complete LaTeX / KaTeX Syntax Reference
Copy any snippet into the live editor above to instantly preview the rendered output.
Inline Math
$E = mc^2$
$\alpha, \beta, \gamma$
$x_i^2$
$\frac{a}{b}$$\sqrt{x}$$\infty$
Block / Display Math
$$ E = mc^2 $$
$$
\int_{a}^{b} f(x)\,dx
$$$$
\sum_{i=1}^{n} x_i
$$$$
\lim_{x \to \infty} f(x)
$$$$
\frac{\partial f}{\partial x}
$$Matrices & Arrays
$$
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
$$$$
\begin{aligned}
y &= 2x + 1 \\
y &= -x + 4
\end{aligned}
$$$$
f(x) = \begin{cases}
1 & x > 0 \\
0 & x \leq 0
\end{cases}
$$Quick-Copy KaTeX Cheatsheet
The 30 most-used KaTeX commands for academic and technical writing. Click any snippet to select all.
\frac{a}{b}\sqrt{x}\sqrt[n]{x}x^{n}x_{i}\int_{a}^{b} f(x)\,dx\iint_{D} f\,dA\sum_{i=1}^{n} x_i\prod_{i=1}^{n} a_i\lim_{x \to 0} f(x)\infty
\frac{\partial f}{\partial x}\nabla f
\vec{v}\|\vec{v}\|\left| x \right|
\lfloor x \rfloor
\mathbb{E}[X]\mathbb{P}(A)\mathbb{R}A^{\top}A^{-1}\vec{A} \cdot \vec{B}\vec{A} \times \vec{B}\forall x \in X
\exists x \in X
P \implies Q
P \iff Q
\binom{n}{k}\begin{aligned}
a &= b \\
c &= d
\end{aligned}KaTeX vs. MathJax vs. Plain Markdown
Understand which features are available in each renderer so you write portable, compatible math.
| Feature | KaTeX | MathJax | Plain MD | MarkdownPreview.net |
|---|---|---|---|---|
| Inline Math ($...$) | Zero-latency client render | |||
| Block / Display Math ($$...$$) | Auto-scales to viewport | |||
| Matrix environments | pmatrix / bmatrix / vmatrix | |||
| Aligned equations | Multiline aligned blocks | |||
| Live 2-way editing | Type Markdown / Edit HTML | |||
| Mermaid diagrams side-by-side | Same document | |||
| Render speed | Fast | Moderate | N/A | KaTeX (fastest) |
Who Uses LaTeX Math in Markdown?
From ML researchers to physics professors — math-in-Markdown is the universal format for technical writing.
Academic Papers & Theses
Format equations, cite theorems, and typeset publication-quality math for arXiv preprints, journal submissions, and thesis chapters — all in plain Markdown.
Scientific Documentation
Embed reaction equations, derivation steps, and numerical methods directly into README files and technical wikis without needing LaTeX installed.
Engineering & Physics
Write circuit analysis, signal-processing formulas, thermodynamics equations, and control-theory transfer functions in docs that render on any platform.
Machine Learning & Statistics
Typeset loss functions, gradient updates, probability distributions, and Bayesian inference formulas in Jupyter-style documents and course notebooks.
Common LaTeX in Markdown Pitfalls
Avoid these mistakes that cause equations to render as raw text instead of formatted math.
\( E = mc^2 \)
$E = mc^2$
GitHub and most Markdown renderers only support $ and $$ delimiters, not the LaTeX \( \) shorthand.
$ x^2 + y^2 $
$x^2 + y^2$
Some parsers treat "$ x" (space after dollar) as literal text. Avoid spaces immediately after opening $ or before closing $.
The variable x_i and x_j are...
The variable $x_i$ and $x_j$ are...
Underscores in plain text are parsed as italic/emphasis markers. Always wrap math expressions inside $.
\begin{pmatrix} a & b \ c & d \end{pmatrix}\begin{pmatrix} a & b \\ c & d \end{pmatrix}A new row in a KaTeX environment requires \\ (two backslashes). A single \ is an escape character.
Frequently Asked Questions
Everything you need to know about LaTeX math in Markdown.
Explore More Markdown Tools
All tools are free, client-side, and require no account.
Full CommonMark editor with real-time HTML preview, Mermaid, KaTeX, and one-click export.
Test GitHub READMEs, GFM alerts, task lists, and tables exactly as GitHub renders them.
Live flowcharts, sequence diagrams, class diagrams, Git graphs, and Gantt charts.
Practical tutorials: VS Code preview, GitHub rendering issues, browser workflows, and more.