KaTeX Math Rendering Engine

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.

KaTeX Spec CompliantLive 2-Way Editing
161 words1,145 chars29 lines
Why preview LaTeX before publishing?

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

Inline equationWrap with single $
$E = mc^2$
Greek lettersBackslash + name
$\alpha, \beta, \gamma$
Subscript / SuperscriptUse _ and ^
$x_i^2$
Fractions\frac{numerator}{denominator}
$\frac{a}{b}$
Square rootNth root: \sqrt[n]{x}
$\sqrt{x}$
InfinityUse \infty
$\infty$

Block / Display Math

Display equationWrap with double $$
$$
E = mc^2
$$
IntegralUse \int with limits
$$
\int_{a}^{b} f(x)\,dx
$$
SummationUse \sum with limits
$$
\sum_{i=1}^{n} x_i
$$
LimitUse \lim
$$
\lim_{x \to \infty} f(x)
$$
Partial derivativeUse \partial
$$
\frac{\partial f}{\partial x}
$$

Matrices & Arrays

2x2 Matrixpmatrix = round brackets
$$
\begin{pmatrix}
a & b \\
c & d
\end{pmatrix}
$$
Aligned equationsUse & for alignment column
$$
\begin{aligned}
y &= 2x + 1 \\
y &= -x + 4
\end{aligned}
$$
Cases / PiecewiseGreat for piecewise functions
$$
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.

Fraction
\frac{a}{b}
Square root
\sqrt{x}
Nth root
\sqrt[n]{x}
Superscript
x^{n}
Subscript
x_{i}
Integral
\int_{a}^{b} f(x)\,dx
Double integral
\iint_{D} f\,dA
Summation
\sum_{i=1}^{n} x_i
Product
\prod_{i=1}^{n} a_i
Limit
\lim_{x \to 0} f(x)
Infinity
\infty
Partial derivative
\frac{\partial f}{\partial x}
Gradient
\nabla f
Vector
\vec{v}
Norm
\|\vec{v}\|
Absolute value
\left| x \right|
Floor
\lfloor x \rfloor
Expectation
\mathbb{E}[X]
Probability
\mathbb{P}(A)
Real numbers
\mathbb{R}
Transpose
A^{\top}
Inverse
A^{-1}
Dot product
\vec{A} \cdot \vec{B}
Cross product
\vec{A} \times \vec{B}
For all
\forall x \in X
There exists
\exists x \in X
Implies
P \implies Q
Equivalent
P \iff Q
Binomial coeff
\binom{n}{k}
Aligned equations
\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.

FeatureKaTeXMathJaxPlain MDMarkdownPreview.net
Inline Math ($...$)Zero-latency client render
Block / Display Math ($$...$$)Auto-scales to viewport
Matrix environmentspmatrix / bmatrix / vmatrix
Aligned equationsMultiline aligned blocks
Live 2-way editingType Markdown / Edit HTML
Mermaid diagrams side-by-sideSame document
Render speedFastModerateN/AKaTeX (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.

Using \( \) or \[ \] delimiters
❌ Wrong
\( E = mc^2 \)
✅ Correct
$E = mc^2$

GitHub and most Markdown renderers only support $ and $$ delimiters, not the LaTeX \( \) shorthand.

Spaces inside delimiters
❌ Wrong
$ x^2 + y^2 $
✅ Correct
$x^2 + y^2$

Some parsers treat "$ x" (space after dollar) as literal text. Avoid spaces immediately after opening $ or before closing $.

Unescaped underscores in mixed text
❌ Wrong
The variable x_i and x_j are...
✅ Correct
The variable $x_i$ and $x_j$ are...

Underscores in plain text are parsed as italic/emphasis markers. Always wrap math expressions inside $.

Missing \\ for new lines in matrices
❌ Wrong
\begin{pmatrix} a & b \ c & d \end{pmatrix}
✅ Correct
\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.