OnlineTextLab
Esc

PDF to Text Extractor

The words from a PDF as plain text, with line breaks in sensible places.

Drop your PDF here

Or paste it with Ctrl V

or drop it here

Works on PDFs with a text layer. Scans need OCR software, which this is not.

Runs on your device. Your files and text are not uploaded.

About PDF to Text

Copying text out of a PDF by hand tends to go badly. It breaks across columns, or it runs across several pages one selection at a time. This tool reads the whole file at once and gives you all its text in a box you can copy, or as a .txt file named after your document.

It starts by itself as soon as you select a file. What it can do depends on how the PDF was made. A file exported from Word, a browser or a typesetting program has a text layer and works well. A scanned document usually has only pictures of pages, and there is no text to find. In that case you get a clear message saying no text was found, and no empty file to download.

How it works

A PDF does not really store paragraphs. It stores pieces of text with a position on the page, and those pieces can be a whole line or a single letter. The tool reads them through pdf.js in the order the file holds them, then rebuilds lines from their positions. A piece lower down starts a new line. A much bigger drop becomes a blank line, and that is where paragraph breaks come from. On the same line, a space is added only where there is a visible gap, which is what keeps words from being split into letters or stuck together.

Mark each page adds a line like --- Page 2 --- before each page's text, and the numbers stay right even when a blank page sits in the middle. If only some pages are empty, usually scanned ones in an otherwise digital file, a notice tells you how many. The result also shows counts of words, characters and pages with no text. Text outside a page's crop box is not returned, since pdf.js leaves it out.

How to use PDF to Text

  1. Press Select PDF file and choose your document, or drop it here. Reading starts straight away, with progress shown for longer files.
  2. Read the result in the text box. Switch between Plain text and Mark each page if you want page markers.
  3. Press Copy all, or use the download button to save a .txt file.

A real run on a two-page letter

Input
letter.pdf, 2 pages
Output
--- Page 1 ---
letter page 1 heading

Line 1 of body text on page 1.
Line 2 of body text on page 1.
Line 3 of body text on page 1.

Pages 2 | Words 200 | Characters 795 | Pages with no text 0

The output is cut short here. The heading has a blank line after it, because the gap on the page below it was large. A one-page test scan gave the title No text found, with no download and no suggested next steps.

When it helps

  • Pasting a report's text into an email, a note or a translation tool
  • Getting a contract's words into a diff tool to compare two versions
  • Feeding a document into a script or a search index that wants plain text
  • Counting the words in a PDF using the Word Counter

Tips for a better result

  • Turn on Mark each page if you may need to cite where a sentence came from. Page numbers are easy to search for, and remove later.
  • If the output looks like gibberish while the PDF looks fine, the file's fonts have no mapping back to real letters. OCR software on an image of the page is the usual way round it.
  • Multi-column pages may come out in an odd order, since the tool follows the order stored in the file. Try PDF to Images and OCR software if the order is hopeless.
  • To tidy the result, try Remove Duplicate Lines, which clears headers and footers repeated on each page.

Good to know

  • No OCR. Text in scans and in pictures is not recognised, and those pages come back empty.
  • Layout is lost. Tables become lines of words separated by spaces, with no column structure, and there are no images, fonts, bold or italics in the result.
  • Headers, footers and page numbers are included wherever they appear. Hyphens at line ends stay, so words split across lines stay split.
  • Encrypted files must lose their password first, and 100 MB is the most it will read.

Questions people ask

Why does it say no text was found?

The PDF holds pictures of pages, as scans do, with no text layer to read. Recognising letters in pictures takes OCR software, which this tool does not include. Scanner software, Adobe Acrobat and some cloud document services offer that.

Why are my table columns jumbled?

PDFs have no concept of a table, only text at positions. Cells on one row come out on one line with spaces between them. Wrapped cells often end up on lines of their own.

How do I know if my PDF has a text layer?

Open it and try to select a sentence. If you can highlight individual words, it has one. If your selection grabs the whole page as a picture, or nothing at all, it is a scan.

What to use next

Learn more

Last reviewed . Read our editorial policy.