Extract text from a PDF
Pull the text layer out of a PDF page by page, keeping reading order and paragraph breaks, then copy it or download a plain .txt file.
- Runs in your browser
- Files are never uploaded
- Free, no account
Text is read from the PDF’s own text layer, so it comes out exactly as the document stores it — no OCR guesswork, and nothing sent to a server.
How to extract text from a PDF
- Drop the PDF onto the box above. It is parsed by pdf.js in this tab; nothing is uploaded.
- Wait for the progress bar — extraction runs page by page and stays responsive even on long documents.
- Review the per-page output. Each page has its own copy button so you can take just one section.
- Toggle the page separators on or off depending on whether you want
--- Page 3 ---markers in the file. - Copy everything, or download a UTF-8
.txtfile.
Two kinds of PDF, and why it matters
Every PDF falls into one of two categories, and the difference decides whether text extraction is possible at all.
| Text-based PDF | Scanned / image-only PDF | |
|---|---|---|
| Made by | Word, LaTeX, browsers, InDesign, "Save as PDF" | Scanners, phone camera apps, fax gateways |
| Contains | Real characters plus font and position data | One photograph per page |
| Can you select text in a reader? | Yes | No |
| Works with this tool? | Yes, exactly | No — the tool warns you instead of returning an empty file |
| What you need instead | — | OCR software (Acrobat, ABBYY, Tesseract, or your scanner's own OCR) |
A quick check before you start: open the PDF in any reader and try to select a word with the mouse. If the selection highlights letters, this tool will give you clean text. If it draws a rectangle over the whole page, the page is an image.
How the reading order is reconstructed
This is the part most extractors get wrong, so it is worth explaining. A PDF does not store paragraphs, sentences or even lines. It stores instructions like "draw these glyphs at this position with this font". pdf.js hands back those positioned runs in whatever order the generator wrote them, which is frequently not reading order.
To turn that back into prose, the tool:
- groups glyph runs into lines by comparing their baselines, with a tolerance scaled to the font size;
- sorts the lines from the top of the page downwards, and each line's fragments from left to right;
- inserts a space where two fragments are further apart than the font's natural letter spacing, which recovers word gaps that the PDF stored as positioning rather than space characters;
- measures the typical gap between lines, then starts a new paragraph whenever the gap is noticeably larger, the line is indented, or it begins with a bullet or a number;
- re-joins words split across a line break by a hyphen.
The honest caveat: sorting by vertical position is correct for single-column pages and wrong for magazines, newspapers and academic two-column layouts, where it interleaves the columns. Tables come out as rows of words without their column structure. No purely geometric approach avoids this, and any tool that claims otherwise is guessing too.
Useful things to do with the output
- Search and quote a long report without scrolling through a viewer.
- Count words in a manuscript or a submission with a defined limit.
- Feed a language model or script that expects plain text rather than a binary format.
- Diff two versions of a contract by extracting both and comparing the text.
- Rescue content from a PDF whose source document has been lost.
If you want an editable document rather than plain text, the
PDF to Word converter wraps this same extraction in
a real .docx. To go the other way, see
Text to PDF.
Questions
It says my PDF has no text layer — what does that mean?
The file is a picture of a page, not text: a scan or a photo saved as PDF. There are no characters to extract, only pixels. You need OCR (optical character recognition) to read it, which this tool does not perform.
How do you decide where paragraphs start?
pdf.js returns positioned glyph runs, not paragraphs. We group runs into lines by baseline, sort them top to bottom, then start a new paragraph on a larger-than-usual line gap, a first-line indent or a list marker, and re-join words split by a hyphen at a line end.
Why is the text out of order on some pages?
Multi-column layouts, sidebars and tables store text in whatever order the generator wrote it. We sort by vertical position, which is right for single-column pages but interleaves columns on magazine-style layouts.
Can I get one file per page?
The download combines all pages with a clear separator, and each page also has its own copy button in the results list so you can take just the section you need.