Tutorials

How to Extract Text from Images & PDFs: Complete OCR Guide (2025)

Master OCR technology to extract text from images, scanned PDFs, and screenshots. Learn free tools (Google Docs, Tesseract, Adobe), mobile apps, batch processing, accuracy tips, and handle receipts, business cards, and documents.

  • 23 min read
  • Updated:
  • By Convert a Document
In this guide:

Master OCR technology to extract text from images, scanned PDFs, and screenshots. Learn free tools (Google Docs, Tesseract, Adobe), mobile apps, batch processing, accuracy tips, and handle receipts, business cards, and documents.

Introduction: Why Extract Text from Images?

Optical Character Recognition (OCR) technology transforms images containing text into editable, searchable digital text. In 2025, OCR has become essential for businesses, students, researchers, and anyone dealing with scanned documents, screenshots, photos of text, or PDF files.

Real-World Applications:
  • Business: Converting scanned contracts, invoices, and receipts into searchable documents
  • Students: Extracting text from textbook pages and lecture slides for notes
  • Researchers: Digitizing historical documents and manuscripts
  • Personal: Scanning business cards, restaurant menus, and handwritten notes
  • Accessibility: Making printed content accessible to visually impaired users

Modern OCR technology achieves 98%+ accuracy on clear printed text and supports 100+ languages. This comprehensive guide covers free tools, step-by-step tutorials, accuracy optimization, and solutions for challenging scenarios like handwritten text and low-quality images.

What is OCR? How Does It Work?

OCR Technology Explained

OCR (Optical Character Recognition) uses computer vision and machine learning to analyze images and identify text characters. Modern OCR systems follow this process:

  1. Image Preprocessing: Enhances contrast, removes noise, straightens skewed text
  2. Text Detection: Identifies regions containing text vs images/graphics
  3. Character Segmentation: Isolates individual characters or words
  4. Character Recognition: Matches patterns against trained character models
  5. Post-Processing: Applies dictionaries and context to correct errors

OCR Accuracy Factors

Factor Impact on Accuracy Optimal Conditions
Image Resolution High impact 300+ DPI for printed text
Text Clarity Very high impact Sharp, high-contrast text
Font Style Moderate impact Standard fonts (Arial, Times) > decorative fonts
Background High impact Plain background, minimal patterns
Text Orientation Moderate impact Horizontal, properly aligned text
Language Moderate impact Major languages (English, Spanish, Chinese) have best support

Expected Accuracy by Source Type

Source Type Expected Accuracy Common Issues
Born-digital PDF 99-100% None (text already embedded)
Scanned documents (300 DPI) 95-98% Minor errors with special characters
Screenshots 92-96% Low resolution, compression artifacts
Phone photos of text 85-92% Lighting, perspective distortion, blur
Printed handwriting 75-85% Inconsistent character shapes
Cursive handwriting 60-75% Connected characters, varying styles
Historical documents 70-85% Faded ink, paper degradation, old fonts

Best Free OCR Tools & Software

Tool Comparison

Tool Platform Accuracy Languages Best For
Google Docs Web 95-98% 50+ Quick, simple OCR tasks
Microsoft OneNote Windows, Mac 94-97% 60+ Note-taking, organization
Tesseract OCR All platforms 92-96% 100+ Batch processing, developers
Adobe Acrobat Pro Windows, Mac 96-99% 35+ Professional PDF workflows
OnlineOCR.net Web 93-96% 46+ No installation needed
Google Lens Mobile 94-97% 100+ Real-time mobile scanning

Method 1: Google Docs (Easiest Free Option)

Pros: Completely free, no software installation, good accuracy, preserves formatting

Cons: Requires Google account, slower for batch processing, 2MB file size limit

Step-by-Step Tutorial

  1. Upload image to Google Drive
    • Go to drive.google.com
    • Click "New" → "File upload"
    • Select your image (JPG, PNG, PDF supported)
    • Supported formats: JPG, PNG, GIF, PDF (max 2MB)
  2. Open with Google Docs
    • Right-click the uploaded file
    • Select "Open with" → "Google Docs"
    • Wait 10-30 seconds for processing
  3. Review extracted text
    • Original image appears at top
    • Extracted text appears below image
    • Text is fully editable
  4. Copy or download text
    • Select all text (Ctrl+A / Cmd+A)
    • Copy (Ctrl+C / Cmd+C)
    • Or File → Download → .docx or .txt
💡 Google Docs OCR Tips:
  • Image quality: Use 300 DPI or higher for best results
  • File size: Images over 2MB won't process - resize first
  • Multiple pages: Process one page at a time for better accuracy
  • Formatting: Google Docs attempts to preserve bold, italic, and headings
  • Languages: Automatically detects language, but you can specify in Drive settings

Method 2: Tesseract OCR (Best for Batch Processing)

Pros: Free, open-source, 100+ languages, command-line for automation, highly accurate

Cons: Requires installation, command-line interface (not user-friendly for beginners)

Installation

# Windows (using Chocolatey)
choco install tesseract

# Mac (using Homebrew)
brew install tesseract

# Linux (Ubuntu/Debian)
sudo apt install tesseract-ocr

# Verify installation
tesseract --version

Basic Usage

# Extract text from single image
tesseract input.jpg output.txt

# Result saved to output.txt

# Specify language (default is English)
tesseract input.jpg output.txt -l eng

# Multiple languages
tesseract input.jpg output.txt -l eng+spa

# PDF output
tesseract input.jpg output pdf

# Preserve layout
tesseract input.jpg output.txt -c preserve_interword_spaces=1

Batch Processing Multiple Images

# Windows batch script
for %f in (*.jpg) do tesseract "%f" "%~nf.txt"

# Mac/Linux bash script
for file in *.jpg; do
    tesseract "$file" "${file%.jpg}.txt"
done

# Python script for advanced batch processing
import os
import pytesseract
from PIL import Image

input_folder = "scanned_docs"
output_folder = "text_output"

for filename in os.listdir(input_folder):
    if filename.endswith(('.jpg', '.png', '.jpeg')):
        img_path = os.path.join(input_folder, filename)
        img = Image.open(img_path)

        text = pytesseract.image_to_string(img, lang='eng')

        output_file = os.path.join(output_folder, f"{filename}.txt")
        with open(output_file, 'w', encoding='utf-8') as f:
            f.write(text)

        print(f"Processed: {filename}")

Method 3: Microsoft OneNote (Best for Windows Users)

Pros: Free, integrated with Windows, good accuracy, searchable notes

Cons: Windows/Mac only, requires Microsoft account

Step-by-Step Tutorial

  1. Insert image into OneNote
    • Open OneNote (included with Windows 10/11)
    • Create a new page or open existing
    • Insert → Pictures → select image file
  2. Extract text
    • Right-click on the image
    • Select "Copy Text from Picture"
    • Processing takes 5-15 seconds
  3. Paste extracted text
    • Click anywhere in OneNote
    • Paste (Ctrl+V)
    • Text appears as editable note

Method 4: Adobe Acrobat Pro (Best Professional Tool)

Pros: Highest accuracy, excellent PDF handling, batch processing, preserves formatting

Cons: Paid software ($14.99/month), resource-intensive

Step-by-Step Tutorial

  1. Open PDF in Acrobat Pro
    • File → Open → select scanned PDF
  2. Run OCR
    • Tools → Scan & OCR → Recognize Text
    • Choose "In This File" or "In Multiple Files"
    • Settings: Primary OCR language, Output type (Searchable Image or Editable Text)
  3. Review and correct
    • Adobe highlights uncertain characters
    • Right-click highlighted text to correct
  4. Export text
    • File → Export To → Word, Excel, or Text
    • Formatting preserved in Word export

Method 5: Online OCR Services (No Installation Required)

OnlineOCR.net

  • Free tier: 15 images/hour, no registration
  • Max file size: 15MB
  • Formats: JPG, PNG, GIF, BMP, TIFF, PDF, DjVu
  • Output: Word, Excel, Text
  • Languages: 46 languages

How to Use

  1. Go to onlineocr.net
  2. Click "Select file" → choose image
  3. Select recognition language
  4. Choose output format (Word, Excel, Text)
  5. Click "Convert"
  6. Download converted file

Mobile OCR Apps: Scan Text Anywhere

Best Mobile OCR Apps (2025)

App Platform Free Features Best For
Google Lens iOS, Android Unlimited scanning, real-time translation Quick text extraction, translation
Microsoft Office Lens iOS, Android Document scanning, OneNote integration Business documents, receipts
Adobe Scan iOS, Android Scans to searchable PDF, auto-detect borders Professional PDF creation
Text Fairy Android Completely free, offline OCR, 110 languages Privacy-focused, offline scanning
Prizmo Go iOS Real-time OCR, cloud service integration iPhone users, cloud workflows

Tutorial: Google Lens Text Extraction

  1. Open Google Lens
    • iPhone: Open Google app → tap camera icon
    • Android: Open Google Lens app (pre-installed on many devices)
  2. Point camera at text or select photo
    • Real-time mode: Point camera at text
    • Existing photo: Tap gallery icon → select image
  3. Select text mode
    • Tap "Text" icon at bottom
    • Lens automatically detects text regions
  4. Select and copy text
    • Tap "Select all" or highlight specific text
    • Tap "Copy text"
    • Paste anywhere (notes, email, documents)
Google Lens Bonus Features:
  • Translate: Instantly translate text to 100+ languages
  • Listen: Read text aloud (accessibility feature)
  • Search: Search selected text on Google
  • Send to computer: Copy text and access from your computer (Chrome sync)

Tutorial: Adobe Scan for Business Documents

  1. Install and open Adobe Scan (free from App Store/Play Store)
  2. Scan document
    • Tap camera button
    • Adobe Scan auto-detects document borders
    • Captures automatically or tap capture button
    • Add multiple pages if needed
  3. Review and adjust
    • Adjust borders if misdetected
    • Apply filters (Color, Grayscale, Whiteboard)
    • Reorder pages if multi-page document
  4. Save as OCR PDF
    • Tap "Save PDF"
    • Adobe automatically runs OCR
    • Text is searchable in resulting PDF
  5. Export or share
    • Share to cloud (Dropbox, Google Drive, OneDrive)
    • Email as attachment
    • Export to Adobe Acrobat for further editing

Common OCR Use Cases & Solutions

Use Case 1: Business Cards

Challenge: Small text, varying fonts, multiple languages, layout variations

Best Tools:

  • CamCard - Specialized business card scanner with contact management
  • Google Lens - Free, instant contact saving
  • Microsoft Lens - Business card mode with Outlook integration

Tutorial: Google Lens for Business Cards

  1. Open Google Lens, select "Text" mode
  2. Point camera at business card
  3. Tap detected text → "Add to Contacts"
  4. Google automatically populates: Name, phone, email, company, website
  5. Review and save to contacts

Use Case 2: Receipts for Expense Tracking

Challenge: Faded thermal paper, small fonts, curved receipts, date/amount extraction

Best Tools:

  • Expensify - Auto-extracts date, merchant, amount, category
  • Microsoft Lens - Business document mode optimizes receipt scanning
  • Adobe Scan - Creates searchable PDFs for expense reports

Tips for Receipt OCR:

  • Scan immediately - thermal paper fades over time
  • Flatten curved receipts before scanning
  • Use good lighting - overhead light reduces shadows
  • Scan against dark background for better contrast

Use Case 3: Book Pages & Textbooks

Challenge: Book curvature, page shadows, multi-column layouts

Best Tools:

  • Adobe Scan - Book mode compensates for curvature
  • Tesseract OCR - Batch process many pages
  • Google Docs - Good at preserving formatting

Tutorial: Scanning Book Pages

  1. Setup:
    • Use book stand to hold pages flat
    • Position overhead lighting or window light
    • Use weight or glass to flatten pages (no fingers in frame)
  2. Capture:
    • Use Adobe Scan's book mode
    • Capture left and right pages separately for best results
    • Use burst mode for multi-page capture
  3. Post-process:
    • Run through Tesseract for text extraction
    • Review for OCR errors (page numbers, headers, footnotes often problematic)
    • Format in word processor
⚠️ Copyright Notice: Scanning copyrighted books may violate copyright laws. Only scan books you own for personal use, or use for fair use purposes (research, criticism, teaching). Never distribute scanned copyrighted content.

Use Case 4: Screenshots & Digital Images

Challenge: Low resolution, compression artifacts, non-standard fonts

Best Tools:

  • Google Lens - Works directly on screenshots
  • ShareX (Windows) - Built-in OCR for screenshots
  • Text Sniper (Mac) - System-wide OCR hotkey

Tutorial: Extract Text from Screenshots

  1. Take high-quality screenshot (native resolution, no scaling)
  2. Open screenshot in Google Photos or Google Lens
  3. Select Text mode → Copy text
  4. Paste wherever needed

Use Case 5: Handwritten Notes

Challenge: Variable handwriting styles, connected characters, inconsistent spacing

Best Tools:

  • Microsoft OneNote - Best for printed handwriting
  • Google Lens - Handles casual handwriting reasonably well
  • MyScript Nebo - Specialized handwriting recognition (paid)

Tips for Handwriting OCR:

  • Write clearly: Print instead of cursive for better accuracy
  • Use dark ink: Black or blue pen on white paper
  • Spacing: Leave space between words and lines
  • Lighting: Even, shadow-free lighting
  • Straight capture: Photograph directly overhead (not at angle)
  • Resolution: Use high megapixel camera (12MP+)

Expected Results:

  • Neat printed handwriting: 70-85% accuracy
  • Average casual handwriting: 50-70% accuracy
  • Cursive handwriting: 40-60% accuracy
  • Doctor's handwriting: Good luck 😄 (15-30% accuracy)

How to Improve OCR Accuracy

Pre-Processing Techniques

1. Image Resolution & DPI

DPI OCR Accuracy Use Case
<150 DPI Poor (60-75%) Not recommended
150-200 DPI Fair (75-85%) Quick scans, large text only
300 DPI Good (90-95%) Standard documents (recommended)
400-600 DPI Excellent (95-98%) Small fonts, degraded originals
600+ DPI Excellent (95-99%) Historical documents, archival
💡 Resolution Sweet Spot: 300 DPI is optimal for most documents. Higher DPI increases file size and processing time with minimal accuracy gain. Lower DPI significantly hurts accuracy.

2. Image Enhancement Techniques

Using ImageMagick (Command Line):

# Increase contrast
convert input.jpg -contrast -contrast output.jpg

# Sharpen image
convert input.jpg -sharpen 0x1 output.jpg

# Remove noise
convert input.jpg -median 2 output.jpg

# Deskew (straighten)
convert input.jpg -deskew 40% output.jpg

# Combine multiple enhancements
convert input.jpg -deskew 40% -contrast -sharpen 0x1 output.jpg

Using Python (PIL/Pillow):

from PIL import Image, ImageEnhance, ImageFilter

# Open image
img = Image.open('input.jpg')

# Convert to grayscale
img = img.convert('L')

# Increase contrast
enhancer = ImageEnhance.Contrast(img)
img = enhancer.enhance(2.0)

# Sharpen
img = img.filter(ImageFilter.SHARPEN)

# Increase brightness if needed
enhancer = ImageEnhance.Brightness(img)
img = enhancer.enhance(1.2)

# Save enhanced image
img.save('enhanced_output.jpg')

3. Cropping & Rotation

  • Remove margins: Crop to text area only (reduces processing noise)
  • Straighten skewed text: Rotate to make text horizontal
  • Remove headers/footers: If not needed, crop them out
  • Split multi-column: OCR one column at a time for better results

Post-Processing: Correcting OCR Errors

Common OCR Errors

OCR Mistake Should Be Why It Happens
rn m Two characters look like one
l (lowercase L) I (uppercase i) or 1 Similar appearance
O (letter) 0 (zero) Identical in many fonts
S 5 Similar shape
B 8 Similar shape
cl d Characters merge

Automated Error Correction

import re

def correct_common_ocr_errors(text):
    """Fix common OCR mistakes"""

    # Fix common character confusions
    corrections = {
        r'\brn\b': 'm',  # 'rn' → 'm' (word boundary)
        r'(\d)O(\d)': r'\g<1>0\2',  # Letter O → zero in numbers
        r'(\d)l(\d)': r'\g<1>1\2',  # Lowercase L → 1 in numbers
        r'(\d)S(\d)': r'\g<1>5\2',  # S → 5 in numbers
        r'(\d)B(\d)': r'\g<1>8\2',  # B → 8 in numbers
    }

    for pattern, replacement in corrections.items():
        text = re.sub(pattern, replacement, text)

    return text

# Example usage
ocr_text = "The price is $l5.OO and the code is B374S"
corrected = correct_common_ocr_errors(ocr_text)
print(corrected)
# Output: "The price is $15.00 and the code is 83745"

Manual Review Checklist

  • ✅ Check numbers for letter-to-number confusion (l→1, O→0, S→5)
  • ✅ Verify proper nouns (names, places) are correctly capitalized
  • ✅ Look for merged words (spacesmissing) or split words (sp lit)
  • ✅ Check punctuation, especially commas vs periods
  • ✅ Verify special characters (&, @, #, %) weren't misread
  • ✅ Compare against original image for uncertain sections

OCR for PDFs: Scanned vs Born-Digital

Understanding PDF Types

PDF Type Description Text Searchable? Needs OCR?
Born-Digital Created from Word, web, etc. ✅ Yes ❌ No
Scanned (Image-only) Scanned paper document ❌ No ✅ Yes
OCR PDF Scanned + OCR layer added ✅ Yes ❌ Already done

How to Check if PDF Needs OCR

  1. Try to select text: Open PDF, try to click and drag to select text
    • Can select? → Born-digital (no OCR needed)
    • Can't select? → Scanned (needs OCR)
  2. Use Find function: Ctrl+F / Cmd+F and search for a word
    • Finds text? → No OCR needed
    • Finds nothing? → Needs OCR

Adding OCR to Scanned PDFs

Method 1: Adobe Acrobat Pro

  1. Open scanned PDF
  2. Tools → Scan & OCR → Recognize Text → In This File
  3. Select language and click "Recognize Text"
  4. Save (File → Save) - text now searchable and copyable

Method 2: Tesseract + OCRmyPDF (Free)

# Install OCRmyPDF (includes Tesseract)
pip install ocrmypdf

# Basic OCR
ocrmypdf input_scanned.pdf output_searchable.pdf

# Specify language
ocrmypdf -l eng input.pdf output.pdf

# Force OCR even if text detected
ocrmypdf --force-ocr input.pdf output.pdf

# Optimize file size while adding OCR
ocrmypdf --optimize 3 input.pdf output.pdf

# Skip existing text, only OCR images
ocrmypdf --skip-text input.pdf output.pdf

Method 3: Online PDF OCR

  • iLovePDF OCR: lovepdf.com/ocr-pdf (free, 25 files/day)
  • Smallpdf OCR: smallpdf.com/ocr-pdf (free trial)
  • OnlineOCR: onlineocr.net (15 images/hour free)

Extracting Text from PDF

From Born-Digital PDF

# Using pdftotext (command line)
pdftotext document.pdf output.txt

# Using Python (PyPDF2)
from PyPDF2 import PdfReader

reader = PdfReader('document.pdf')
text = ''
for page in reader.pages:
    text += page.extract_text()

with open('output.txt', 'w', encoding='utf-8') as f:
    f.write(text)

From Scanned PDF (OCR Required)

# First, run OCR to create searchable PDF
ocrmypdf input_scanned.pdf temp_searchable.pdf

# Then extract text
pdftotext temp_searchable.pdf output.txt

Troubleshooting Common OCR Problems

Problem: Low Accuracy (Below 85%)

Solutions:

  • Increase scan resolution to 300+ DPI
  • Enhance image contrast and sharpness
  • Ensure text is horizontal (deskew if needed)
  • Try different OCR tool (Tesseract vs Google Docs vs Adobe)
  • Specify correct language in OCR settings
  • Remove background patterns/watermarks

Problem: Numbers Recognized as Letters (or vice versa)

Solutions:

  • Use monospace/fixed-width font if creating documents for OCR
  • Increase resolution (300+ DPI)
  • Post-process with find-replace for common errors (O→0 in numbers)
  • Train custom Tesseract model for specific fonts (advanced)

Problem: Merged or Split Words

Example: "Thisis" or "w o r d s" instead of "This is words"

Solutions:

  • Increase image resolution
  • Ensure adequate spacing in source document
  • Use Tesseract's preserve_interword_spaces option
  • Try different OCR tool (Google Docs often handles spacing better)

Problem: Wrong Language Detected

Solutions:

  • Explicitly specify language in OCR settings
  • For mixed-language documents, OCR each language section separately
  • Tesseract: use multiple languages -l eng+spa+fra

Problem: Special Characters Not Recognized

Example: ©, ®, €, £, ¥ appear as ? or blank

Solutions:

  • Use UTF-8 encoding when saving text output
  • Try Adobe Acrobat Pro (best special character support)
  • Manually correct special characters after OCR

Problem: Handwriting Not Recognized

Solutions:

  • Use specialized handwriting OCR (MyScript, Microsoft Ink to Text)
  • Ensure handwriting is neat and printed (not cursive)
  • Increase lighting and resolution
  • Consider manual transcription for critical documents

Batch OCR: Processing Multiple Files

Batch OCR with Tesseract (Python Script)

import os
import pytesseract
from PIL import Image
from pathlib import Path

def batch_ocr(input_folder, output_folder, language='eng'):
    """
    Process all images in folder with OCR
    """
    # Create output folder if doesn't exist
    Path(output_folder).mkdir(parents=True, exist_ok=True)

    # Supported image formats
    image_extensions = ['.jpg', '.jpeg', '.png', '.tiff', '.bmp', '.gif']

    # Process each file
    for filename in os.listdir(input_folder):
        file_path = os.path.join(input_folder, filename)

        # Check if it's an image file
        if any(filename.lower().endswith(ext) for ext in image_extensions):
            print(f"Processing: {filename}")

            try:
                # Open and OCR image
                img = Image.open(file_path)
                text = pytesseract.image_to_string(img, lang=language)

                # Save text to file
                output_filename = f"{Path(filename).stem}.txt"
                output_path = os.path.join(output_folder, output_filename)

                with open(output_path, 'w', encoding='utf-8') as f:
                    f.write(text)

                print(f"  ✓ Saved to: {output_filename}")

            except Exception as e:
                print(f"  ✗ Error: {e}")

# Usage
batch_ocr('scanned_documents', 'extracted_text', language='eng')

Batch PDF OCR with OCRmyPDF

#!/bin/bash
# Batch process all PDFs in folder

input_folder="scanned_pdfs"
output_folder="searchable_pdfs"

mkdir -p "$output_folder"

for pdf in "$input_folder"/*.pdf; do
    filename=$(basename "$pdf")
    echo "Processing: $filename"

    ocrmypdf \
        --optimize 3 \
        --skip-text \
        "$pdf" \
        "$output_folder/$filename"

    echo "✓ Completed: $filename"
done

echo "All PDFs processed!"

Batch OCR with Adobe Acrobat Pro

  1. Tools → Scan & OCR → Recognize Text → In Multiple Files
  2. Click "Add Files" → select all scanned PDFs
  3. Choose language and output options
  4. Click "Recognize Text"
  5. Adobe processes all files automatically
  6. Save to specified output folder

Conclusion

OCR technology has revolutionized how we handle printed documents, making text extraction fast, accurate, and accessible to everyone. Whether you're digitizing business documents, extracting text from screenshots, or scanning historical manuscripts, the right tool and technique can achieve 95%+ accuracy.

Start with free tools like Google Docs or Google Lens for basic needs, then graduate to Tesseract or Adobe Acrobat Pro as your requirements grow. With proper technique and the right tools, you can extract text from virtually any image or PDF with excellent accuracy.

Key Takeaways

  • Choose the right tool: Google Docs for quick tasks, Tesseract for batch processing, Adobe Acrobat Pro for professional workflows
  • Optimize image quality: 300 DPI resolution, high contrast, horizontal text alignment for best results
  • Mobile convenience: Google Lens and Adobe Scan provide excellent on-the-go OCR
  • Expect accuracy variation: 95-98% for printed text, 70-85% for handwriting, 85-92% for phone photos
  • Post-process: Always review OCR output and correct common errors (l→1, O→0, rn→m)
  • Batch processing: Use Tesseract or Adobe Acrobat for processing hundreds of documents efficiently

Ready to convert?

Use Convert a Document to convert, compress, and optimize files fast.

About Convert a Document

Convert a Document helps you understand, convert, and optimize files with simple tools and clear guidance for everyday workflows.