PDF tools

PDF to text

Extract the text from a PDF. Runs entirely on your device.

Runs on your device. The file is never uploaded.

PDF to text pulls every text object out of a document with pdf.js and writes them to a .txt named after your file. Each page gets a marker line of three dashes, the word page and its number, then one long line of text. Nothing is rendered or recognised, so a scanned page contributes its marker and no words.

Input

Questions

Does the text get sent off to be extracted?

No. pdf.js runs in a Web Worker in this tab and reads the text objects out of the file directly. Nothing is uploaded, nothing is stored, and the extraction works with your network off. The text shown on the page is the same content written into the .txt you download.

What does the output look like?

Plain text with a marker before each page, written as three dashes, the word page, the number, then three more dashes. Every text run on a page is joined with spaces, runs of whitespace are collapsed to one space, and the result is trimmed. That means one long line per page, and there are two blank lines between pages.

Why is my file mostly empty?

Almost always because the PDF is a scan. There is no error for this: a page with no text objects contributes its page marker and nothing else, so you get a file of headers. Run PDF OCR first to add a text layer, then extract from the OCR result.

Does it keep the layout, columns or tables?

No. Every text item on a page is joined into a single line in the order pdf.js reports them, so a two-column page interleaves and a table loses its rows and cells. Line breaks from the page are not preserved either. This is a content extractor, not a layout parser.

Can I do a folder of PDFs in one go?

Yes. Drop as many as you like and each is handled on its own, coming back as its own .txt named after the source, so report.pdf gives report.txt. Twenty PDFs in means twenty text files out, and one failing file does not take the others down with it.

When should I use PDF to Markdown instead?

When you want structure. PDF to Markdown runs a different extractor that groups items into physical lines, guesses headings from glyph size and turns bullets into list items. This tool gives you the raw text with page markers and no guessing at all, which is what you want for searching, grepping or feeding another program.

Related PDF tools