PDF to Text – Extract Text to a TXT File

Pull the text layer out of a PDF and download it as a UTF-8 .txt file. Works with digital PDFs; scanned pages need OCR.

Drag & drop your PDF here or click to browse

PDF

Processing Complete!

Your files are processed in this browser tab with PDF.js and are not uploaded.

How to extract text from a PDF

  1. Add a PDF by clicking the dashed box or dragging the file onto it.
  2. Press Extract Text. The progress bar moves through the pages.
  3. Download the result. It is named after your PDF with a .txt extension, so report.pdf becomes report.txt.
  4. Open it in any text editor. The text of each page is followed by a blank line.

How the extraction works

The tool uses PDF.js, Mozilla's open-source PDF engine, inside your browser. For every page it asks PDF.js for the page's text content – the strings of characters that the PDF draws. The pieces found on a page are joined with spaces, pages are separated by a blank line, and the result is saved as a UTF-8 text file. No server, no AI and no guessing are involved: you get exactly the text the PDF contains, and your file never leaves your device.

It helps to know that a PDF is not a word-processing document. It stores instructions such as "draw these characters at this position", usually without any notion of paragraphs, lines or columns. The order of the text is the order in which the software that created the file wrote it down – normally, but not always, the order you read it in.

What to expect in the output

Tips

Useful for

Limitations and alternatives

Frequently asked questions

Why is my text file empty?

The PDF has no text layer – it is a scan or a set of photos. The pages contain images of text, which need OCR (optical character recognition) to be turned into real text.

Can this tool do OCR?

No. It extracts text that is already stored in the PDF. For scanned documents use an OCR tool such as OCRmyPDF, Tesseract or Google Drive's "Open with Google Docs".

Why are all the lines of a page joined together?

The tool joins the text pieces of each page with spaces and separates pages with a blank line. Line breaks inside a page are not kept, because a PDF usually does not store them as text.

Can I convert a PDF into an editable Word document?

Not here – the output is plain text without formatting. Microsoft Word can open many digital PDFs directly and convert them into editable documents.

What encoding does the TXT file use?

UTF-8, which every modern editor reads correctly, including accented and non-Latin characters.

Why does the output contain strange symbols?

The PDF embeds a font without a correct mapping from glyphs to characters. The text looks right on screen but cannot be extracted faithfully by any tool; OCR is the workaround.

Are my files uploaded?

No. PDF.js reads the file in your browser and the text file is created on your device.

Related tools

Further reading: Handling sensitive PDFs: local processing vs uploading.