How to Extract Text From a PDF (and Why Scans Come Back Empty)
- pdf to text
- extract text
- how-to
Short answer: open PDF to Text on ilovspdfs, choose the PDF, decide whether to keep page markers and the PDF's line breaks, and download a .txt file. It reads the text layer in your browser, so the document is never uploaded. If the PDF is a scan, there is no text layer to read, and the tool says so: run OCR first.
How do I copy all the text from a PDF?
- Open PDF to Text and choose the PDF.
- Choose the options:
- Page markers add a line such as "--- Page 3 ---" before each page, so you can find your place.
- Keep line breaks as the PDF describes them keeps each printed line on its own line. Untick it to get flowing paragraphs, which is better for pasting into an editor or a translation tool.
- Download the .txt file.
Why do I get no text from my PDF?
Because the PDF has no text in it, only a picture of text. Scanners and phone scanning apps usually save each page as an image. You can tell by trying to select a word in your PDF viewer: if nothing highlights, it is a scan. Run it through OCR PDF, which adds an invisible text layer, and then extract. The scanned PDF not searchable post explains this in more detail.
Will the layout be preserved?
No. A .txt file has no columns, tables, fonts or images, so you get the words in reading order. Text in two columns may come out interleaved line by line. If you need the layout, use PDF to Word, which rebuilds tables and keeps each line in place, or PDF to Excel for tables of figures.
Why do some characters come out wrong?
Some PDFs embed fonts without saying which letter each shape is. The page looks fine, but the text underneath is gibberish or missing, in every tool, not just this one. OCR is the fix there too, because it reads the shapes rather than the font's data.
Is the PDF uploaded?
No. Extraction runs in the browser on your device and works offline once the page is open.
Questions
How do I convert a PDF to a text file?
Use PDF to Text on ilovspdfs: choose the PDF, pick whether to keep page markers and line breaks, and download the .txt file. It is free and runs in your browser.
Why is the text file empty?
The PDF is most likely a scan, which contains pictures of pages rather than text. Run OCR on it first, then extract the text.
Can I extract text from a password-protected PDF?
Remove the password first with Unlock PDF, using the password you have, then extract.
PDF to Text
Pull the words out of a PDF as a plain text file.