• Home
  • Tools
  • AI Tools
  • Calculators
  • Blog
  • Pricing

Footer

ToolgharToolghar
Toolghar

Your all-in-one productivity platform for the digital era.

Support

Product

  • All Tools
  • AI Tools
  • Calculators
  • Pricing

Categories

  • PDF Tools
  • Image Tools
  • Converters
  • Excel Tools
  • Developer Tools
  • Math & LaTeX
  • Language Handwriting OCR

Company

  • About Us
  • Blog
  • Contact
  • Request a Tool

Legal

  • Privacy Policy
  • Terms of Service
  • Refund Policy
  • Disclaimer

© 2026 Toolghar

PrivacyTermsRefund
Home/Blog/Convert Image to LaTeX: Turn Photos of Handwritten Math into Equations
April 21, 2026•5 min read•Math & LaTeX

Convert Image to LaTeX: Turn Photos of Handwritten Math into Equations

Typing a long equation into LaTeX by hand is slow and one missing brace breaks the build. Here is how I convert photos and screenshots of math into LaTeX, and how to fix what the OCR gets wrong.

LaTeX output looks great. Typing LaTeX input is another story. A 3x3 matrix or a fraction inside a square root turns into a wall of backslashes and braces, and one missing } stops the whole document from compiling.

That is the reason I added an image to LaTeX tool to Toolghar. You take a photo or screenshot of an equation, printed or handwritten, and get LaTeX back that you can paste into your editor. This post covers how to get clean results, what the output should look like, and how to fix the mistakes OCR tends to make.

#What the conversion actually does

Say you have the quadratic formula written on a page of notes. You photograph it, upload it, and the tool should give you this:

x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

That is it. No document wrapper, just the math, ready to drop inside $...$, \[...\] or an equation environment.

It is useful in a few situations:

  • You are writing a problem set or thesis and your working is on paper.
  • You found an equation in a textbook or a PDF and don't want to retype it.
  • You are still learning LaTeX and want to see how a given expression is written.

That last one is underrated. Converting math you already understand and reading the output is a quick way to pick up commands like \sqrt, \sum_{i=1}^{n} or \left( and \right).

#Step by step

I'll use the Convert Image to LaTeX tool here, but the capture advice applies to any math OCR.

#1. Take a clean picture

This matters more than anything else. What I do:

  • Crop to the one equation you need. The Image Cropper works if your phone's editor is awkward.
  • Shoot straight down, not at an angle.
  • Use even light. Glare on glossy paper and shadows from your phone are the most common reasons for bad output.
  • Dark ink on plain paper beats pencil on lined or grid paper.

#2. Upload and convert

JPG and PNG are fine. For handwriting, check before uploading that similar symbols are distinguishable: a closed 0, an x that doesn't look like \times, exponents that are clearly raised.

#3. Check the render against the original

Paste the output into your editor, or into the LaTeX Equation Editor for a live preview, and compare it with the image symbol by symbol. For a handwritten Gaussian integral, correct output looks like this:

\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}

If the render matches, you are done. If not, the next section covers the usual fixes.

TIP

[!TIP] Convert one equation per image. A whole page of mixed working in one shot gives noticeably worse results than several tight crops.

#Common problems and how to fix them

These are the errors I see most often, both from my own notes and from testing the tool.

What you seeLikely causeFix
x^2 came out as x2 or x_2Exponent written too lowRewrite it higher, or edit to x^2
l instead of 1, a instead of \alphaLook-alike charactersCorrect by hand, or write more distinctly
x \times y where you meant xyHandwritten x read as timesDelete \times
Small brackets around a tall fractionPlain ( ) usedUse \left( ... \right)
"Undefined control sequence" on pmatrix or alignedMissing packageAdd \usepackage{amsmath}
\mathbb{R} fails to compileMissing packageAdd \usepackage{amssymb}

Package errors are worth a closer look, because they are not really OCR mistakes. The output is correct, but your document doesn't load what it needs. A matrix, for example, usually comes back like this:

A = \begin{pmatrix}
  1 & 2 & 3 \\
  4 & 5 & 6 \\
  7 & 8 & 9
\end{pmatrix}

pmatrix comes from amsmath. If you are testing snippets in a fresh file, this minimal document compiles everything in this post:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}

\[
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\]

\[
\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}
\]

\[
A = \begin{pmatrix}
  1 & 2 & 3 \\
  4 & 5 & 6 \\
  7 & 8 & 9
\end{pmatrix}
\]

\begin{align}
  (a + b)^2 &= a^2 + 2ab + b^2 \\
  (a - b)^2 &= a^2 - 2ab + b^2
\end{align}

\end{document}

You can paste that straight into a new Overleaf project to check.

Two more small things. If your field writes the differential upright (\mathrm{d}x), the OCR will usually give you plain dx, so a find and replace fixes it. And if you use your own macros like \R for the reals, the output will contain the standard \mathbb{R} instead. That still compiles, it just won't match your house style.

#Handwritten vs printed

Here is roughly what to expect, based on what I have seen while testing:

SourceWhat to expect
Screenshot of a typeset PDFUsually correct first time
Neat handwriting, dark penMostly correct, check sub and superscripts
Average handwritingA few symbols to fix
Faint pencil, angled photo, lined paperOften worth retaking the photo

With messy handwriting, retaking the photo is often faster than fixing ten symbols by hand. Rewriting the equation neatly on a blank sheet is faster still.

WARNING

[!WARNING] Always render and read the result before it goes into anything you submit. A swapped subscript still compiles fine, so the document won't warn you.

#Getting the equation where it needs to go

LaTeX is not always the final destination. Some related tools on Toolghar:

You needTool
The equation as a PNG or JPGLaTeX to Image
To write and preview LaTeX liveLaTeX Equation Editor
The equation in a Word documentLaTeX to Word
Math from notes or a PDF into WordMath to Word
MathML to paste into Microsoft WordEquation to Word

If you are converting whole pages of handwritten notes rather than single equations, the Math to Word route is usually the better fit.

#Quick recap

  • Crop to one equation, shoot straight on, use even light.
  • Compare the render with the original. Sub and superscripts and look-alike characters are where errors hide.
  • Load amsmath and amssymb before blaming the OCR for compile errors.
  • Messy handwriting is often faster to retake than to fix.
  • The Convert Image to LaTeX tool runs on free daily credits, with optional one-time credit packs if you need more. The rest of the math tools are on the Math & LaTeX page.

On this page

  • What the conversion actually does
  • Step by step
  • 1. Take a clean picture
  • 2. Upload and convert
  • 3. Check the render against the original
  • Common problems and how to fix them
  • Handwritten vs printed
  • Getting the equation where it needs to go
  • Quick recap
#Image to LaTeX#LaTeX#Math OCR#Academic Writing#Equations#Research

Found this helpful?

Share it with your network or subscribe for more updates on Math & LaTeX.

Read more articles

Related Posts

May 6, 2026

How to Convert Handwritten Notes and Math PDFs into Editable Word Documents

Retyping a notebook full of equations into Word is slow and painful. Here is how to convert handwritten notes and math PDFs into editable .docx files, and what to check before you trust the result.

May 6, 2026
May 12, 2026

Image to Code: Turning Screenshots into HTML, CSS and React

AI can turn a screenshot into a working first draft of HTML, Tailwind or React. Here is how I prepare the image, what the output looks like, and the problems I fix every time.

May 12, 2026
Back to all posts