A MathJax alternative that doesn't keep readers waiting

MathJax took 2 seconds to put a week of lecture notes — 285 equations — on screen in our test. fxTeX Pro took under 0.04 seconds — at least fifty times faster — with spoken text for every equation. Same LaTeX, same page, same browser: yours, if you press the button below.

Race them in your browser Start with fxTeX, free

The race

The same lecture notes, three engines, each as it ships. They run one at a time, so none slows another down, and each clock stops when its engine says the last equation is drawn. The first run includes downloading each engine, as a first visit does; run it again and they come from the cache, as for a reader coming back.

fxTeX Pro
Spoken text on, as standard

The notes appear here, as raw LaTeX until the engine has drawn them.

Waiting to start

KaTeX
Makes no spoken text

The notes appear here, as raw LaTeX until the engine has drawn them.

Waiting to start

MathJax 4
As it ships: speech and enrichment on

The notes appear here, as raw LaTeX until the engine has drawn them.

Waiting to start

Every engine's own files are served from this site, so no one's CDN is faster than another's. MathJax 4 switches on semantic enrichment and speech by default; switch them off and the same notes take it about 0.11 s on our Mac — still several times fxTeX Pro's, and with no spoken text left. A phone is slower than our desk, for every engine. Run it in a tab you are looking at: a browser slows the timers of a tab in the background, and MathJax, which works in timed steps, suffers most. The page each lane loads is here, to read or to run on its own.

Why MathJax is so slow

A megabyte before the first equation

MathJax's combined script is 1 MB — over 280 kB gzipped — and its fonts and speech engine come after it. fxTeX is a sixth of that, and fxTeX Pro a third. On a phone, on a train, that is the difference between maths and a blank page.

Accessibility as an extra pass

MathJax typesets each equation, then works out its meaning in a second pass, then hands it to a separate speech engine. It is careful work, and in MathJax 4 it is on by default — which is where most of those 2 seconds go.

fxTeX does it in one

fxTeX reads the LaTeX once and writes MathML with its spoken text in the same pass. The browser draws MathML itself, so there is no layout of fxTeX's own to compute. That is the whole trick.

The published benchmark

The race is one page. This is the benchmark behind the home page: 57 equations, twenty cold page loads each, the median kept.

With spoken text, fxTeX Pro converts all 57 in 5.3 ms. MathJax takes 904 ms — 170 times as long.

57 equations, on a page the reader has visited before

Download size Converting all 57 With spoken text

Temml and KaTeX generate no spoken text.

Run the benchmark yourself →

Accessible as standard, not as a setting

Every equation fxTeX draws carries the words a screen reader should say. It is not an option to remember, and it costs a few milliseconds a page, not seconds — so nobody is tempted to switch it off to make the page load.

Spoken text with every equation

Real MathML, which screen readers understand, with the spoken text alongside it for those that need it — VoiceOver on a Mac relies on it entirely.

What a screen reader says, under the equation

Tested, in public

Our accessibility test bench shows each equation and the exact words a screen reader should speak for it, checked with JAWS, NVDA and VoiceOver. Run it with your own screen reader and judge for yourself.

Accessible maths for the web →

KaTeX makes none

We like KaTeX: it is small, quick and well made. But it draws maths with HTML and its own fonts, and keeps MathML only as a hidden copy for screen readers — with no spoken text of its own. For a university, a publisher or a public body, that is a gap.

Free, or faster

fxTeX is free, as KaTeX and MathJax are. fxTeX Pro is for pages with a lot of maths, and for the things the others cannot draw.

fxTeX Free

  • LaTeX to MathML in the reader's browser, with spoken text
  • 1,159 LaTeX commands, and mhchem for chemical formulae
  • A sixth of MathJax's download
  • No key, no sign-up, no limit, and it never contacts our servers to render

Start with fxTeX

fxTeX Pro From £30 a year

  • The same converter in WebAssembly: 2.7 times faster than fxTeX
  • 1,302 commands, and the chemfig, physics and picture packages
  • Chemical structures and labelled diagrams, drawn from LaTeX
  • SVG output, drawn in the page

From £30 a year with an Essential licence, which includes 200 service loads a month — plenty for an individual's site or course notes, not enough for a public site. Busier sites want Professional.

See the licences

Side by side

The same rows as our full comparison. Where MathJax is ahead, we say so.

fxTeX fxTeX Pro KaTeX MathJax
Speed and size
57 equations, with spoken text8.4 ms5.3 ms—904 ms
Payload that costs, gzipped43 kB110 kB75 kB281 kB
Input
LaTeX commands supported1,1591,3021,0331,254
Packagesmhchemmhchem, chemfig, physics, picturemhchemphysics and more
Output
MathMLYesYes(accessibility)Yes
SVGVia fxTeX ServerYes—Yes
Accessibility
Generated spoken textYesYes—Yes
Published screen-reader testsYesYes——

MathJax's accessibility is genuinely excellent, and in places ahead of ours: the claim is not that we read maths better, but that fxTeX gives you spoken text at a fraction of the cost. Free fxTeX knows a few fewer commands than MathJax; fxTeX Pro knows more. Each is listed, with an example, under Supported commands.

Switching over

Your LaTeX stays exactly as it is. Take out MathJax's script tag and put these two in its place:

<script src="https://fxtex.codecogs.com/fxtex.min.js"></script>
<script>
  fxTeX.render({
    delimiters: [...fxTeX.DEFAULT_DELIMITERS, ...fxTeX.LATEX_BRACKET_DELIMITERS]
  });
</script>

That scans the page for $…$, $$…$$, \(…\) and \[…\], as MathJax does, and converts each one. For fxTeX Pro the lines are in your licence manager, with your key filled in. The fxTeX documentation →

Questions

Is the race fair?

As fair as we can make it, and you can check. Each engine runs as its own project ships it, from files on this site, one at a time, on the same notes — the page each lane loads is public. MathJax runs with its own defaults, which in version 4 include speech; fxTeX Pro runs with its spoken text on too. The benchmark's own method is on its runner page.

Will my equations look the same?

They are drawn by the browser from MathML, in fxTeX's maths font, so they look like maths set by the browser rather than by MathJax. Most readers will not notice; a designer will. fxTeX Pro can draw SVG instead, where exact appearance matters.

What about my macros?

fxTeX accepts \newcommand but does not yet act on it, so macros defined in MathJax's configuration need writing out in full. If your pages lean on them, tell us which — it shapes what we build next.

What does fxTeX Pro cost?

From £30 a year, with an Essential licence: 200 service loads a month, plenty for an individual. A public site wants Professional, and a publisher or platform Enterprise. fxTeX itself is free, for everyone.

MathJax and KaTeX are the work of their own projects. CodeCogs is not affiliated with either.

Try it on the real thing

The full editor is on the home page, with suggestions as you type, history and every export format. It is free for non-commercial use — study, teaching, research or a personal site. Building it into something you sell needs a commercial licence.

Open the editor See licences

More ways to use it