Convert Image to Text
Turn a photograph, screenshot or scan into text. Built for the content general-purpose OCR gets wrong: equations, tables, chemical structures and handwriting.
- Reads printed and handwritten content in one pass
- Equations come out as LaTeX, not as mangled characters
- Per-line and per-word boxes, each with a confidence score
- Works on a photograph, a screenshot or a scan
Why this is not the same as general-purpose OCR
Most OCR is built for business documents: invoices, forms, contracts. The failure mode on scientific content is not a slightly worse result, it is a wrong one.
The cases general OCR gets wrong
An equation is not a word with unusual letters. General-purpose OCR reads it as one, and the output is unusable. This is trained on the notation.
Handwriting, not just print
English, Hindi and the Latin-alphabet languages are supported for handwriting, in the same request as printed text on the same page.
Word-level geometry and confidence
Set include_word_data on v3/text and every word comes back with a box and a score, so you can decide what to trust programmatically.
What you can control on an image request
Per-line and per-word boxes
include_line_data and include_word_data both return geometry and a confidence score. Per-word data is a v3/text feature and is not available for PDFs.
Restrict the alphabets it will consider
alphabets_allowed narrows recognition to the scripts you expect, which is the fix when a Latin page keeps picking up stray Cyrillic.
Rotated images are corrected first
On the image endpoints, controlled by auto_rotate_confidence_threshold. Rotation is a quarter or half turn, not arbitrary de-skewing.
How to convert Image to Text
Upload your Image
Drag it into the Mathpix Snip web editor, or pick it from your files.
Convert it to Text
Recognition runs on the whole document: math, tables, figures and layout together.
Export or copy the Text
Download the Text, 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
What you get back
Mathpix Markdown and plain text, plus LaTeX, MathML and AsciiMath for the math, and line or word data as JSON.
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 Image to Text: common questions
How is this different from ordinary OCR?
Ordinary OCR is trained on business documents and treats an equation as a word made of odd letters. The result is not slightly worse, it is wrong. This is trained on the notation itself.
Does it read handwriting?
Yes, for English, Hindi and the Latin-alphabet languages, including handwritten math. Printed coverage is much wider at 32 languages.
Can I get the position of each word?
Yes. include_word_data on v3/text returns a box and a confidence score per word. That option is specific to v3/text and does not exist for PDF requests.
What size image can I send?
5 MB in a JSON request body, or 10 MB if we fetch it from a URL you give us, with a 15 second timeout on the fetch.
Other formats you can convert Image to
An image of math, out as LaTeX
The snip-and-paste workflow for equations.
An image of a table, out as CSV
Tables from a screenshot into a spreadsheet.
Whole PDFs rather than single images
The asynchronous endpoint for documents.