Running since 2005, and used daily by 150,000+ websites & apps.
fxTeX Server works behind the scenes to rapidly deliver equations to website pages, through the use of a simple URL in the form:
https://fxtex.codecogs.com / type . format ? LaTeX-Markup
This is typically used within a single HTML image tag, which is the fastest and easiest way to add mathematics to any existing website e.g.:
<img src="https://fxtex.codecogs.com/svg.image?1+sin^2(x)" />
A request is /type.format?LaTeX. type is what is produced, format is how it arrives:
| Type | Produces |
|---|---|
| mathml | MathML markup, with spoken text for screen readers. |
| mathml_nospeech | The same markup, without the spoken text. |
| svg | A vector image, every character an outline — needs no font installed. |
| svgtext | The same, characters left as text. Smaller and selectable, but needs the font. |
| png | That SVG rendered to a bitmap. |
| gif | The same, as a GIF. |
| Format | Delivery |
|---|---|
| image | The result itself — markup for mathml, the image bytes otherwise. |
| json | A JSON object wrapping the result, with any conversion errors. |
| download | As image, but sent as a file download. |
Access and registration covers licensing and domains; the Documentation covers the rest.
MathML is rendered by your browser. Since 2023 most modern browsers do this well. However, if you want to small improvements to the layout then fxTeX can produce additional styles that are scoped to equations it generates. To enable this add these lines to the top of your HTML page:
<link rel="stylesheet" href="https://fxtex.codecogs.com/fxtex.css">
The same converter, compiled to JavaScript, doing the whole job in the page:
<script src="https://fxtex.codecogs.com/fxtex.min.js"></script>
<script>fxTeX.autoRender()</script>
It renders the LaTeX already on your page, between $…$ and $$…$$, and carries its own stylesheet. Call fxTeX.render() again after adding more.
Free, and no request reaches this server: nothing to authenticate, no allowance, and equations that survive this server being down. Ask for an image where scripts cannot run — an email, a feed — or when you need a file.
Equations are accessible by default. mathml carries the spoken form of the equation — the words a screen reader reads out, generated from the finished MathML — alongside the equation itself. The <math> is marked aria-hidden and the spoken text sits beside it, so a reader announces one or the other but never both:
<span class="cc-math fxtex"><math aria-hidden="true" …>…</math><span class="cc-speech">x squared</span></span>
That spoken text is hidden from sight by the stylesheet above, so link fxtex.css whenever you use mathml — without it the words appear as ordinary text next to the equation. If you would rather not, ask for mathml_nospeech, which returns the bare <math> and leaves accessibility to the browser's own MathML support.
Rendering needs a licence, from editor.codecogs.com. Most sites need no key and no code.
Nothing to add. A licence covers its domain and everything beneath it — example.com also renders on shop.eu.example.com — and the browser sends the page address for you.
Where there is no page to check, send the key as a header:
X-API-Key: sk_live_…
An <img> tag, a wiki, a CMS field. The same key goes first in the path:
https://fxtex.codecogs.com/sk_live_…/svg.image?1+\sin(x^2)
A key in a URL is visible to anyone reading the page. Use the header where you can.
An unlicensed request returns a small image saying so, in place of the equation.
https://fxtex.codecogs.com/mathml.image?
https://fxtex.codecogs.com/svg.image?
https://fxtex.codecogs.com/png.image?
https://fxtex.codecogs.com/gif.image?
https://fxtex.codecogs.com/mathml.json?
Loading…