Skip to content
Toolcroft

PDF to Text - Extract Text from Any PDF, with OCR for Scans

PDF Tools

Extract text from any PDF in your browser. Instant for digital PDFs; built-in OCR handles scanned pages. Output text, Markdown, or a searchable PDF.

Drop a PDF here or

Digital or scanned - PDF files up to 200 MB

How to use this tool

  1. Upload your PDF. Drop any PDF onto the upload area - digital or scanned. The tool immediately checks every page for an embedded text layer.
  2. Instant extraction for digital pages. Pages with selectable text are extracted instantly and shown per page. For fully digital PDFs you are already done.
  3. Run OCR on scanned pages (if needed). Pages without selectable text are flagged and pre-selected for OCR. Pick the document language and click "Run OCR" - recognition runs locally, about 2-8 seconds per page.
  4. Copy or download the result. Copy text per page or all at once, or download as .txt or Markdown. After an OCR run you can also export a searchable PDF, hOCR, or JSON bounding boxes.

One tool for digital and scanned PDFs

"Getting the text out of a PDF" is really two different problems. A digitally created PDF (exported from Word, generated by an invoice system) carries a machine-readable text layer that can be read directly without OCR. A scanned PDF is just pictures of pages - the text has to be recognised with OCR, which is slower and imperfect. Most sites make you figure out which kind you have and pick the right tool. This one checks for you: on upload, every page is probed for a text layer with PDF.js. Pages with real text are extracted instantly; pages without are flagged and queued for a local Tesseract OCR pass that you trigger with one click. Digital text uses its PDF positions to restore line breaks; multi-column reading order may still need review.

Mixed documents are handled per page

Real-world documents are often hybrids: a digital contract with a scanned signature page appended, or a report where one chapter was photocopied back in. Because detection runs page by page, the fast path and the OCR path combine cleanly - digital pages come from the text layer, scanned pages from OCR, and the final output stitches them together in page order. Each page in the result is labelled with its source, and OCR pages show a confidence score so you know which ones to proofread.

Privacy: nothing leaves your browser

Both extraction and OCR run locally. PDF.js parses the file in your browser's memory, and Tesseract runs as a WebAssembly module on rendered page images. The only network request the tool ever makes is downloading the ~4 MB Tesseract language data file from a CDN the first time you run OCR. Your document itself is never transmitted anywhere - which matters when the PDF is a contract, a medical record, or bank correspondence. If a PDF is password-protected, its password is kept in browser memory while the document is open and is never saved or transmitted.

Output formats

Plain text (.txt) and Markdown (.md) are always available. After an OCR run three more formats unlock: a searchable PDF (your original scan with an invisible text layer embedded at each recognised word, so it becomes selectable and searchable in any viewer), hOCR (Tesseract's HTML format with per-word bounding boxes), and JSON bounding boxes for programmatic processing. The Markdown conversion is heuristic - it infers headings from font-size hints - so review it on complex layouts. Searchable PDF export is available for unencrypted originals; a password-protected PDF can still be extracted and exported in the other formats.

Tips for better OCR results

Select the correct document language before running OCR; it is the single biggest accuracy factor. Rotate sideways scans with the hover controls first - Tesseract expects upright text. And if a PDF already has a bad text layer (garbled output from someone else's OCR), click those pages to force a fresh OCR pass; the new result replaces the garbage text.

Frequently asked questions

Is my PDF uploaded to a server?

No. Text extraction (PDF.js) and OCR (Tesseract via WebAssembly) both run entirely in your browser. A PDF password is also used only in memory while that document is open and is never sent to a server. The only network request for OCR is the ~4 MB Tesseract language file, downloaded from a CDN the first time you run OCR.

Can I extract text from a password-protected PDF?

Yes. Enter the PDF password when prompted. The password stays in browser memory for the open document and is not saved. OCR and text extraction still run locally. Searchable PDF export is not available for password-protected originals. TXT and Markdown remain available; hOCR and JSON unlock after OCR.

How does the tool decide between extraction and OCR?

On upload, each page is checked for an embedded text layer. Pages with real text are extracted instantly. Pages without selectable text (typically scans) are flagged and pre-selected for OCR - you choose whether to run it.

Can I force OCR on a page that has a text layer?

Yes. Click any page thumbnail in the OCR panel to include it in the run. This is useful when a PDF has a garbage text layer from a bad previous OCR pass - the new OCR result replaces the text-layer text for that page.

Why is OCR slow compared to extraction?

Extraction just reads text that is already in the file. OCR runs a neural network over a rendered image of each page inside a WebAssembly module - expect 2-8 seconds per page depending on page size and device speed.

What languages does OCR support?

100 languages via Tesseract. Select the document language before running OCR - choosing the correct language significantly improves accuracy. Documents mixing two languages should use the dominant one.

What is the Searchable PDF output?

After OCR, the tool can embed an invisible text layer at each recognised word position in an unencrypted original, making the scanned PDF selectable and searchable in any viewer without changing its appearance. Word positions are approximate. Password-protected originals can still be extracted and OCRed, but cannot currently be exported as searchable PDFs.

How accurate is the Markdown output?

Markdown formatting is heuristic. OCR pages use font-size hints to infer headings; text-layer pages are emitted as plain paragraphs. It works well on cleanly structured documents, but manual review is recommended.

Browse all pdf tools