PDF to Text
Extract selectable text from a PDF file in your browser. Copy the text or download it as a plain .txt file without uploading the PDF.
Input
Drop a PDF here
or click to browse
Settings
This extracts selectable PDF text. For scanned images inside a PDF, use the PDF OCR tool.
How to extract text from a PDF
Load a PDF, extract its text layer, and copy or download it as plain text.
- 01
Load the PDF
Drop in any PDF that has real text in it: an export from Word or Google Docs, a report, an ebook, a bank statement. Scans need PDF OCR instead.
- 02
Extract the text
Every page is read in order. The output starts each page with a "Page 1", "Page 2" label, so you can find your place in the original.
- 03
Copy it, or download a .txt file
The text file is named after the PDF, so report.pdf becomes report.txt.
How the text is pulled out
The tool uses PDF.js, Mozilla's PDF library (the same one Firefox uses to show PDFs), to read the text layer of each page. A PDF stores text as many small runs placed at positions on the page. The tool joins each page's runs with spaces and collapses repeated spaces and line breaks into single spaces.
It's quick. A 231-page PDF of software licences gave us 107,164 words in well under a second on a laptop. The trade-off is that each page comes out as one continuous block. Paragraph breaks and line endings from the original aren't kept, so you'll want to add paragraph breaks back if the text is going into a document.
Will this PDF work?
The quickest test is to open the PDF and try to select a word. If you can highlight it, the text is there and this tool will extract it.
| Kind of PDF | What you'll get | Better option |
|---|---|---|
| Exported from Word, Google Docs or a website | Clean, complete text | This tool |
| Ebook or report with one column | Good text, one block per page | This tool |
| Two-column paper or newsletter | Text from both columns, sometimes interleaved | This tool, then tidy by hand |
| Tables, invoices, statements | Cell values in a row, without the grid | Copy the table in a PDF viewer, or a dedicated table extractor |
| Scanned pages or phone photos saved as PDF | Nothing, or only page labels | PDF OCR |
| Text with an unusual embedded font | Garbled or missing characters | PDF OCR |
What people extract text for
Quoting from a report
Pull out a section to quote in an email or essay without fighting the PDF viewer's selection tool.
Feeding text to other tools
Extract the text, then paste it into a summariser, translator or grammar checker that only accepts plain text.
Searching a long document
Some viewers search slowly or not at all. A plain text file opens instantly in any editor, where Ctrl+F finds everything.
Limits worth knowing
- Layout isn't preserved, as described above: no paragraphs, columns or tables, just text in reading order as the PDF stores it.
- Images and charts are skipped. Text drawn inside an image isn't text to a PDF reader.
- Password-protected files that need a password to open can't be read.
- Copy restrictions set in a PDF's permissions aren't checked. Respect the document's licence when you reuse the text.
Cleaning up the extracted text
A few predictable things need tidying, and a text editor's find and replace handles most of them. Words split across lines in the original often come out as "infor- mation", because the line-end hyphen is kept and the line break becomes a space. Search for "- " and check each match.
Running headers, footers and page numbers repeat on every page, so they appear once per page in the output. Find one, then replace it with nothing across the file. The "Page 1", "Page 2" labels this tool adds can be removed the same way once you no longer need them. For paragraphs, the quickest route is to read through and press Enter where each one should start.