Diagrams / Math

KaTeX (Math) Playground

Render TeX / LaTeX maths to HTML - fast, synchronous, lightweight.

Runtime: KaTeX

LaTeX

Rendered

Loading KaTeX…

About this playground

Write LaTeX math expressions on the left, see them typeset on the right. Renderer is KaTeX (~280 KB), which produces HTML + CSS synchronously - no flash of unstyled equation. Multiple blocks separated by blank lines render as separate display equations.

FAQs

KaTeX vs MathJax?

KaTeX is leaner and renders synchronously - no flash of unstyled formula. MathJax supports more obscure macros and packages. For typical CS / ML / stats notation, KaTeX is enough and noticeably faster.

Which TeX subset?

Most of LaTeX's math mode - sums, integrals, fractions, matrices, aligned equations, common Greek and operators. Some obscure packages (mhchem for chemistry, etc.) need plugins.

Can I copy the rendered HTML?

Use the Copy code button for the LaTeX source. To export the rendered formula as an image, screenshot or wrap the KaTeX HTML in an SVG <foreignObject>.

Other playgrounds