PDFora
Pricing All tools

PDF to Text

Pull the text layer out of a PDF into a plain .txt file you can search, paste or process.

Your files are processed locally in your browser and never uploaded.
  1. Upload

    Select or drag-and-drop your file.

  2. Adjust

    Choose your options. Everything happens in your browser.

  3. Download

    Save the finished file instantly. No watermarks.

Copying text out of a PDF by hand is slow and messy: selections jump across columns, headers repeat on every page, and long documents mean dozens of rounds of select-all. This tool reads the text that is already stored inside the PDF and writes all of it into a single plain-text file, page after page, ready for a text editor, a spreadsheet or a script.

It is important to know what "text" means here. A PDF made by a word processor, a browser or accounting software contains real characters with positions. PDF.js reads those characters page by page, joins the pieces on each page with spaces, and separates pages with a blank line. A scanned page, on the other hand, is a photograph of paper; it contains no characters at all, so this tool returns nothing for it. For scans you need OCR, which recognises letters in the image.

The output is deliberately plain. There is no bold, no fonts, no tables, no images, and the original line breaks inside a page are not reproduced; each page arrives as one long run of text. That makes the file easy to search and feed into other tools, but it is not a way to rebuild the document's layout. When layout matters, PDF to Word is the better route.

How to extract text from a PDF

  1. Open PDF to Text and choose one PDF file.
  2. Click Extract text. Each page's text content is read in turn; the progress bar moves page by page.
  3. When it finishes, the result tells you how many pages were processed. Download the .txt file, named after your PDF (thesis.pdf gives thesis.txt).
  4. Open the file in a text editor and search for a phrase you know is in the document to confirm the text came through.
  5. If whole pages are empty, those pages are images; run OCR PDF with Text file output to get their text, or make the PDF searchable first and extract again.

When to use this tool

  • Quoting passages from a research paper or report in your own notes without retyping.
  • Searching a long contract or policy for every mention of a term with a text editor's find tool.
  • Feeding a document into a word counter, a translation tool or a script that expects plain text.
  • Recovering the wording of a document whose original editable file is lost, as a starting point for a new version.
  • Checking what a screen reader or search engine is likely to see in a PDF, since they rely on the same text layer.
  • Pulling numbers out of a statement so they can be pasted into a spreadsheet and cleaned up.

What to know before you start

  • Only the text layer is read. Scanned pages, photos of documents and text that was converted to outlines produce empty or near-empty pages in the output.
  • Text pieces on a page are joined with single spaces and pages are separated by a blank line. Line breaks within a page are not preserved, so paragraphs and table rows run together.
  • Reading order follows the order the text is stored in the PDF, which usually matches the visual order but not always. Two-column layouts, sidebars and footnotes can come out interleaved.
  • Headers, footers and page numbers are included on every page, because they are ordinary text to the PDF.
  • Some PDFs store words letter by letter or with odd spacing, which can produce extra spaces inside words. Others use fonts without a proper character map, which produces garbled symbols instead of letters.
  • Text in images, charts and diagrams is not extracted, nor is text inside form fields that has not been flattened into the page. Hyphenated words that were split across two lines in the PDF usually stay split, with the hyphen and a space in the middle. A quick search for '- ' finds most of them.

Tips for the best results

  • If the result is gibberish or empty, try selecting text in a normal PDF viewer first. If you cannot select it there, extraction will not work either, and OCR PDF is the tool to use instead: choose Text file output to get the recognised text directly.
  • Use your editor's find-and-replace to strip repeated headers and footers once, rather than fixing them by hand on each page.
  • For tables, PDF to Excel keeps rows and columns apart; plain text squeezes each row into one line.
  • Save the .txt as UTF-8 if your editor asks; accented and non-Latin characters extracted from the PDF are kept as Unicode.
  • Split a huge PDF first if you only need one chapter; a smaller text file is easier to work with. Hidden text, such as a text layer that another program's OCR placed underneath a scanned image, is extracted like any other text.

A worked example: a law student building a reading list

A law student has a 60-page court judgment as a PDF downloaded from a court website and wants to find every paragraph that cites a particular earlier case, then paste those passages into her notes. Scrolling and copying in a PDF viewer keeps grabbing the running header along with each paragraph.

She extracts the text and opens judgment.txt in a plain editor. Searching for the case name finds eleven mentions. Because each page is one block of text, she can see roughly which page each hit is on by counting blank-line breaks, and the header line appears at the start of every page block, which is easy to ignore.

One page comes out empty. Opening the PDF again, she sees it is a scanned annex inserted into the judgment. She runs the judgment through OCR PDF with Text file output, copies the annex text from that file and pastes it into the gap. The lesson is general: a PDF can mix real text pages and image pages, and only the first kind is extracted directly.

Troubleshooting

The text file is empty or has only blank lines
The PDF is scanned or consists of images. Use OCR PDF with Text file output instead, or make a searchable PDF first and extract from that.
The output is full of strange symbols
The PDF uses a font without a usable character map, so the characters cannot be translated back to letters. OCR on the rendered pages usually works where extraction fails.
Words are split with extra spaces
The PDF stores text in small fragments, and the tool joins fragments with spaces. Use find-and-replace in your editor to tidy common patterns.
Columns are mixed together
The text is read in the order it is stored, which for multi-column pages may jump between columns. Copy the relevant column from the PDF viewer, or use PDF to Word for layout-aware conversion.
The PDF does not open in the tool
It may be password-protected or damaged. Remove the password in the application that made it or with Unlock PDF if you know the password, or run Repair PDF first.
Line breaks inside paragraphs are gone
That is how the tool works: each page becomes one run of text. Paste it into a word processor and add breaks where needed, or use PDF to Word if structure matters.

Frequently asked questions

Can this tool read scanned PDFs?

No. Scans contain images, not characters. Use OCR PDF with Text file output instead, or run it with Searchable PDF output and then extract.

Is formatting such as bold and headings kept?

No. The output is plain text without fonts, styles, tables or images.

Why does every page start with the same line?

That line is the running header in the PDF. It is ordinary text, so it is extracted on every page.

Which languages does it support?

Any language whose characters are stored correctly in the PDF; the text is kept as Unicode. Right-to-left text may come out in storage order rather than display order.

How are pages separated in the .txt file?

Each page's text is followed by a blank line, so pages appear as separate blocks.

Does the extraction happen on a server?

No. PDF.js reads the text inside your browser and the .txt file is generated there, which matters when the document is a draft contract or exam paper you would rather not upload.