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.
- Your LaTeX, unchanged
- MathML
- Spoken text
- SVG
- Chemistry
- Pictures
- fxTeX is 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.
The notes appear here, as raw LaTeX until the engine has drawn them.
Waiting to start
The notes appear here, as raw LaTeX until the engine has drawn them.
Waiting to start
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.
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.
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.
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
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.
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 text | 8.4 ms | 5.3 ms | — | 904 ms |
| Payload that costs, gzipped | 43 kB | 110 kB | 75 kB | 281 kB |
| Input | ||||
| LaTeX commands supported | 1,159 | 1,302 | 1,033 | 1,254 |
| Packages | mhchem | mhchem, chemfig, physics, picture | mhchem | physics and more |
| Output | ||||
| MathML | Yes | Yes | (accessibility) | Yes |
| SVG | Via fxTeX Server | Yes | — | Yes |
| Accessibility | ||||
| Generated spoken text | Yes | Yes | — | Yes |
| Published screen-reader tests | Yes | Yes | — | — |
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.
More ways to use it
- Online equation editorWrite maths visually or in LaTeX, and copy it out as MathML, SVG or PNG.
- Maths equationsThe common formulae ready to edit, and a maths question to try each day.
- Chemistry equationsReactions, formulae and molecular structures, with a toolbar made for chemistry.
- Chemical structure editorDraw a molecule and get chemfig LaTeX for reports, web pages and exercises.
- Picture editorDraw diagrams with lines, arrows, curves and labels, kept as LaTeX.
- LaTeX equation editorType LaTeX and edit the rendered equation directly; the two stay in step.
- MathML editorClean MathML with its spoken text, from LaTeX or from the visual editor.
- Accessible mathsEvery equation carries generated spoken text, tested with screen readers.
- Equations in WordPaste an equation into Word as a native equation you can still edit.
- CKEditor pluginAn fx button for CKEditor 5 that inserts MathML or an SVG image.
- LaTeX to SVG and PNGAn image of any equation from a single URL, with nothing to install.
- MathType alternativeHow the editor compares with MathType, gaps included.
- How we compareThe editor beside MathType, Overleaf, Mathpix and Word.
