How to extract text from a PDF
Choose the right source for the words, then check what the conversion left behind.
Free toolPDF to TextRead PDF pages beside their editable text. Clean up line breaks, read scans with OCR and save the words.Extract your PDF textThe short answer
Extract the embedded text first. Use OCR when the page is a picture without a usable text layer.
For a short quote, select and copy in your PDF reader. For a whole document, use a converter with page review. Save a copy of the original so you can check names, numbers and reading order.
Find out what kind of PDF you have
Try selecting a word in a PDF reader. Selection is a useful clue, though an existing OCR layer can still contain mistakes.
| What you see | What to try |
|---|---|
| Words select and copy correctly | Extract embedded text. OCR adds work and may introduce recognition mistakes. |
| The whole page behaves like a picture | Use OCR with the correct language, then review the transcript. |
| Some pages copy, others do not | Extract text first, then OCR only the missing pages. |
| Text selects but copies as nonsense | Try another reader. The file’s font mapping or earlier OCR may be faulty. |
Choose a method for the task
A full converter is useful when copying a few words by hand would become repetitive. Small tasks often need less.
| Method | Best use | Check afterwards |
|---|---|---|
| Copy in Preview, Acrobat Reader or a browser PDF viewer | A paragraph from a text-based PDF | Columns, omitted lines and copied headers |
| floi PDF to Text | Review and edit pages locally before saving TXT or Markdown | Reading order, line joins and OCR spelling |
| Adobe Acrobat or another desktop OCR application | Repeat work, difficult scans or replacing an existing faulty text layer | Edition, language support and whether processing uses a cloud service |
Poppler’s pdftotext | Local scripts and repeatable text extraction | Missing text layers; it does not perform OCR |
Extract text from the command line
Poppler’s pdftotext extracts existing PDF text. Install Poppler through your operating system’s package manager, then run:
pdftotext -enc UTF-8 report.pdf report.txt
pdftotext -layout -f 3 -l 5 report.pdf selected-pages.txt-layout tries to preserve physical spacing. It can help with simple columns, but its spaces do not become spreadsheet cells. -f and -l set the first and last PDF page positions.
The Poppler manual describes the options and font-encoding limits. For a scanned document, run an appropriate OCR workflow first.
Fix broken lines without losing meaning
Join lines only after checking whether a break separates prose or a meaningful item. An address, poem or list may need those boundaries.
| Extracted text | Possible correction | Risk |
|---|---|---|
docu- followed by ment | document | A genuine compound word may need its hyphen. |
| One sentence wrapped over three lines | Join with spaces. | A heading and body may join if there is no blank line. |
| A repeated running header | Remove it while reviewing each page. | Repeated words can also be part of the document. |
Try the worked sample
The three-page synthetic sample contains two text pages and one scanned page. Its source is generated with scripts/generate-pdf-text-sample.mjs, dated 17 October 2026.
- Open it in PDF to Text. Page 1 contains the split word
docu-followed byment. - Enable Join words split by a hyphen. Check that the result reads
document. - Move to page 3. Its visible words need OCR because they are an image.
- Select page 2 only. Save text should contain its project details without the other pages.
In a Chrome check on macOS on 17 October 2026, pages 1 and 2 extracted immediately. Page 3 needed OCR. Saving only page 2 with Keep line breaks produced 236 bytes of UTF-8 TXT, or 247 bytes of Markdown with its page heading. These figures describe this sample, not your document.
Why columns and tables need review
A PDF stores where content is drawn. It may not describe the order in which you should read it.
A creator can write the left column first, then the right. Another can write both columns one row at a time. An extractor may follow that internal sequence even when the page looks identical.
- Compare the first few paragraphs with the original before trusting a long export.
- Inspect amounts beside their labels. A row of numbers can survive while its relationships disappear.
- Keep page markers when you will need to trace a quotation back to its source.
Save words or keep the PDF?
Save TXT when you want the words alone. Make a searchable PDF when the page’s appearance still matters.
Searchable PDF adds a text layer while keeping the page image. Read the searchable PDF guide for the difference between a picture of a word and a selectable word.