Turn any screenshot into clean Markdown and LaTeX automatically
T

Turn any screenshot into clean Markdown and LaTeX automatically

Turn any screenshot into clean Markdown and LaTeX automatically

3,170 stars
N/A forks
N/A contributors

README

Project documentation from GitHub

From Screenshot to Code: Pix2Text Turns Images into Markdown and LaTeX

Ever snapped a picture of a whiteboard equation or grabbed a screenshot of some formatted text, only to dread the manual transcription? We've all been there. Manually converting images, especially ones mixing text and math, into editable Markdown or LaTeX is a tedious chore. What if you could automate that entirely?

Enter Pix2Text. It's an open-source tool that acts like a scanner for the digital age, but instead of just OCR for plain text, it understands the structure of your images. Feed it a screenshot, a photo of a document, or a diagram, and it hands you back clean, ready-to-use Markdown and LaTeX code.

What It Does

Pix2Text is a Python toolkit that intelligently analyzes an image. It doesn't just see pixels as text; it first figures out the layout. It identifies different regions—like text paragraphs, mathematical formulas, or code snippets—and then applies the best recognition model for each part. Regular text goes through an OCR engine, while mathematical expressions are parsed by a dedicated math formula recognition model. Finally, it stitches everything together into a well-structured Markdown document, with LaTeX neatly formatted for any equations it found.

Why It's Cool

The magic isn't just in the OCR. The clever part is the layout analysis and multi-model approach. It's not forcing one model to do everything. By splitting the problem, it gets significantly better accuracy, especially for the tricky stuff like complex matrices or inline equations that would trip up standard screenshot tools.

Think about the use cases:

  • Study and Research: Quickly digitize notes from lectures or papers that are full of equations.
  • Documentation: Convert legacy screenshots of UI or old docs into editable, version-controlled Markdown.
  • Accessibility: Create textual representations of content trapped in images.
  • Development: Grab a snippet of code or an error message from a screenshot and turn it into text you can search or paste into an editor.

It's a practical tool that solves a specific, annoying problem very well.

How to Try It

The quickest way to see it in action is to use the free hosted web app. Just drag and drop your image and see the Markdown appear.

Online Demo:Pix2Text Web App

If you're a Python dev and want to integrate it into your own workflow or scripts, installation is straightforward via pip:

pip install pix2text

Then, you can run

Did you like this issue?

Join our weekly newsletter

Love discovering amazing projects?

Help us continue bringing you the best open-source discoveries every week.

Back to Projects
Last updated: Jan 23, 2026