Extract text
How to extract text from a PDF
By DeckleUpdated
To extract text from a PDF, open PDF to text, choose your PDF, keep All pages and Mark where each page ended, then choose Extract text. Deckle saves every word from the PDF's selectable text into a TXT file named after your PDF, with a page-break character between pages. It works for PDFs made from documents, web pages and most business software; a scanned page needs OCR first. Your original PDF stays as it was.
Pages become plain text
Selected PDF pages
Order chosen in the review
UTF-8 text
Words without page formatting
Page boundary: U+000C or a blank line
How to extract text from a PDF with Deckle
- Open PDF to text and choose your PDF, or drop it onto the page. Thumbnails of the pages appear so you can check you picked the right file.
- Under Pages and order, keep All pages to export the whole document in page order.
- Under Between pages, choose Mark where each page ended to keep page boundaries, or One continuous document to separate pages with a blank line.
- Read the sentence under the options. It restates the plan, for example "18 pages will be exported in page order."
- Choose Extract text.
- Download the TXT file and open it in a text editor. Check the first page, the last page and one page with a table or columns.
The result screen says how many pages were read for their text, and its Verified: line reports how much of the PDF's selectable text made it into the file.
Which page separator to choose
The two options under Between pages only change what goes between one page's text and the next.
| Option | What goes between pages | Choose it when |
|---|---|---|
| Mark where each page ended | A form-feed character on its own line | You need to know which page a passage came from, or a script will split the file by page |
| One continuous document | A blank line | You will paste the text into a document and want it to flow |
The form feed is the standard page-break control character (U+000C). Many editors show it as a small symbol such as FF or ^L, some show a page break, and some show nothing at all. That is normal: the character is there even when the editor hides it. How to add page breaks to extracted PDF text shows how to find it and replace it with a visible label.
Example: an 18-page contract exported with Mark where each page ended has 17 form feeds. If you need to quote clause 9.2 and cite the page, count the separators before it or search for the next one.
What you get in the TXT file
The file is plain UTF-8 text, so accented names, currency symbols and non-Latin scripts survive as long as the PDF stores them correctly. Deckle starts a new line when the text moves to a new line on the page and adds spaces between words based on the gaps between letters, so words do not run together.
What the file cannot hold is layout. Fonts, bold, headings, images and table borders are gone. A table becomes rows of values separated by spaces. Text in two columns comes out in the order the PDF stores it, which is usually column by column but not always. Why extracted PDF text is in the wrong order covers newsletters, forms and sidebars.
When the PDF is a scan
PDF to text reads text that already exists in the file. It does not read words from images. If the PDF came from a scanner or a phone camera, the result can be an empty file or only the pages that were typed.
Test before you extract: open the PDF in a viewer and try to select a sentence on two or three pages. If nothing highlights, the page needs OCR to recognise the text first. How to extract selectable text without OCR explains how to tell the two kinds of page apart.
Tips
- Extract a few pages first. On a long document, choose Choose pages and enter
1-3to check the output before exporting everything. - Keep page markers for anything you might cite. It is easy to remove form feeds later and impossible to put them back in the right places.
- Open the file in a plain text editor. A word processor may reflow the lines or hide the form feeds, which makes the result harder to judge.
- Unlock first if the PDF has a password. The button tells you when the file is locked; Unlock PDF removes a password you know.
Other ways to extract text from a PDF
- Copy and paste from a viewer. Select the text in your browser, Preview or Acrobat Reader and paste it. Fine for a paragraph; slow and error-prone across many pages. See how to copy text from a PDF.
- Adobe Acrobat's export. Acrobat can convert a PDF to a TXT file from its export options, which suits people who already work in Acrobat.
- Copy from the result screen. For a short document, Deckle's result screen previews the extracted text and offers Copy text when the whole file fits in the preview, so you can paste it without downloading.
Frequently asked questions
Is my PDF uploaded when I extract its text?
No. PDF to text runs in your browser and reads the file on your device. The site loads over the internet, but the PDF is not uploaded.
Why does the TXT file look different from the PDF?
A TXT file holds characters and line breaks only. Fonts, columns and spacing are layout, so they are not kept. The words should match; the look will not.
Can I extract text from only some pages?
Yes. Choose Choose pages and type pages such as 2, 5-7 in Page numbers in output order. How to extract text from specific PDF pages covers reordering and repeats.
What encoding is the text file?
UTF-8, the usual encoding for text files today. If accented letters look wrong in another program, set that program to open the file as UTF-8.
Related tools
- PDF to text to save selectable PDF text as a TXT file
- Unlock PDF to remove a known password before extracting
- Split PDF to keep the matching pages as a PDF alongside the text