Is there a tool for exporting equation images to TeX? Probably something related to OCR. I have a lot of image-equations in a word document that I'd like to convert to TeX.

Note that the equations are actually images, so no word2tex-like apps would help.


7 Answers 7


Mathpix Snip: Scanner App for Math and Science


Mathpix Snip digitizes handwritten or printed text, and copies outputs to the clipboard that can be pasted into LaTeX editors like Overleaf, Markdown editors like Typora, Microsoft Word, and more.

Available for MacOS, Windows, Linux (Snap), iOS, and Android.

Originally starting out as a purely mobile app to scan handwritten math over time Mathpix was ported to desktop operating systems, became more powerful and acquired LaTeX scanning functionality. This was also followed by a series of price hikes and nowadays (11/2022) the free plan contains a mere 10 snips per month. Also the privacy policy is pretty lousy and they collect way too much data, like scanned images, email addresses and IP addresses.


N.B.: Using this to copy equations from Wikipedia is 100% pointless, because you can also just select the equation with your mouse and press CtrlC, which will put the LaTeX source of that equation in your clipboard.

  • 1
    It's now available in Linux as a Snap, too
    – user226564
    Commented Mar 7, 2021 at 17:19
  • 2
    I would suggest to add to the answer the fact that it is a paid app (there is a free tier that lets you convert only 50 formulas/month). Commented May 19, 2021 at 6:14
  • 1
    @FedericoPoloni 5USD/month... a bargain for 5000 snips...
    – JeT
    Commented Nov 4, 2022 at 21:36

pix2tex - LaTeX OCR

Free, Open Source


Mathpix is freemium (can only convert a certain amount of formulas per month for free) and scribblemyscience is offline.

This is an open source alternative with a GUI. It is not the most accurate in converting the formulas and you can't convert hand written formulas but it is free and gives good results most of the time.

  • Abysmal documentation. Literally impossible to know how to run this.
    – Cybernetic
    Commented Mar 25, 2023 at 1:26
  • @Cybernetic yes it isn't so good for newbies (myself included). But I managed to get it going. During the installation, you get a prompt saying something like "you should add this directory to your path". To do that you need to open the file .bashrc and add export PATH=$PATH:/path/to/directory and then restart the terminal. Then you can execute either pix2tex for the cli program or latexocr for the gui.
    – Ur Ya'ar
    Commented Sep 11, 2023 at 8:43
  • I'll add that for me the gui didn't work at first because I was missing some libraries. The answer here stackoverflow.com/a/60662135 helped me resolve the issue.
    – Ur Ya'ar
    Commented Sep 11, 2023 at 8:44
  • 1
    The main disadvantage of this alternative is that it doesn't know how to distinguish regular text from a LaTeX equation, and will render any text as if its inside $..$ with some font specification (e.g. $\mathrm{text}$). (In my testing, MathPix is capable of this distinction).
    – Ur Ya'ar
    Commented Oct 3, 2023 at 13:05

For an open source solution, based on the algorithm introduced in {1}:


  • {1} Deng, Yuntian, Anssi Kanervisto, Jeffrey Ling, and Alexander M. Rush. "Image-to-markup generation with coarse-to-fine attention." In International Conference on Machine Learning, pp. 980-989. PMLR, 2017. http://proceedings.mlr.press/v70/deng17a/deng17a.pdf
  • Those are amazing but they're written with python 2.7
    – Rainb
    Commented May 23, 2021 at 7:26
  • Does this method work for handwritten formulas? Commented Mar 11 at 6:56
  • How can I run one of these on an image? I tried image2latex by yixuanzhou, but it uses outdated packages (Theano & Lasagne), so I can't get it to run Commented Mar 11 at 7:45

In addition to Infty, there's also FFES --- the Freehand Formula Entry System. Paper on it here: http://academia.edu/156023/Handwriting_Speech_for_Computer_Entry_of_Mathematics and it's available here: http://www.cs.rit.edu/~rlaz/ffes/


Scribble My Science: convert images or PDF to LaTex


You can upload directly in your web browser images or PDF files. OCR technologies are used to recognize the formulas or text and to generate the LaTeX code.

  • 4
    sadly this page has been offline lately Commented Feb 15, 2022 at 13:44

Lol, guys... Don't use the hard-path way just if you use generic formula aka you could find it on google. You just search the formula on Wikipedia then inspect the image of formula do you want and select the code it after that show the code TeX on the inspect element (and just copy & paste it) :D enter image description here

  • 2
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Nov 22, 2021 at 6:14
  • 3
    what if it is in pdf and not online?
    – Mour_Ka
    Commented Aug 22, 2023 at 8:10

I know a lot of time has passed since the question was asked, but you can try this site: https://web.baimiaoapp.com/image-to-latex/en.

P.S. It can sometimes work poorly, but it works properly most of the time.

P.P.S. Or you can also try to use ai chat bots with photo input to convert photo with equation to tex/latex: chatgpt 4 (V) (vision) (paid), google gemini (bard) (free), microsoft copilot (bing ai) (free), llava (free), minigpt4 (free).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .