PDFPilot

How to extract text from a PDF

Text PDFs and scanned PDFs

There are two very different kinds of PDF. A text PDF, created from a word processor or exported from a website, contains the actual characters, so the words can be selected, copied and searched. A scanned PDF is just a picture of a page. It looks like text to you, but the file contains no characters at all.

Extracting text works on the first kind. For a scanned PDF you need optical character recognition (OCR), which reads the picture and converts it to text. This tool does not perform OCR.

How to tell which kind you have

Open the PDF and try to select a word with your mouse, or press Ctrl+F (Cmd+F on a Mac) and search for a word you can see on the page. If it highlights, the file contains text. If nothing is selectable or found, it is a scan.

Step-by-step

  1. Open the Extract Text tool and upload your PDF.
  2. Click extract.
  3. Download the result as a plain .txt file.

What to expect from the output

  • The result is plain text, so fonts, colours, images and layout are not kept.
  • Reading order usually follows the page, but multi-column layouts and tables can come out in a different order from what you see. Review and tidy the text if you plan to reuse it.
  • Text inside images, such as a logo or a screenshot, is not extracted.

Related tasks

If you want the text in an editable document with paragraphs rather than a plain file, the PDF to Word tool puts the extracted text into a .docx file you can open in Word.

Why extract text at all?

Text locked inside a PDF is awkward to reuse. You might want to quote a passage in an email, paste a table of figures into notes, search a long document with your own tools, or feed the words into another program. Extracting the text gives you a plain file that opens in any editor and can be searched, copied and edited freely.

It is also useful for accessibility and for checking what a document really contains. Seeing the extracted text shows what a search tool or screen reader would find, which can reveal problems such as text stored as images.

How PDF text is stored

Unlike a word processor file, a PDF does not store paragraphs. It stores small pieces of text, each positioned at coordinates on the page. To extract the text, software has to work out the reading order from those positions. On simple single-column pages this works well.

On pages with several columns, sidebars, tables or footnotes, the order can come out differently from how you would read it. A table may become a sequence of cell values, and a two-column article may alternate between columns. This is not an error in the file. It reflects how PDFs store text.

Cleaning up the extracted text

  • Check line breaks. Text often breaks at the end of each printed line rather than at the end of a paragraph, so you may want to join lines.
  • Look for hyphenated words at line ends that were split across lines.
  • Read tables carefully, and rebuild them in a spreadsheet if you need the structure.
  • Remove repeated headers, footers and page numbers that appear on every page.
  • Scan the result for odd characters, which can appear when fonts use unusual encodings.

What to do with scanned documents

If your PDF is a scan, the tool will find little or no text because there is none to find. The page is a picture. You need optical character recognition, which analyses the picture and produces text. Results depend heavily on scan quality: sharp, straight, well-lit scans of printed text work well, while handwriting and poor-quality images do not.

A practical test before you begin is to try to select a word in the PDF. If you can highlight it, the file contains text and extraction will work.

Frequently asked questions

Will the extracted file keep the formatting? No. The output is plain text without fonts, colours, or images.

Can I extract text from only some pages? Use the Split PDF tool first to extract the pages you want, then run the result through the text tool.

Is anything sent to a server? No. Extraction runs in your browser, so the document stays on your device.

What if the text looks scrambled? This usually comes from unusual fonts or complex layouts. Try the PDF to Word tool as an alternative and compare the results.

Practical ways to use extracted text

Extracting text does not change who is allowed to use a document's content, so copyright and confidentiality still apply. Check the terms before sharing text taken from someone else's work. With that in mind, there are plenty of practical ways to use it.

  • Search and quote: paste passages into notes, emails or reports with the source in mind.
  • Summaries and study: read the plain text without layout distractions, or copy sections into your own notes.
  • Data checks: compare figures in a document against a spreadsheet by searching the text.
  • Accessibility: a plain text version is easy to enlarge, read aloud with your device's tools, or reformat.
  • Archiving: keep a small, searchable text copy of important documents alongside the original PDF.