PDF to text
Extract the text layer as plain .txt. Preview it here before you download.
PDF to Text
Never uploadedYour file is processed in this tab and never sent anywhere.
How to pdf to text
- Drop the PDF. The text layer is read page by page in this tab.
- Check the preview. See what came out before saving. Choose how line breaks are handled.
- Download the .txt. Plain text, ready to paste anywhere.
About pdf to text
A PDF that was made from a word processor carries an invisible text layer alongside the visual page. That layer is what lets you select and search. Extracting it gives you the words as data rather than as a picture of words, which is what you need before you can diff two versions, feed the content into something else, count it, or simply paste it somewhere without the formatting coming along.
PDF.js reads that layer directly. Because it reads what is stored rather than looking at the page, the extraction is exact for the characters themselves — no recognition step, no guessing, no errors introduced. What is imperfect is the layout, because a PDF stores text as positioned fragments rather than as flowing paragraphs. Multi-column pages, tables, headers, and footnotes were never sequential in the file, so reconstructing a sensible reading order is inherently a heuristic.
The line break option exists because of that. Preserve keeps the visual line structure, which suits poetry, code, addresses, and anything where the line ending is meaningful. Flatten joins lines within a paragraph and breaks only at genuine paragraph boundaries, which is what you want when the text is prose and you are going to reflow it somewhere else. Try both and look at the preview — which is right depends entirely on what the document is.
The failure case is worth stating plainly. If your PDF is a scan, there is no text layer to read. It is a photograph of a page, and this tool will return nothing or almost nothing. That is not a bug and no amount of retrying will fix it. What you need is optical character recognition, which looks at the picture and works out what the letters are. That is a different engine and it lives in the OCR tools section.
Will text extraction work on your file?
| Document origin | Text layer | Result |
|---|---|---|
| Exported from Word, Docs, or LaTeX | Yes | Clean, exact extraction |
| Printed to PDF from a browser | Yes | Good, some layout noise |
| Scanned on a flatbed or phone | No | Empty — use OCR instead |
| Scanned then OCR'd by other software | Yes | Works, quality depends on that OCR |
| A PDF of slides or a poster | Usually | Text comes out, order may be odd |
PDF to Text FAQ
Why did my PDF produce no text?
It is a scan. A scanned page is a photograph, with no text layer to read. You need OCR, which recognises letters in an image, rather than text extraction.
Why is the text out of order?
PDFs store text as positioned fragments, not as flowing paragraphs. Multi-column layouts, tables, and sidebars have no inherent reading order, so any extractor has to guess.
Should I preserve or flatten line breaks?
Preserve for code, addresses, and poetry where line endings matter. Flatten for prose you intend to reflow elsewhere.
Is the extracted text accurate?
The characters are exact, because they are read from the file rather than recognised from an image. The layout and reading order are approximations.
Can I extract text from just one page?
Split the page out first, then extract. The tool reads the whole document in one pass.
Is my document uploaded?
No. PDF.js reads the text layer in this browser tab. Nothing is transmitted.