Post

Convert Image-Based PDFs to Searchable Text on macOS with OCRmyPDF

Learn how to convert image-based PDFs into searchable text directly on your Mac using free, open-source tools like OCRmyPDF and Tesseract.

Convert Image-Based PDFs to Searchable Text on macOS with OCRmyPDF

Most of us have received scanned PDFs that look like documents but behave like images. You can’t search, select, or copy text from them—frustrating, right? Many people immediately turn to online converters, but you don’t need to upload sensitive documents to third-party websites. There’s a better, private, and free solution—right on your Mac.

Meet OCRmyPDF.

Why OCRmyPDF?

OCRmyPDF is a command-line tool that adds a text layer to image-based PDFs. It’s open source, actively maintained, and incredibly efficient. Once installed, it converts scanned PDFs into searchable, selectable, and copy-friendly versions—while keeping the original look intact.

No online tools. No account needed. No watermark. No hassle.

Step 1: Install OCRmyPDF on macOS

You’ll need Homebrew installed. To check if it’s already there, run:

1
which brew

If nothing appears, install Homebrew first by following the instructions at brew.sh.

Once Homebrew is ready, install OCRmyPDF:

1
brew install ocrmypdf

Homebrew will automatically install its dependency, Tesseract, the OCR engine behind the scenes.

Optional: Install More Languages

By default, Tesseract supports English. To add support for other languages:

1
brew install tesseract-lang

Step 2: Convert Your Image-Based PDF

  1. Open Terminal.
  2. Navigate to the folder where your PDF is located:
1
cd /path/to/your/pdf
  1. Run the conversion:
1
ocrmypdf input.pdf output.pdf

Your new output.pdf will now contain selectable and searchable text.

Alternatives (if you’re curious)

  • Tesseract CLI: Directly use the OCR engine.

    1
    
    brew install tesseract
    
  • Mac-OCR-CLI: Lightweight CLI tool with API support.
  • Graphical Apps: If you prefer UI tools, try PDF Expert, Prizmo, or Owlocr.

Wrap Up

You no longer need to upload your private documents to shady online converters. With OCRmyPDF, your Mac becomes a powerful OCR engine—100% offline and under your control.

Simple, secure, and effective.

☕ Support My Work

If you found this post helpful and want to support more content like this, you can buy me a coffee!

Your support helps me continue creating useful articles and tips for fellow developers. Thank you! 🙏

This post is licensed under CC BY 4.0 by the author.