Skip to content

Extract text from PDF

Pull a PDF's text out and save it as a plain text file.

or drop files anywhere on this page

Your files stay in this browser. Nothing is uploaded.

About PDF to Text

To extract text from a PDF, add the file and this tool writes the text already inside it to a plain .txt file. It runs entirely in your browser, rebuilding reading order line by line and leaving a blank line where the spacing between lines suggests a new paragraph.

Reach for it when you want a PDF’s wording without any of its formatting, ready to paste, search or feed into another program. It only reads text that is already there; a scanned page has none until it has been through OCR.

How it works

  1. Add one or more PDFs. Any file that asks for a password to open gets its own box to type it into, and Extract text will not start until every one of them has been accepted.
  2. There are no options to set; every page’s text is extracted in order.
  3. Click Extract text.
  4. Download the .txt file: one per input PDF, named after the PDF, and zipped when there is more than one.
  5. Open it in any text editor. Pages are separated by a form-feed character, which most editors show as nothing or as a small symbol.

What ends up in the .txt file

The tool reads the text layer of each page, the same characters you could select with a cursor, and writes them out as UTF-8 with no byte-order mark. Nothing is recognised from pictures and nothing is added. Images, drawings, fonts, colours and bold or italic styling are left behind; only the characters remain.

Lines are built by grouping text that sits on the same baseline, to within 2 points, and reading each group from left to right. A gap wider than about a third of the text height becomes a space, and a blank line appears wherever the step down from one line to the next is more than one and a half times the height of the line above. Every visual line becomes one line in the file, so a paragraph arrives hard-wrapped at the width it had on the page, and a word hyphenated across two lines stays split.

Pages are separated by a form-feed character (U+000C). It is invisible in most editors, and easy to find and replace if you would rather have a few blank lines between pages. The tool sets no page count or file size limit of its own, so the practical limit is your device’s memory.

Scans, mixed files and garbled text

A scanned PDF stores each page as a picture, so there is no text to read. If no page in a file has any text at all, the tool stops with "This PDF has no text layer — it is probably a scan. Run OCR first to make it searchable." instead of handing you an empty file. The OCR tool adds a recognised text layer behind the page images, and its output can then be run through this one. OCR downloads its language data the first time you use it, so that step needs a connection.

The check is made per file, not per page. A PDF that mixes typed pages with a scanned insert gives you the typed pages’ text and nothing for the scan, without a warning, so the .txt can look shorter than the document. If you add several PDFs and one of them is a scan, the whole run stops with that message and none of the files are produced; take that one out, or OCR it, and run again.

A few PDFs look right on screen but extract as gibberish. That can happen when a file’s fonts do not map their shapes back to real characters, which is a fault in how the file was made rather than something this tool can repair. Exporting the PDF again from the program that created it is the dependable fix.

Worked example: a 12-page report

Take a 12-page quarterly report exported from a word processor, needed as wording for an email summary. Add it, click Extract text and download report.txt. Headings and paragraphs come through as lines of text, with a form-feed between each pair of pages.

A table of figures in the same report arrives as rows of numbers separated by spaces, with no tabs and no alignment. If the numbers are what you need, the PDF to Excel tool is a better starting point than pasting from this file. If you only need a few pages, use the Extract Pages tool first, because this one always reads every page.

Frequently asked questions

Related tools

This tool ran entirely in your browser and nothing was uploaded. Your Recent files list keeps a copy of local files under 5 MB until you clear it. How your files are handled.