How do I write math in Markdown?
Put LaTeX between dollar signs. Use $x^2$ for math inside a sentence, and $$ on the lines before and after an equation to display it on its own line.
FREE LATEX MARKDOWN PREVIEW
Write Markdown with $inline$ and $$display$$ LaTeX math and see the equations rendered with KaTeX instantly. Insert common symbols with one click, then copy the Markdown or save the page as HTML or PDF. Nothing is uploaded.
The probability density of a normal distribution with mean and standard deviation is:
About 95% of values fall within .
Math is rendered in your browser with KaTeX; nothing is uploaded. Use $…$ for inline math and $$…$$ on their own lines for display math. KaTeX supports most LaTeX math commands but not full LaTeX documents or packages.
Markdown has no math syntax of its own, so most apps borrow LaTeX's: math goes between single dollar signs for an inline expression, or between double dollar signs for a display equation. A renderer such as KaTeX or MathJax turns the LaTeX into typeset math.
GitHub, GitLab, Obsidian, Jupyter notebooks and Markdown readers such as Aero Markdown all use this convention, so math you write here works there too.
| Write | LaTeX | Renders |
|---|---|---|
| Inline math | $E = mc^2$ | Inside a sentence |
| Display math | $$ ... $$ | Centered, on its own line |
| Fraction | \frac{a}{b} | a over b |
| Square root | \sqrt{x} | √x |
| Power, index | x^{2}, x_{i} | x², xᵢ |
| Sum, integral | \sum_{i=1}^{n}, \int_a^b | Σ, ∫ with limits |
| Greek letters | \alpha, \beta, \pi | α, β, π |
| Matrix | \begin{pmatrix} a & b \\ c & d \end{pmatrix} | 2×2 matrix |
WHEN YOUR NOTES ARE FULL OF EQUATIONS
This page previews one document. Aero Markdown for Mac renders KaTeX math in every Markdown file you open, along with tables, code and Mermaid diagrams, offline and with no account.
7-day free trial · no payment details · macOS 14+
Put LaTeX between dollar signs. Use $x^2$ for math inside a sentence, and $$ on the lines before and after an equation to display it on its own line.
KaTeX is an open-source library that renders LaTeX math in web pages. It is fast and supports most LaTeX math commands; it is used by many Markdown apps and sites.
Yes. GitHub renders math between $ and $$ delimiters in Markdown files, issues and pull requests, so you can check your equations here before you commit.
Red text marks a LaTeX error, such as a misspelled command, a missing closing brace or a command KaTeX doesn't support. Hover the formula or check the braces near it.
Yes. Download HTML saves a single file whose equations use MathML, which modern browsers display natively. Save as PDF uses your browser's print dialog.
No. Markdown and math are rendered in your browser tab. Nothing is sent to a server or stored.