PDF to Text
Extract selectable text from a PDF to .txt.
About this tool
Extract a PDF’s selectable text as a plain .txt file, right in your browser — the file stays on your device. Scanned PDFs need OCR first.
This tool processes files entirely on your device. Nothing is uploaded to a server.
More details
PDF to Text reads the text stored in one PDF and saves it as a plain UTF-8 .txt file. A PDF records where each run of text sits rather than where its lines end, and some files leave out the spaces between words, so the extractor, pdf.js, works both out from positions: a new line where the text drops down the page, a space where the gap between letters is wide enough to be one. Pages are separated by one blank line, a page with no text adds nothing, and no page numbers or markers are inserted. Typefaces, bold, colour, pictures and ruled lines are left behind.
Extraction runs inside your browser tab, so the PDF is not uploaded to pdf.xyz. It takes one file at a time, up to 100 MB. Before you save, the result gives the character count and how many of the document's pages it came from, names any page with no selectable text, and shows the full text in a scrollable box you can copy from.
Text comes out in reading order where the order the PDF stores it in is out of step with the page: a title or heading stored after the text under it, a running header stored last, and a footer or page number stored first are each moved to where they read. A page stored a column at a time comes out a column at a time, while a page carrying rotated or vertical text, or more separate pieces of text than the extractor will sort (a detailed map can have that many), keeps the order stored in the file. A scanned page stores a picture, not characters, so an image-only PDF is reported as having no selectable text rather than producing an empty file. Hidden text is the opposite case: white lettering, words under a black box drawn on top, and the invisible layer an OCR pass adds are all extracted.
When to use it
Taking a whole document's words in one go
Instead of selecting page after page in a viewer, get every page's text as one file to paste into an email, a spreadsheet or a translation tool.
Feeding a script, search index or word count
A UTF-8 .txt file with no markup is plain input for grep, a word counter, a diff against an earlier draft, or a search index.
Testing whether a redaction really removed the words
If a name was blacked out by drawing a box over it, the name is still in the text layer and appears in the preview.
Reading what an OCR pass actually recognised
A searchable PDF from OCR carries an invisible text layer. This shows it as plain words, so a page recognised in the wrong language stands out before you rely on it.
What this tool can do
- Output
- The PDF's embedded text as a plain .txt file, previewed on the page before you download it.
How it works
1Add a PDF
Drop one PDF where the page says "Drop your PDF here, or browse", or click there to open your file picker. A file that is not a PDF, is empty, or is over 100 MB gets a message naming it before any page is read.
2Press Extract text
The file name, page count and size appear. There are no settings: press Extract text, and the button reads "Extracting text…" while pages are read.
3Check the preview
Under "Text extracted" you see the character and page counts and the text itself in a scrollable box. Select any part of it to copy just that passage.
4Download TXT
The button shows the size of the file it will save, named after your PDF with "-text.txt" on the end. "Start over" clears the page for another document.
Common questions
What does "No selectable text found" mean?
No page of the PDF has stored characters, usually because the pages are scans or photos, or the lettering was converted to outlines. OCR PDF can recognise the words and return a searchable PDF, a .txt file, or both, but it is not local: the file goes over TLS to pdf.xyz's secure server, the input is deleted when the job finishes, and the download link expires after 60 minutes.
Are columns, tables and spacing kept?
A new line on the page becomes a new line in the file; horizontal alignment is lost. Columns and table cells come out as plain text, split by spaces and line breaks, and a page stored a column at a time comes out a column at a time. For a grid you can sort and sum, Extract Tables returns a ZIP of per-table CSV files plus one Excel workbook; it runs on our secure server, so that document is uploaded.
Why are my form entries missing from the text?
Answers typed into fillable fields belong to the form, not the page, so they are not extracted. Run the file through Flatten PDF first, which also works in your browser; the entries become page text, though a value can run straight on from the words before it with no space.
Can it open a password-protected PDF?
Not one that needs a password to open: it stops while loading with a message saying it is password-protected. Unlock PDF removes that password if you enter it, but it runs on pdf.xyz's secure server, so the file and the password are uploaded. A PDF that opens without a password, even one whose author set it to forbid copying, is read like any other file.
Will the text be readable in other languages and scripts?
The file is UTF-8 with Unix-style line breaks, so any script comes through as long as the PDF maps its glyphs back to Unicode. Fonts embedded without that map give wrong characters or none, and this tool cannot repair them.
Does a PDF from Redact PDF still have text to extract?
No. Redact PDF turns every page into an image and paints over the areas you choose, so its output has no text layer at all and this tool reports that it found no selectable text.
Does PDF to Text work offline?
Not fully. The page and its processing engine load over the network, and parts of the engine are fetched the first time a step needs them. The processing itself runs on your device. Chinese, Japanese or Korean text whose font is not embedded in the PDF needs a character map, downloaded from our site the first time it is needed, and that step needs a connection.
How large can my file be?
Up to 100 MB per file.
Does PDF to Text keep the layout?
No. You get the words as plain text — one block per page, with a blank line between pages — without fonts, images, columns or table layout.
Does PDF to Text work on a scanned PDF?
Not on its own. PDF to Text reads the text a PDF already contains, and a scanned page is a picture with no text inside it, so there is nothing to read. Run the scan through OCR PDF first, then use the result here.
Related tools
All toolsGuides
All guidesHow to convert a PDF to text
Copy the selectable text out of a PDF into a plain UTF-8 .txt file, preview it before you save, and see which pages had none. Your PDF stays on your device.
Related guideHow to make a scanned PDF searchable
OCR a scanned PDF so its text becomes searchable and selectable — processed on an auto-deleting server, no account needed.
Related guideHow to compare two PDF files
Compare two versions of a PDF in your browser: page count, file size and every added or removed line of text, with a downloadable report. Scans need OCR first.
No sign-up required. Your files stay on your device until you run a tool.