Swelıty
Tools for everyone

Free Online LaTeX Playground

Write LaTeX maths and see it typeset live. Fractions, sums, integrals, matrices and aligned equations, each formula shown on its own.

Auto-run is on, so the formulas update as you type. Write LaTeX maths. Separate formulas with a blank line, and each one is shown on its own. Errors show under the formula.

LaTeX

Preview

How to use

  1. Type a formula in the editor, for example \frac{a}{b} or e^{i\pi} + 1 = 0.

  2. Separate formulas with a blank line. Each one is typeset on its own.

  3. Watch the formulas update as you type, or turn off Auto-run and press Run.

  4. Fix any formula that shows a red message. The message says what KaTeX did not understand.

  5. Copy the code, download a zip of your files or clear the editor with the icons above it.

  6. Open the full screen editor for more room, and use the A buttons to resize the text.

  7. Press Format to tidy the tab you are editing, or untick Wrap long lines to scroll sideways instead.

Why use this tool

  • KaTeX

    Fast, high-quality typesetting of the LaTeX maths that most documents use.

  • Many formulas at once

    Blank lines split the text into separate formulas, so you can build a whole sheet of equations.

  • Clear errors

    A formula with a mistake shows KaTeX's message under it and does not stop the others.

  • Safe by design

    Formulas cannot add links or load anything, and the preview runs no scripts of yours.

  • One-click formatting

    Tidy the indentation and spacing of the tab you are editing with one click or Shift + Alt + F.

  • Comfortable editor

    Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.

About this tool

Typeset maths from LaTeX as you type. Write formulas in LaTeX syntax and see them rendered with KaTeX, a fast maths renderer. This online LaTeX editor handles fractions, roots, sums, integrals, matrices and aligned equations, so you can check a formula before it goes into a document or learn LaTeX maths. Separate formulas with a blank line and each is shown on its own, with a clear message under any formula that has a mistake.

The LaTeX Playground is a quick way to check a formula, learn LaTeX maths or prepare an equation before it goes into a document. Type LaTeX on one side and the rendered formula appears on the other as you type. If a formula has a mistake, a clear message under it says what is wrong, so you can fix it and carry on. A one-click button tidies your code.

You can write many formulas in one go by separating them with a blank line, and mix text with maths. Rendering uses KaTeX, so it is quick. For general code to try in the browser, see the JavaScript Playground and the CSS Playground.

Frequently asked questions

The maths commands that KaTeX supports, which cover most everyday maths: fractions, roots, sums, integrals, limits, matrices, Greek letters, accents and aligned equations with \begin{aligned}. It is not a full LaTeX document engine, so packages and text layout commands are not available.

Leave a blank line between formulas. Each block is typeset on its own. A line that starts with % is a comment.

Use \text{...} inside a formula for words, for example x = 2 \text{ when } y = 4.

Download saves a page that typesets your formulas, and the formulas can be copied from the preview. Copy copies your LaTeX source.

Yes, the first time. KaTeX and its fonts are loaded from a public CDN when you open the page.

Yes. Press Format, or Shift + Alt + F while you are typing, to tidy the tab you are editing. If the code has a syntax error it is left unchanged and the problem is shown under the editor.

Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.

Use \\frac{a}{b}. For example, \\frac{1}{2} shows one half. Roots use \\sqrt{x}, sums use \\sum_{i=1}^{n} and integrals use \\int_a^b.

Yes, for maths. You write LaTeX maths and see it rendered with KaTeX as you type. It is for formulas, not for whole documents.