PDF to text
Pull the words out of a PDF in reading order, then copy them or save a .txt file.
or drop it here · it never leaves your device
Processed in your browser. Your files are never uploaded. Check it yourself
How to extract text from a PDF
Sometimes you just want the words: to paste a clause into an email, to quote a report, to count what is in a document, or to feed a long PDF into a notes app. Copying from a PDF in a reader often goes wrong, with line breaks in odd places, columns interleaved and page numbers in the middle of sentences. Extracting the text in reading order does that work for you.
The text is pulled out on your device, so a confidential contract or a private letter does not have to be uploaded to be turned into text. If the PDF is a scan, there are no words to extract yet, and the tool says so and points you to OCR PDF.
- 1
Open the PDF
Press Choose a PDF or drop the file on the panel. The first page appears as a small preview with the page count and file size in the bar above. Password-protected files ask for the password first; the text is read from the unlocked copy in memory and nothing about the password is stored.
- 2
Choose pages and order
Under Pages, leave “All pages” selected or pick “Only some pages” and type a range such as
1-3, 7or10-end. Mistakes are explained in plain words beside the box, and the button stays disabled until the range makes sense.Under Text order, “Reading order” groups text into lines, then columns and paragraphs, using where each piece sits on the page. “Order in the file” gives the raw sequence the program that made the PDF wrote the text in. Reading order is what you want almost every time; the raw order is a second opinion for pages where the first looks odd.
- 3
Extract, then view the text two ways
Press Extract text. A progress bar runs while the pages are read. The result appears in a read-only text area, with chips showing the word count, the character count and the number of pages read.
Switch between Whole document and One page at a time. In the whole-document view, “Add page markers” puts a line such as
--- Page 4 ---before each page, which is useful for reference and unhelpful if you are about to paste into another document. In the single-page view, choose the page from the drop-down. - 4
Copy it or save a .txt file
Copy text puts what you can see on the clipboard, with a brief “Copied” confirmation. Download .txt saves it as a plain UTF-8 file named after your PDF, with “-page-4” added if you are viewing a single page. Change options takes you back to the page and order choices without reloading the file.
PDF to text features
- Extracts text in reading order, or in the order stored in the file
- Whole document or one page at a time
- Optional page markers in the whole-document view
- Copy to the clipboard or download a .txt file
- Word, character and page counts
- Tells you when pages are scans and points to OCR
- Pick all pages or a range such as 1-3, 7
PDF to text without uploading your file
The file is read into this browser tab and its text is extracted by code running on your device. Nothing is uploaded, and the text you see is not sent anywhere.
Reading order means the text is grouped into lines, and lines into columns and paragraphs, using where each piece sits on the page. That is what makes a two-column article come out as column one, then column two. The raw order is simply the sequence the program that made the PDF wrote the text in, which is sometimes the same and sometimes jumbled.
- Scanned pages contain pictures, not text, so they come back empty. The tool lists those pages and links to OCR PDF.
- Layout is flattened. Tables become lines of text, and images, shapes and fonts are not carried over.
- The output is plain UTF-8 text, so accents and non-English letters are kept where the PDF has them as real text.
How to prove your file never left your device: a two-minute Network-tab and offline test you can run on this tool.
Quoting from a two-column report
A 30-page report sets its text in two columns, so copying from a reader mixes the columns. Open it, choose Only some pages and enter 4-6, keep Reading order, and press Extract text.
The whole-document view shows pages 4 to 6 with page markers, and the counts show roughly 1,900 words. Copy the paragraph you need, or press Download .txt to save report.txt for later.
Good to know
- If you get a lot of empty pages, the file is probably scanned. Run it through OCR PDF and extract again.
- Turn off page markers if you are pasting the text straight into another document.
- To see what changed between two versions of a document, Compare PDFs lines the words up for you.
- To keep the layout instead of the words, use PDF to JPG or keep the PDF.
- Some PDFs deliberately have no copyable text. If the result is gibberish, the file’s fonts do not map to real letters, and OCR is the way round it.
How a PDF stores text, and why copying from a reader goes wrong
A PDF is built for printing, not for reflowing. A page does not contain paragraphs. It contains instructions to place short runs of characters at exact coordinates: “put these eleven characters here, then these six over there”. The order of those instructions is whatever order the program that made the file happened to write them. A page that looks like two tidy columns may be stored as one line from the left column, one line from the right, then the next.
Each character is stored as a code in a font, and the font says which shape to draw for that code. To turn codes back into text a program needs a mapping, usually a table called ToUnicode. Good generators include one. Some do not, or write a wrong one, and the extracted text then comes out as the wrong letters, or as symbols, even though the page looks perfect.
Extracting text is therefore partly a reconstruction. The tool reads every run with its position, sorts the runs into lines, joins runs that sit on the same line, groups lines into columns, and writes out what it finds in the order a person would read it. When that works, a two-column article gives you column one top to bottom, then column two. When the layout is unusual, such as text wrapped round a picture, a sidebar or a table, the result is a best effort.
What the output looks like, and what it leaves out
- Plain text only. No fonts, bold, italics, colours, images, links or shapes. Characters outside basic English, such as accented letters or Greek, are kept where the PDF holds them as real text, and the file is saved as UTF-8.
- Lines and paragraphs. Line breaks are kept where the page breaks a line, so text copied from a narrow column keeps its short lines. If you plan to paste into a word processor, expect to join lines.
- Hyphenated words. A word split at the end of a line with a hyphen stays split, because the hyphen is part of the stored text and is not distinguishable from a genuine one without reading the meaning.
- Ligatures. Joined letter pairs such as “fi” and “fl” can be stored as one character. Many fonts map them back to two letters, but some do not, and you may see a missing letter in words such as “office”.
- Tables. Cells come out as separate lines or runs of text in row order. The grid is lost; numbers keep their order, which is often enough to paste into a spreadsheet and tidy.
- Headers, footers and page numbers. They are included as text, in the position they appear, so they will interrupt the body text on each page. Page markers help you find and delete them.
- Pictures of text. Not read. Pages that are pictures return empty, and the tool says so.
Scanned PDFs: why they come back empty, and what to do
A scan is a photograph of a page stored inside a PDF. The letters on it are pixels, so there is nothing to extract. This tool detects the pages without text and tells you: if the whole file has none, a banner says “No text found” and points you to OCR PDF; if only some pages have none, it lists their numbers, with “…” after the first twelve.
OCR reads the pixels and adds a hidden text layer that matches them. Once a file has been through OCR PDF, extract the text from the result. Accuracy is good on clean, upright, printed pages and weaker on small type, skewed scans, colour backgrounds and handwriting, which is not supported. Always proof-read figures, names and dates against the page.
Some files mix both kinds: typed text with scanned appendices. In that case you will see pages of text and a few empty ones. Extract the typed pages, OCR the others, and combine the output.
How this differs from copying in a reader, opening in Word, or using Google Docs
| Method | Strength | Weakness |
|---|---|---|
| Select and copy in a PDF reader | Quick for a single sentence | Multi-column pages and sidebars come out interleaved, and selecting across pages is fiddly |
| Open the PDF in Word | Gives an editable document with some layout | Reflows the page into text boxes and frames and often mangles it; the file is large; can hang on long documents |
| Upload to Google Drive and open with Google Docs | Does OCR on scans for you | Requires uploading the file to Google, and puts page images in the document with the text underneath |
| Command-line pdftotext | Fast, scriptable, free | Needs a terminal; unsuited to a one-off job on a phone or locked-down laptop |
| This tool | Reading order, page ranges, counts, a clean .txt; runs in the browser with no upload | Plain text only; no OCR (use OCR PDF first); layout is flattened |
If what you want is to keep the design, extract pictures instead with PDF to JPG, or stay with the PDF.
Practical uses
Checking a redaction
Extracting a file’s text shows you everything it holds in one view. If a name you removed with Redact PDF appears in the output, it is still in the file. This is the strongest check you can do without special software.
Quoting and note-taking
Pull one page or one range to cite a section of a report. A range such as 14-19 is quicker than selecting across six pages.
Counting words
The word and character counts give you the length of a document without opening it in a word processor, which matters for a dissertation limit or a submission field with a maximum. Counts are indicative: the tool counts runs of characters separated by spaces, which will differ a little from a word processor’s count on hyphenated words and numbers.
Feeding text to another tool
Turn off page markers, copy, and paste into a translator, a summariser, a spelling checker or a notes app.
Accessibility
People who use screen readers sometimes find a PDF easier to listen to as plain text. The plain text carries no headings or structure, so treat it as a fallback rather than an accessible version of the document.
Two worked examples with numbers
The figures are round numbers chosen to show how the counts behave. They are not benchmark results.
Length of a 12-page chapter
A chapter of 12 typed pages, with about 450 words on a full page, should come to roughly 5,400 words. The chips read, for example, 5,386 words, 31,200 characters and 12 pages read. Characters divided by words gives about 5.8, which is typical English prose including spaces. If the page count read is smaller than 12, some pages had no text and are listed in the banner.
A mixed file with scanned appendices
A 20-page file has 14 typed pages and 6 scanned appendix pages. Extraction returns text for 14 and a banner saying pages 15, 16, 17, 18, 19 and 20 have no text. Run the file through OCR, then extract again with the range 15-end to add the missing pages. The final text is 14 pages from the first run and 6 from the second, pasted in order.
Limits and edge cases
- Right-to-left scripts. Arabic and Hebrew are stored in many different ways, and the order of the output may need checking against the page.
- Text drawn as shapes. Logos and some design-heavy documents turn letters into outlines. Those words are not text and are not extracted.
- Rotated pages and vertical text. Positions are read as displayed, but heavily rotated or vertical layouts can come out in an odd order.
- Form fields. Typed answers in a fillable form live in the form, not the page text, and may not appear. Flatten with Flatten PDF first if you need them.
- Hidden or white text. Text drawn in white on a white background is still text and is normally extracted along with the rest. That makes this a useful check for hidden words you did not know were there.
- Copy-protected files. A PDF that restricts copying but opens without a password is read normally here. If you do not have the right to copy a document, do not.
- Very long documents. A thousand-page file takes longer and more memory. Use a range to do it in parts.
Privacy: your document’s words never leave the page you are on
Text extraction is a read-only job, which makes the privacy case easy to state: the file is opened in your browser, the engine reads it locally, and the text appears in a box on your screen. No server receives the file or the words. When you press Copy or Download, the text goes to your clipboard or your downloads folder and nowhere else.
This matters most for the documents people most often extract from: contracts, letters, medical reports and statements. The verification guide shows how to watch the Network tab while you extract, and how to confirm it with your connection off.
PDF to text: troubleshooting
- “No text found. This PDF looks like a scan”
- The pages are pictures. Run the file through OCR PDF, then extract from the result.
- Some pages are listed as having no text
- Those pages are scans or images. OCR them, or accept that they are missing from the text. The rest are extracted normally.
- The text is jumbled, or two columns are mixed together
- Switch the order option and extract again; the two orders fail in different places. For pages with sidebars, extract the page alone and read it by section.
- The text is full of strange symbols or the wrong letters
- The PDF’s fonts have no usable character mapping. Printing the file to a new PDF from a browser sometimes fixes it; if not, OCR reads the pictured letters instead.
- Words are missing letters, such as “ofce” for “office”
- Ligature characters such as “fi” were stored without a mapping to two letters. Search and replace those words, or OCR the file.
- “Enter the pages to extract, such as 1-3, 7.”
- The page box is empty. Type a range like
2-5, a list like1, 4, 9, or switch back to All pages. - The page range is rejected as outside the document
- A page number is larger than the page count shown in the file bar. Use “end” in place of a number to mean the last page.
- “This PDF needs a password”
- Enter the password at the prompt. If you do not know it, nothing here can read the file.
- The copy button does nothing
- Some browsers block clipboard access in certain settings. Click inside the text area, press Ctrl+A then Ctrl+C, or use Download .txt.
- Tables lose their shape
- This tool returns text, not layout. Take the table text and rebuild columns in a spreadsheet, or keep the PDF page as an image with PDF to JPG.
Glossary
- Reading order
- The order a person would read the text: lines left to right, columns one after another.
- Stream order
- The order in which a PDF’s generator wrote the text. Called “order in the file” in the tool.
- Text layer
- The real characters on a page, as opposed to a picture of them.
- ToUnicode map
- A table inside a font that turns its character codes back into proper text. Missing or wrong maps cause garbled extraction.
- Ligature
- A single glyph that draws two or more letters, such as fi. It can extract as one character.
- OCR
- Optical character recognition: turning a picture of text into real text.
- UTF-8
- The usual encoding for plain text files. It holds accented and non-Latin letters as well as basic English.
- Page marker
- A line such as --- Page 4 --- added to the whole-document view to show where each page begins.
Related tools and guides
PDF to text: frequently asked questions
Can I extract text from a scanned PDF?
Not directly, because a scan is a picture of text. Use OCR PDF to read the words and make a searchable PDF, then extract the text.
What is the difference between reading order and file order?
Reading order uses the position of each word on the page to follow lines and columns as a person would. File order is the sequence stored in the PDF, which may jump around.
Can I get the text for one page only?
Yes. Extract everything, then use the page view to see a single page, or choose a page range before you extract.
Will tables and formatting be kept?
No. You get plain text. Table cells come out as lines of text, and bold, italics, fonts and images are not included.
Is my PDF uploaded to extract the text?
No. Extraction runs in your browser, so the file and its text stay on your device. You can check yourself.
Why is the text jumbled or full of strange characters?
Some PDFs store text in a way that does not map to real letters, usually after being printed to PDF from certain programs. Try the other order option, or use OCR on the file.
What does the word count include?
In the whole-document view, the words and characters are counted from the extracted text itself, and the page markers you can switch on are not included. In the one-page view, the counts come from the text on screen. Words are runs of characters between spaces, so counts can differ slightly from a word processor.
Does it work on a password-protected PDF?
You will be asked for the password to open the file. Text is extracted from the unlocked copy in memory only.
Does it extract white or hidden text?
Normally, yes. Text drawn in white is still text, so it shows up in the output. That is a reason to run this on a file before you send it.
Can I extract text from several PDFs at once?
Not in one go. Do each file separately, or combine them first with Merge PDF and extract from the combined file.
Why do words split across lines keep their hyphens?
The hyphen is stored as a character in the line. The tool cannot tell a line-end hyphen from a real one without understanding the word, so it leaves the text as written.
Can I get a Word document from this?
You get a .txt file. Paste it into Word, or open the .txt in Word, to get an editable document without layout.
Page updated · By the PDFMagpie team