📐
AI Tools/LaTeX OCR — Formula Recognition

LaTeX OCR — Formula Recognition

Convert screenshots of math formulas to LaTeX code. 100% local AI — no upload, no API key. Powered by WebGPU.

AI · 100% LOCALScreenshot → LaTeXLocal AI modelNo uploadCopy & paste
Saved Results· Auto-save on
▾
The CalculatorPage 1
Texify2
~305MB · ONNX image-to-text model for LaTeX formula recognition
📥 Downloads on first use
💡 Model will auto-download when you click "Recognize Formula" (~305MB, cached for offline use)
Math formula screenshot → LaTeX code
Take a screenshot of any math formula — from a PDF, textbook, or whiteboard. This tool recognizes it and outputs clean LaTeX code. Perfect for students, researchers, and anyone working with equations.
📐
Drop a formula screenshot here or click to upload
PNG, JPG, WebP · Max 10MB · 100% local
Data Source & Legal Disclaimer
Effective: 2026
Sources: Xenova/texify2 (Transformers.js ONNX) · ONNX Runtime Web (WASM)

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.

See all data sources & update policy →
How it worksPage 2

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.

From a formula screenshot to clean LaTeX
LaTeX formula recognitionFormula imagescreenshot / PDF / photo∫x² dxb / aPNG · JPG · WebPTexify2 modelimage-to-text · ONNXencode pixels → tokensdecode LaTeX tokensmax_new_tokens 512long equations safeCleanup + outputpost-processing passstrip $ and \mathrm\chi → x misread fixedspacing normalized\int_a^b x^2 \, dxcopy · 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.

Worked example — Dr. Alvarez's integral

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.

  1. 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.
  2. Clean:postProcessLatex strips the $ wrappers, removes mathrm{} clutter, and corrects a misread where the italic x was decoded as chi.
  3. Verify:The result int_a^b x^2 , dx is shown in the LaTeX textarea with recognition time reported.
  4. Export:Dr. Alvarez copies the LaTeX and pastes it into his lecture notes in Overleaf — no manual typing of the equation.
FAQ & detailsPage 3

Convert screenshots of math formulas to LaTeX code using local AI. Everything runs locally; nothing is uploaded.

FreeToolHub LaTeX OCR is a free browser-based tool — convert screenshots of math formulas to LaTeX code using local AI. No signup, no upload; everything runs locally in your browser.

About this tool

What is this tool?

Convert screenshots of math formulas to LaTeX code using local AI. No upload, no API key, no subscription. 100% private, free.

Screenshot → LaTeXLocal AI modelNo uploadCopy & paste

What Is the LaTeX OCR Tool?

The LaTeX OCR tool is a free, browser-based AI tool that recognizes mathematical formulas from screenshots and converts them to LaTeX code. It uses the texify-small model running locally via Transformers.js with WebGPU acceleration. Upload a screenshot of any formula — from a PDF, textbook, whiteboard, or handwritten note — and the tool outputs clean LaTeX code that you can paste into Overleaf, Notion, or any LaTeX editor. All processing happens in your browser — your images never leave your device.

Who Should Use This Tool?

Students who need to digitize formulas from textbooks or lecture notes. Researchers extracting equations from academic papers. Teachers creating LaTeX documents from whiteboard photos. Anyone who works with math but doesn't want to manually type complex LaTeX expressions. The tool is especially useful when you have a formula as an image and need to edit it in LaTeX.

How to Use the LaTeX OCR Tool

Take a screenshot of the formula you want to convert. Upload it to the tool. Click Recognize Formula. The AI model downloads on first use (~40MB) and runs locally. The recognized LaTeX code appears in the output panel. Copy it to your clipboard and paste into any LaTeX editor. For best results, crop the screenshot to contain only the formula.

Frequently Asked Questions

Does this work with handwritten formulas?

The model is trained primarily on typeset formulas (printed or digital). Handwritten formulas may work if clearly written, but accuracy will be lower than for printed formulas. For best results, use screenshots from PDFs, websites, or typed documents.

Do I need to install anything?

No. The AI model runs entirely in your browser using WebGPU. The first time you use the tool, the model (~40MB) is downloaded and cached. After that, it works offline with no internet connection.

How accurate is LaTeX OCR for math formulas?

On clean printed formulas — textbook scans, typeset PDFs, screenshots from papers — recognition is usually character-perfect including nested fractions, subscripts, and Greek letters. Handwriting is less consistent: legible block handwriting works, cursive and cramped notation often drops symbols. The confidence score alongside each result tells you when to double-check; anything below roughly 0.85 deserves a manual review against the source image.

What image quality works best for formula recognition?

Aim for a tight crop with the formula filling the frame, even lighting, and contrast between ink and background. Phone photos at a slight angle introduce perspective skew that hurts accuracy — scan or screenshot when possible. Very large images are downscaled automatically, so a 4000px photo gains nothing over a sharp 800px crop. Remove surrounding prose; the model wastes attention on text tokens it will discard.

Can OCR handle multi-line equations?

Single-line formulas are most reliable. Multi-line aligned environments (aligned, cases, piecewise) are recognized, but the model may flatten line breaks or lose alignment markers — the LaTeX still compiles, just with \ rather than a proper environment. For long derivations, recognize each line separately and assemble the environment yourself; the per-line results combine cleanly.

How do I fix errors in recognized LaTeX?

The output is editable text, so common fixes are quick: mismatched braces (count \{ and \}), a misrecognized \xi versus \zeta or \ell versus 1, and missing \left/\right sizing pairs. Render the corrected string in any LaTeX editor to verify. Saved snapshots let you keep recognized results locally so you can revisit and refine a formula later without re-running recognition.

Other names for this tool

This tool is also known by these tasks — each link opens the same tool with a focused guide:

Related tools

Joke of the Day
Sep 29

Why did the cookie go to the doctor?

Free core, no account

Keep the Free Edition Free

No signups, no data sold. Every tool is free to use — the free tier allows 5 downloads or saves per day, and the optional Pro plan ($7/mo, $59/yr) adds unlimited downloads, batch processing, white-label exports and an ad-free experience.

☕Support me on Ko-fi— support the free tier

100% of proceeds go towards hosting & building more free tools.