DEV Community

Cover image for How to Extract Text from Screenshots, PDFs, and Handwriting (Step-by-Step)
Designs For Us
Designs For Us

Posted on

How to Extract Text from Screenshots, PDFs, and Handwriting (Step-by-Step)

How to Extract Text from Screenshots, PDFs, and Handwriting (Step-by-Step)

You've got text trapped inside an image. Maybe it's a screenshot of an email you need to quote. A scanned PDF you need to edit. A photo of handwritten notes you want to search later. The text is right there — but you

can't copy it.

This guide covers exactly how to extract it. Three different source types, step-by-step, with no software to install.


What Is Text Extraction (OCR)?

OCR stands for Optical Character Recognition. It's the technology that reads an image pixel by pixel and identifies the characters — letters, numbers, punctuation — converting them into real, editable text.

Modern OCR uses AI and deep learning. It's fast, runs in the browser, and handles printed text, handwriting, and even low-quality scans with high accuracy.

You don't need to understand how it works. You just need to know which tool to use and how to give it a clean image.


Part 1: How to Extract Text from a Screenshot

Screenshots are the easiest source for OCR. They're already digital, high resolution, and pixel-sharp — ideal conditions for accurate text extraction.

When you'd use this:

  • A screenshot of a website, article, or app with text you want to copy
  • A screengrab of a video or presentation slide
  • A code snippet saved as an image
  • An error message you photographed on screen

Step 1: Take your screenshot

On Windows: Win + Shift + S to select a region, or Print Screen for the full display.
On Mac: Cmd + Shift + 4 to select a region, or Cmd + Shift + 3 for the full screen.
On mobile: Power + Volume Down (Android) or Power + Home/Side button (iPhone).

Save as PNG — not JPG. Screenshots saved as PNG preserve crisp text edges. JPG compression blurs them and reduces OCR accuracy.

Step 2: Upload to an OCR tool

Go to https://extractimagetotext.org. Click the upload area or drag your PNG file in. The tool accepts screenshots in PNG, JPG, WEBP, and all major formats.

Step 3: Copy or export the text

The extracted text appears in the editor within seconds. Click Copy to grab it all at once, or download as a TXT or Word file if you need the content in a document.

Accuracy tip: If the screenshot has a busy background or small text, crop it to just the text area before uploading. Less visual noise means higher accuracy.


Part 2: How to Extract Text from a PDF

PDFs come in two types, and each is handled differently by OCR tools.

Type 1: Searchable (text-based) PDF
These are PDFs created digitally — exported from Word, Google Docs, or a website. The text is embedded as data, not as an image. You can usually highlight and copy text directly in your PDF viewer.

For these, OCR extracts the embedded text directly — instantly, with 100% accuracy.

Type 2: Scanned (image-based) PDF
These are PDFs created by scanning physical documents. Each page is an image. You cannot highlight or copy the text in a standard PDF viewer. These require OCR to extract.

Step 1: Upload your PDF

Go to https://extractimagetotext.org/pdf-to-text. Upload your PDF file. The tool automatically detects whether it's a searchable PDF or a scanned image PDF and handles each appropriately.

Step 2: Let the tool process

For searchable PDFs: text appears almost instantly.
For scanned PDFs: the OCR engine reads each page as an image. Multi-page documents take a few extra seconds per page.

Step 3: Export in the format you need

  • Plain text (.txt) — for pasting into other tools or databases
  • Word (.docx) — for editing, formatting, and sharing
  • PDF — to create a searchable version of a previously image-only PDF

Accuracy tip: Scan quality is everything for scanned PDFs. If you have control over the scan settings, use 300 DPI minimum and ensure good contrast between text and background.


Part 3: How to Extract Text from Handwriting

Handwriting is the hardest source for OCR — but modern AI handles it far better than older systems. Clear, consistent handwriting typically achieves 90–97% accuracy.

When you'd use this:

  • Digitising lecture notes after class
  • Converting field research notes into a document
  • Archiving personal journals or letters
  • Extracting data from paper-based forms

Step 1: Photograph your handwriting

This is the step that most affects accuracy. Follow these guidelines:

  • Use natural daylight or a bright, even light source
  • Hold the camera directly above the page — avoid angled shots
  • Make sure the entire page is in frame and in focus
  • Write on white or light-coloured paper with dark ink
  • Avoid shadows across the writing — no shadows from your hand or the camera

A well-lit, focused photo makes a significant difference to OCR accuracy.

Step 2: Upload the photo

Go to https://extractimagetotext.org/handwriting-to-text. Upload your JPG or PNG photo. The AI analyses the strokes, letterforms, and spacing to identify each character — both cursive and printed handwriting are

supported.

Step 3: Review and export

Handwriting OCR occasionally misreads a character, especially with irregular letterforms or low-contrast images. Do a quick read-through of the extracted text before exporting. The built-in editor lets you correct

anything on the spot.

Export as TXT for plain content, or Word for a formatted document.

Accuracy tip: If a section of handwriting is particularly messy or dense, crop that section out as a separate image and run it through OCR individually. Smaller, focused uploads give the model more detail to work with.


Comparing the Three Sources

┌────────────────┬──────────────────┬────────────────────┬────────────────────────────────────────────┐
│ Source │ Typical Accuracy │ Best Format │ Notes │
├────────────────┼──────────────────┼────────────────────┼────────────────────────────────────────────┤
│ Screenshot │ 97–99% │ PNG │ Easiest — digital content is already sharp │
├────────────────┼──────────────────┼────────────────────┼────────────────────────────────────────────┤
│ Searchable PDF │ 100% │ PDF │ Text embedded — no OCR needed │
├────────────────┼──────────────────┼────────────────────┼────────────────────────────────────────────┤
│ Scanned PDF │ 93–99% │ PDF (300 DPI scan) │ Depends on scan quality │
├────────────────┼──────────────────┼────────────────────┼────────────────────────────────────────────┤
│ Handwriting │ 88–97% │ JPG or PNG │ Lighting and clarity are critical │
└────────────────┴──────────────────┴────────────────────┴────────────────────────────────────────────┘


Common Mistakes to Avoid

Using low-resolution images. If the text is smaller than about 10px tall in the image, OCR accuracy drops. Increase the image size or zoom in before screenshotting.

Uploading JPG screenshots. Screenshots should always be saved as PNG. If your tool or OS defaults to JPG, change the setting — it directly affects accuracy.

Skewed or angled photos. A document photographed at an angle introduces perspective distortion. Most OCR tools handle mild skew but struggle with severe angles. Photograph flat surfaces from directly above.

Not reviewing the output. OCR is very accurate but not perfect. A 30-second review catches any errors before they propagate into your document.


The Full Toolkit

For the specific use cases mentioned above, these dedicated tools give the best results:

All free. No account required.


Summary

Text extraction from screenshots, PDFs, and handwriting follows the same core process: get a clean image, upload it to a capable OCR tool, review and export. The differences are in preparation — PNG for screenshots,

high-DPI scans for PDFs, good lighting for handwriting.

Once you know the workflow, extracting text from any source takes under a minute.

Top comments (0)