MathJax & LaTeX Preview Online: Compare MathJax 2, 3 and 4 Side by Side

Paste your LaTeX, MathML or HTML below for an instant online preview in MathJax 2.7.9, MathJax 3.2.2 and MathJax 4.1.3. Use it as a quick MathJax tester when upgrading versions, or to preview LaTeX equations before publishing.

How to use the MathJax comparison tool

  1. Paste or type your content into the editor, or pick one of the examples. HTML tags are rendered as-is.
  2. Wrap inline math in $...$ or \(...\), and display math in $$...$$ or \[...\].
  3. The three previews update automatically. Your content is saved in your browser.
  4. Click Copy share link to share exactly what you see with someone else.

What you can use this online MathJax preview for

Key differences between MathJax 2, 3 and 4

MathJax 2

The long-standing version used by many sites. It is configured with MathJax.Hub.Config and a text/x-mathjax-config script, and re-rendering uses MathJax.Hub.Queue. It is slower than newer versions and no longer actively developed.

MathJax 3

A full rewrite in TypeScript with much faster rendering. Configuration moved to a window.MathJax object, re-rendering uses MathJax.typesetPromise(), and some version 2 extensions and output modes were renamed or dropped. Output can differ slightly from version 2.

MathJax 4

Builds on version 3 with new default fonts covering many more characters, automatic line breaking for long equations, and improved accessibility. Glyph shapes and spacing can look different from version 3.

Frequently asked questions

Why does my equation look different in MathJax 3 or 4 than in MathJax 2?

MathJax 3 was a complete rewrite and MathJax 4 ships new fonts and line breaking, so spacing, glyphs and supported extensions can differ. Some MathJax 2 extensions and configuration options were renamed or removed.

Is my content sent to a server?

No. All rendering happens in your browser. Your content is only saved in your browser's local storage.

Which math delimiters are supported?

Inline math with $...$ or \(...\), and display math with $$...$$ or \[...\]. MathML and HTML are also supported.

Does it support chemistry equations with mhchem?

Yes. The mhchem extension is loaded in all three versions, so \ce{...} works everywhere. MathJax 2.7 uses an older version of mhchem by default, so newer syntax such as \pu{...} may not render there. See the mhchem examples guide.

How do I share my equations with someone?

Click Copy share link. Your content is compressed into the link itself, so nothing is uploaded and anyone who opens the link sees the same preview.

Can I preview a full LaTeX document here?

No. MathJax renders math only, so this online LaTeX preview works for equations, matrices, aligned environments and chemistry, but not document commands like \documentclass, \section or \includegraphics. For full documents, use a LaTeX compiler such as Overleaf.

Which MathJax version should I use?

For new sites, use MathJax 4. If you are on MathJax 3, upgrading to 4 is mostly a drop-in change, but check fonts and line breaking. If you are still on MathJax 2, plan a migration, because MathJax 3 and 4 use a different configuration and API. See MathJax 2 vs 3 vs 4.

MathJax guides