KaTeX vs LaTeX
By imagetolatex team · Published
LaTeX is a complete typesetting system: it turns a .tex source file with text, math, references and figures into a PDF. KaTeX is a JavaScript library that only renders the math part of LaTeX syntax on web pages. They share the formula language — \frac{a}{b} means the same in both — but KaTeX cannot compile documents, load packages or number equations across a paper.
Side by side
| LaTeX | KaTeX | MathJax | |
|---|---|---|---|
| What it is | Typesetting system (TeX engine + macros) | JavaScript math renderer | JavaScript math renderer |
| Input | Whole .tex documents | Formulas only | Formulas only |
| Output | HTML on a web page | HTML, SVG or MathML | |
| Packages | Thousands (CTAN) | None; a fixed set of commands | Extensions for many packages |
| Speed | Compiles the whole file | Very fast, renders synchronously | Slower, more complete |
| Typical use | Papers, theses, books, slides | Notion, VS Code preview, fast sites | GitHub, Jupyter, Obsidian, MathOverflow |
LaTeX that does not work in KaTeX
\usepackageand anything that needs a package KaTeX does not implement (TikZ, siunitx, chemistry packages).- Document structure: sections, lists, tables made with tabular, figures,
\cite. - Equation numbering and cross-references with
\labeland\refacross a document. - Macros defined in one block are usually not available in another, depending on the app.
Most everyday math works the same: fractions, roots, sums, integrals, matrices, cases, aligned and the AMS symbols. When a formula fails in an app, test it in a full renderer first.
And MathJax?
MathJax is the other major web renderer. It supports more of LaTeX than KaTeX, reads extensions for many packages and has strong accessibility features (speech, MathML). KaTeX is faster and lighter. For a reader, the visible difference is small; for a site owner it is speed versus coverage.
Checking a formula before you paste it
The LaTeX equation editor renders with MathJax as you type and shows errors under the input, so you can fix a formula before pasting it into Notion, a website or Word.

FAQ
- Is KaTeX the same as LaTeX?
- No. KaTeX renders the math part of LaTeX syntax on web pages; LaTeX typesets complete documents into PDF.
- Can I use KaTeX to write a paper?
- No. Use LaTeX (for example in Overleaf) for papers; KaTeX is for showing formulas on web pages and in apps.
- Is KaTeX faster than MathJax?
- Yes, KaTeX is built for speed and renders synchronously. MathJax supports more commands and accessibility features.
- Which apps use KaTeX?
- Notion and the VS Code Markdown preview use KaTeX; GitHub, Jupyter and Obsidian use MathJax.