FilesShifters

Extract text from a PDF as .txt or Markdown

It runs in your browser: your files stay on your device and are never uploaded.

Drop your PDF here or press to choose it

No file selected.

To extract text from a PDF: to quote a passage, search an archive, or feed a document to a program that only reads text. See the first lines, then download.

How to extract the text from a PDF

  1. Add the PDF. One file at a time.
  2. Look at the first lines. The panel reads the document and shows the start of the file you will get, already in the order it will be written.
  3. Choose the format. Plain text, which opens anywhere, or Markdown, with headings and lists marked up; optionally, a line marking where each page starts.
  4. Press Extract the text and download. The file keeps the PDF’s name, with the new extension.

Columns, headings and lists

On a page with two or three columns, the whole first column is read before the second: the text does not come out interleaved line by line. Lines set larger become headings, and lines that start with a bullet or a number become list items.

A PDF holds no sentences or paragraphs, only pieces of text placed at points on the page. Giving back readable text means putting the pieces into lines, working out where a paragraph ends and in which order the columns are read. Here that is done by the same code as PDF to Word, with the same caution: columns are split only when the signal is clear, because breaking a table apart would be worse than leaving it alone.

In Markdown a heading starts with #, a list item with - or its number, and the characters that mean something in Markdown (asterisks, underscores, square brackets) are escaped, so the text stays the document’s own.

Scanned documents

A scanned page is a photograph: there is no text in it to extract. The panel tells you as soon as you add the file and the button stays off, instead of handing you an empty file.

Reading a scan takes text recognition (OCR), which this tool does not do: Recognize text (OCR) does, in your browser too. If only some pages are images, the text of the others is extracted anyway, and both the panel and the note under the result say which pages will be empty.

What this tool does not do

  • It does not rebuild tables. A table becomes lines of text with the cells side by side; a table made of long sentences may be read as two columns.
  • It does not read formulas. Symbols, fractions and subscripts come out as scattered characters or go missing: a formula has no plain-text form.
  • It does not always guess the order. On complex layouts, such as boxes, captions, text wrapped around images or newspaper pages, the reading order can be wrong.
  • It does not drop running headers and page numbers. They stay in the text where they appear; a heading printed at the very top of a page is taken for a running header and stays plain text.
  • It does not read scans. A photographed page has no text: for that there is Recognize text (OCR).
  • It does not open a password-protected PDF. Unlock it first with Unlock PDF, if you know the password.

How to check it yourself

Open the downloaded file in a text editor next to the PDF: its first lines are the ones in the preview, and on a page with columns the second column starts after the first one ends.

To test the order, search the file for the last word of a page’s first column: right after it you should find the start of the second column, not the line beside it.

Frequently asked questions

Is the PDF uploaded anywhere?

No. Your browser reads the document on your device, and the text file is created there: the site is made of static files only, and there is no server that receives files.

Plain text or Markdown?

Plain text opens anywhere and is what many programs ask for. Markdown also keeps headings and lists, which helps if the text ends up on a web page, in a wiki or in a note.

Why does it say my PDF is a scan?

Because its pages contain no characters, only images. That happens with documents that went through a scanner or a camera: to read them, use Recognize text (OCR), which reads the words in the images.

Do accented letters come out right?

Yes, the file is UTF-8. If a PDF draws its letters with a font that lacks the table saying which letter is which, the text comes out wrong in your PDF reader too, and that cannot be fixed here.

How is this different from PDF to Word?

The PDF is read the same way; the result differs. Here you get bare text, without styles, to paste or hand to a program; PDF to Word gives you a document to edit.

How can I check that this is true?

Open the developer tools, Network tab, and extract the text from a PDF: you will see this page’s files, the requests of the visit counter described at the bottom of the page, and no request that carries your document.