Snip Snipping Tool Chrome Extension OCR API Files API Private Cloud OCR Secure Conversion Service
Make Documents Accessible Process Chemical Documents Collaborate on Documents OCR API for Developers Train Language Models Support Academic Research Artificial Intelligence Fintech Edtech Pharma & Chemical Universities & Schools
Handwriting Recognition Digital Ink On-prem PDF Cloud Mathpix Markdown All Supported Languages Image Conversion PDF Conversion Markdown Conversion Table OCR Mathpix CLI PDF Search PDF Reader PDF Data Extraction Chrome Extension View Conversion Gallery
Snip APIs Private Cloud OCR SCS
Mobile Desktop Web Chrome Extension
Mathpix Snip Apps Mathpix OCR API Mathpix Markdown Python SDK
Blog
About Careers Contact
Contact Get Started

Convert Math to LaTeX

Math OCR is recognition trained on mathematical notation rather than on prose. It reads an equation as an equation, and gives you back source you can edit.

  • Printed and handwritten equations, including multi-line
  • Out as LaTeX, MathML or AsciiMath
  • Works on a screenshot, a photo, or a whole PDF
  • Runs on a stylus stroke-by-stroke, for live input

What makes math OCR its own category

The term exists because general text recognition does not degrade gracefully on notation. It produces a confident, wrong answer.

Notation is a different problem from text

Superscripts, fractions, matrices and delimiters carry meaning through position. Reading them as characters in a line loses the mathematics, which is why text OCR fails here rather than degrading.

Three output notations, one recognition

LaTeX for papers, MathML for Word and accessibility tools, AsciiMath for editors that expect it. The same result, serialised differently.

From a stylus, as it is drawn

The v3/strokes endpoint takes stroke coordinates rather than a finished image, so an app can show recognition while the user is still writing.

What the recognition handles

Multi-line and aligned equations

An aligned block comes back as one aligned environment rather than as several equations that happen to sit near each other.

Handwritten math, not only printed

Supported for English, Hindi and the Latin-alphabet languages, and in the same request as printed content on the same page.

Equations inside tables and documents

A table cell containing an equation keeps both: the cell structure and the math inside it.

How to convert Math to LaTeX

1

Upload your Math

Drag it into the Mathpix Snip web editor, or pick it from your files.

2

Convert it to LaTeX

Recognition runs on the whole document: math, tables, figures and layout together.

3

Export or copy the LaTeX

Download the LaTeX, or copy it straight to the clipboard and paste it where you need it.

What Mathpix accepts, and the limits that apply

Which files you can send

JPEG, PNG, BMP, JPEG 2000, WebP, TIFF, PBM, PGM, PPM, PNM, PFM, Sun raster, OpenEXR and Radiance HDR, and whole documents through the PDF endpoint

What you get back

LaTeX, MathML and AsciiMath, inside Mathpix Markdown or on their own.

The size limits that apply

v3/text or v3/latex JSON request body: 5 MB

Image fetched from a URL (15s timeout): 10 MB

v3/strokes JSON request body: 512 KB

Converting Math to LaTeX: common questions

What is math OCR?

Optical character recognition trained on mathematical notation rather than on prose. The distinction matters because notation encodes meaning in position, so reading it as a line of characters loses the mathematics.

Does it read handwritten equations?

Yes, for English, Hindi and the Latin-alphabet languages. Handwritten and printed content can appear in the same image.

Which output format should I ask for?

LaTeX if the destination is a paper or Overleaf, MathML if it is Word or an accessibility tool, AsciiMath if your editor expects it. All three come from the same recognition pass.

Is there an open-source alternative?

Several, and the search term is largely held by them: pix2tex, Nougat, Texify and Marker among others. We are not going to publish a comparison we cannot reproduce; the honest summary is that they are worth trying and that our answer is a supported API with handwriting, tables, chemistry and document layout in the same request.

Other formats you can convert Math to

An image of math, out as LaTeX

The snip-and-paste workflow.

LaTeX OCR, and the open-source options

The same problem, named for its output.

Equations into a Word document

MathML, editable in Word.