Live demo · Formula OCR
Turn a picture of an equation into LaTeX
Open a screenshot, a photo or a PDF, draw a box around one equation, and get the LaTeX for it next to a rendering you can check against the original. It runs on a small open-source model on a single CPU, with no account and no API behind it.
1 · Source
Drop an image or a PDF here
or paste a screenshot with Ctrl + V
Drag a box around one equation. Keep it tight, and take one equation at a time.
2 · LaTeX
Each equation you select appears here: the crop you drew, how the result renders, and the LaTeX itself, which you can edit. Compare the two pictures before you paste. The model is right most of the time and says so confidently either way.
How well it works
Measured on 32 equations from maths, physics and machine learning, rendered at four zoom levels. A reading counts only if it is the same formula as the source. One wrong symbol is a miss.
| Source zoom | Read exactly |
|---|---|
| 1x, a normal screenshot | 94% |
| 1.5x | 91% |
| 2x, a retina screenshot | 84% |
| 3x, a page rendered for print | 88% |
Each result is labelled with the model's own confidence. On the same set, confident was right 93% of the time, check it half the time, and likely wrong never. So a confident result is still wrong about one time in fourteen, which is why the crop and the rendering sit side by side.
These are clean renders in one font family, and the settings were tuned on this same set. Treat the numbers as the ceiling. Scans, photos and unusual fonts do worse.
Why the size of the crop decides everything
The model was trained on formulas drawn in a narrow range of sizes. Outside that range it does not get a little worse. It stops working, and what it returns is not noise but well-formed LaTeX for a different formula.
| Letter size reaching the model | Read exactly |
|---|---|
| 10 px | 38% |
| 14 to 20 px | 81 to 91% |
| 24 px | 19% |
| 30 px and up | 0% |
A retina screenshot or a PDF page rendered sharply enough to crop from is 30 px or more, so almost every real input starts in the last row. The fix is not a better model:
- Measure the stroke thickness of the writing in your box. It says how large the letters are whatever the resolution.
- Rescale the crop so the strokes are about 1.4 px, which puts the letters in the range the model reads.
- If the model is unsure, try two neighbouring sizes and keep the reading it is most confident in, because fonts differ in weight.
A box drawn by hand also tends to clip the line below. That sliver reads as more formula, so anything touching the edge of your box and standing apart from the rest is removed first. On boxes that include half of the next line, that takes exact readings from 34% to 84%.
What it cannot do, and what happens to your file
- One printed equation at a time. Not handwriting, not paragraphs of text, not tables, not a whole page in one go.
- Very wide or very tall equations do not fit the model's canvas at a readable size. The result is flagged when that happens. Select it in parts.
- Bold, blackboard and calligraphic letters are the most common misreads, along with small matrices.
A PDF never leaves your browser. The pages are drawn on your machine, and only the box you draw is sent to be read. That image is held in memory for the one request and is not saved or logged.
The model is pix2tex, an open-source formula recogniser, running on one CPU with no GPU and no paid API. To keep it free to run, each visitor is limited to 12 equations a minute and 150 a day.