PDF to Text
Pull the words out of a PDF and keep them as plain text, without the file leaving your machine.
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
- 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.
- 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.
- 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.
- 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.
- 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?
Why did I get an empty file?
Why is the spacing or the line order wrong?
Do tables survive?
What exactly does the JSON option write?
What happens with a PDF that asks for a password?
Can I turn the text back into a formatted document?
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.