image-to-text · image → LaTeX · WASM · ~320 MB
Paste, drop or upload an image of a mathematical equation and the model reads it and writes the LaTeX that produces it — fractions, integrals, sums, roots, super/subscripts and all. It's OCR-free end to end: a vision encoder looks at the whole formula and a decoder generates the markup. Everything runs on your device — the image never leaves the tab.
| Model | Xenova/texify (ONNX build of vikp/texify) |
|---|---|
| Task / pipeline | image-to-text (vision-encoder-decoder) |
| Output | LaTeX source for the equation in the image |
| Architecture | Donut-Swin vision encoder + mBART decoder (OCR-free, generative) |
| Quantization | q8 (8-bit) ONNX, merged decoder for cached generation |
| Backend | WebAssembly (runs anywhere; no WebGPU needed) |
| Download | ~320 MB, cached after first load |
| License | cc-by-sa-4.0 (base model vikp/texify) |
Paste an image (Ctrl/⌘+V), drop a file, or try a sample. The equation image is read locally and the LaTeX is generated token by token.
Drop an equation image, paste from the clipboard, or:
Math is hard to search, edit or read aloud when it's trapped in a picture. Turning an equation image back into LaTeX — on-device — means you can lift formulas out of textbooks, papers, whiteboards or screenshots without uploading anything.
It's a best-effort recogniser for a single, reasonably clean equation: it nails structure (fractions, integrals, sums, roots) but can slip on an ambiguous character (a stylised E vs H) or very dense/handwritten input. Treat the LaTeX as a strong first draft — the re-typeset preview below makes any slip easy to spot and fix.
It's one image-to-text call — the model generates the LaTeX autoregressively:
import { pipeline } from "@huggingface/transformers";
const texify = await pipeline("image-to-text", "Xenova/texify");
const out = await texify(equationImage, { max_new_tokens: 256 });
// → [{ generated_text: "$$x^{2}+y^{2}=z^{2}$$" }]
A Donut-Swin encoder embeds the whole equation image; an mBART decoder generates LaTeX tokens with a KV-cache (merged decoder). It all runs in a Web Worker so the page stays responsive while it decodes.
Watch mBART decode LaTeX tokens in real time with arrival timestamps, tune max_new_tokens, compare raw vs cleaned markup, and inspect structural math badges.
Drag a crop box over a multi-equation study sheet or uploaded screenshot, recognise each equation into an editable list, and export clean Markdown or LaTeX notes.
Draw or render a function equation on canvas, run real Texify OCR to recover its LaTeX, parse it safely without eval(), and plot an interactive y = f(x) curve.
Chain two on-device WASM models: Xenova/texify (~320 MB) extracts exact LaTeX from an equation image, then SmolLM2-135M (~140 MB) streams a plain-English explanation.