Convert Math Equations to LaTeX from a Screenshot
Screenshot a math formula, get LaTeX code. Local OCR AI in your browser — no upload, no API key. For papers, homework, and docs.
Typing a fraction-heavy equation into LaTeX by hand takes ten minutes and usually produces two errors. Screenshot the formula instead — from a textbook, paper, lecture slide, or your own handwriting — and the OCR model outputs clean LaTeX instantly.
It runs locally in your browser: no API key, no per-conversion cost, no upload. Paste the output into Overleaf, Word's equation editor, or any Markdown-with-Math workflow.
100% in-browser · no upload · no signup · nothing you paste or drop here leaves your device
LaTeX OCR — Formula Recognition
Convert screenshots of math formulas to LaTeX code. 100% local AI — no upload, no API key. Powered by WebGPU.
LaTeX OCR uses the Texify2 model (ONNX, ~305MB, q8 quantized) from Xenova/texify2, running locally via Transformers.js / ONNX Runtime Web in your browser. The model downloads on first use and is cached afterward. Multi-CDN fallback ensures reliable downloads worldwide. All processing is 100% local — your images never leave your device.
How LaTeX OCR works — illustrated
This tool recognizes math formulas using Texify2, a purpose-built image-to-text model (ONNX, ~305MB) running locally through Transformers.js. The formula screenshot is loaded as a raw image — via Blob, not a fetch, to stay compatible with the page's cross-origin isolation — and passed to the model, which decodes the pixels into a LaTeX token sequence with a larger token budget than the model default so long equations aren't cut off. The raw output then goes through a cleanup pass: HTML tags and outer $ delimiters are stripped, redundant \mathrm and \text wrappers are removed, common misreads like \chi being mistaken for an italic x are corrected, and spacing around operators and parentheses is normalized. The result is clean LaTeX you can paste straight into Overleaf, Notion, or any editor — plus a rendered preview.
A formula image is fed to the local Texify2 ONNX model, which decodes it into raw LaTeX, and a cleanup pass strips wrappers and fixes common misreads.
Dr. Alvarez screenshots a definite integral from a physics textbook and drops the PNG into the tool. The model downloads on first use (~305MB) and stays cached.
- Load:The screenshot is decoded to a RawImage via Blob and fed to Texify2, which outputs a raw LaTeX sequence with a generous 512-token budget.
- Clean:postProcessLatex strips the $ wrappers, removes mathrm{} clutter, and corrects a misread where the italic x was decoded as chi.
- Verify:The result int_a^b x^2 , dx is shown in the LaTeX textarea alongside a rendered KaTeX preview, with recognition time reported.
- Export:Dr. Alvarez copies the LaTeX and pastes it into his lecture notes in Overleaf — no manual typing of the equation.
About this image equation to LaTeX
This page covers math formula ocr to latex, screenshot to latex converter, latex from image free, handwriting to latex online — all the same underlying task as image equation to LaTeX. The tool above is FreeToolHub's latex ocr embedded in full: every feature works right here, and nothing you process is uploaded to any server.
Frequently asked questions
How accurate is math OCR to LaTeX?
Printed formulas from textbooks and papers convert very reliably, including fractions, integrals, matrices, and Greek letters. Messy handwriting depends on legibility — the output editor lets you fix the occasional symbol, which is still faster than typing the whole expression from scratch.
Which LaTeX packages does the output need?
Standard math mode (amsmath) covers nearly everything the model outputs — \\frac, \\int, \\sum, \\begin{matrix} and friends. Overleaf and most Markdown-with-Math editors (Obsidian, Typora, Jupyter) work out of the box with no extra packages.