PDF to Text

Pull the words out of a PDF and keep them as plain text, without the file leaving your machine.

Runs on your devicePDFWorkingNo account needed

What this tool does

PDF to Text reads the text objects a document already carries. Each selected page is opened with pdf.js, its glyph runs are collected in the order they appear, and lines are rebuilt from the coordinates those runs hold: a vertical shift of more than half a run's glyph height starts a new line, and a horizontal gap wider than a quarter of that height becomes a space. A PDF stores positioned characters rather than sentences, so that reconstruction is the entire job.

You decide what comes back. One text file joins the pages together with a marker line — --- Page 3 --- — above each of them, unless you switch Mark page breaks off. One file per page writes report-p1.txt, report-p2.txt and so on, numbered by the page each one came from, keeping the pages separate on disk. The JSON option produces an indented array holding one object per page, each with its page number and its text, which is the shape to choose when a script rather than a person will read the result.

What the tool cannot do is supply text that was never stored. A scanned document is a picture of a page, so extraction returns nothing for it; the summary line counts how many pages had no extractable text and names PDF OCR, which recognises character shapes instead of reading characters that are already there. That count is blunt, though — it catches any page the reader could not decode, and its wording blames a scan for all of them. Presentation is discarded as well, deliberately: type size, weight, colour, images and links do not survive, tables collapse into runs of words because nothing in the file records a column boundary, and a page laid out in columns comes out in the order the glyph runs sit in the file, which is frequently not the order a person reads them in.

The whole job stays in this tab. The PDF is read from disk into memory and decoded on your own processor by a copy of pdf.js served from this site, and no part of the document is sent anywhere. That is not the same as working offline: the page and that reader still have to arrive over the network, and nothing here is kept in an offline cache. Three limits follow from the browser doing the work. A password-protected document is refused by name and has to pass through Unlock PDF first. A long file is bounded by the memory of the device you are using, so pages are handled one at a time with progress reported and the run can be stopped partway. And the reader is started without the extra character-map files pdf.js keeps for the predefined CJK encodings, so a document whose fonts name one of those rather than Identity-H comes back empty or as the wrong characters.

How to use it

  1. Add one PDF, or several. Documents are worked through one after another and each produces its own output named after the source file, so a queue never merges into a single result.
  2. Choose which pages to read. Pages defaults to all. A range like 1-10, a list like 2,7,9, an open end like 7-, and the words first and last inside a range are understood; odd and even work when one of them is the whole value rather than one item in a list. A number past the end of the document stops the run with the offending part quoted back, rather than being ignored.
  3. Pick the shape of the output. One text file for reading and pasting, one text file per page when the pages have to stay apart, or JSON with an entry per page when something else has to consume it.
  4. Decide about the page markers. Mark page breaks writes a --- Page 3 --- line above each page in the single-file output. It stays on unless you clear it, and the checkbox is shown only while One text file is selected, because the other two outputs already carry the page number in the filename or in the entry.
  5. Save what comes back. The summary line counts the characters extracted and the pages read, and adds the number that produced nothing only when at least one did. Files from every document in the queue are listed together, though those counts describe the last one processed. Take the files one by one, or use Download all as ZIP once a run has made more than one.

Processing & privacy

Runs on your device. Your file is processed directly in this browser.

Common use cases

Quoting from a report

Selecting text in a viewer drags in headers, column jumps and hyphenation. Extracting first gives you something you can tidy before it lands in your own document.

Searching a folder of documents

A text editor or grep searches a directory of .txt files instantly, where the same search across PDFs depends on whichever desktop indexer happens to be installed and working.

Feeding another tool

Word Counter, Text Diff, Readability Score and Keyword Density all want plain input. Converting first is the quickest way to strip formatting that would otherwise arrive as markup or not arrive at all.

Checking whether a PDF has a text layer

Run it and read the summary. Pages counted as having no extractable text are usually scans, which tells you an OCR pass is needed before any search will ever find words in that file.

Handing page-aligned text to a script

The JSON output keeps every page as its own entry, so whatever consumes it can cite real page numbers instead of guessing at character offsets.

Questions

Is my PDF uploaded anywhere?
No. The document is read from disk into this browser tab and the extraction runs on your own processor, so nothing about the file is transmitted, logged or stored. The page itself and the PDF reader it pulls in do come from this site over the network — the document you hand them does not travel back.
Why did I get an empty file?
The PDF has no text layer, which nearly always means it is a scan or a photograph of a page. Nothing in it records what the characters are, so there is nothing to pull out, and the summary says how many pages came back empty. PDF OCR recognises the shapes and writes the text layer this tool would then be able to read.
Why is the spacing or the line order wrong?
Lines are inferred rather than stored. The tool groups glyph runs by vertical position and inserts a space where the horizontal gap is wide enough, then keeps them in the order they occur in the file. Columns, sidebars and text boxes therefore come out in file order, which is often not reading order, and no setting here changes that.
Do tables survive?
No. A PDF does not record that a group of words forms a table, only where each word sits, so cells arrive as text on a line with the column boundaries gone. PDF to Excel is the tool that attempts to rebuild the grid; this one does not try.
What exactly does the JSON option write?
An array with one object per page, each carrying the page number and that page's text as a string, indented so it is readable. Choose it when the output is going into code rather than into a document.
What happens with a PDF that asks for a password?
It is turned away rather than half read. The renderer reports the file as password-protected and the error names the document that stopped the run. Unlock PDF strips the password when you already know it, and what it writes extracts normally here. Nothing on this page tries to guess or break one.
Can I turn the text back into a formatted document?
Not from this output — it is plain text with no styling left to restore. PDF to Word rebuilds an editable document from the original PDF, and PDF to Markdown keeps a lighter version of the structure.

Related tools

  • Merge PDF — Combine several PDFs into one document in the order you choose.
  • Split PDF — Split one PDF into separate documents by page range.
  • Compress PDF — Reduce PDF file size while preserving the quality that matters.
  • PDF to JPG — Export every page of a PDF as a JPG image.
  • JPG to PDF — Turn one or many JPG photos into a single PDF.
  • Protect PDF — Add a password and set permissions on a PDF.