How to Extract Text From a PDF (Including Scanned Ones)
Sometimes you do not want the document — you just want what it says. A quote to paste into an email, figures to drop into a spreadsheet, a paragraph to reuse somewhere else. Whether that takes five seconds or turns into a fight depends entirely on one thing: whether the PDF actually contains text, or only a picture of it.
First, work out which kind of PDF you have
Every PDF falls into one of two camps, and they look identical on screen.
A born-digital PDF was exported from software — Word, a browser, an accounting package. Every character is stored as a character. A scanned PDF is a photograph of a page. The words are areas of dark pixels, and there are no characters in the file at all.
The five-second test: try to select a sentence with your cursor. If it highlights, the text is there and extraction will work immediately. If nothing highlights, it is a scan, and you have one extra step to do first.
If the text is already there
Open PDF to Text, add the file, and download the result. You get the words as plain text with no formatting — no fonts, no columns, no styling, just the content.
That is usually exactly what you want when the destination is somewhere else: an email, a spreadsheet, a notes app, a search index, or an AI tool you are feeding documents into. Formatting that would be lost in the paste anyway is not worth carrying.
If it is a scan, add the text first
A scan has nothing to extract, which is why text extraction on one returns an empty file rather than an error. Nothing is broken — the tool looked for text and correctly found none.
OCR fixes this by reading the shapes on the page and writing the matching characters into the file as real text, sitting invisibly underneath the original image. Run OCR, then run text extraction on the result and it behaves normally.
What plain text keeps, and what it throws away
- Kept: the words, in reading order, with paragraph breaks.
- Lost: fonts, sizes, bold and italic, colours, and any styling.
- Lost: images, logos, signatures and stamps — text extraction returns text only.
- Flattened: tables become lines of text. The values survive; the grid does not.
- Unreliable: multi-column layouts, which may be read across the columns rather than down them, interleaving paragraphs that belong apart.
None of that is a defect — it is the point. Plain text is the format you choose when you want content stripped of presentation. If you need the presentation, you want a different tool.
Choosing the right output for the job
People often reach for text extraction when they actually want something else. A quick guide:
- You want the words somewhere else — an email, a spreadsheet, a script, an AI tool. Use PDF to Text.
- You want to edit the document and keep how it looks — use PDF to Word instead. Headings, tables and layout survive; plain text would discard them.
- You want the document to stay a document but become findable — you do not want extraction at all. Run OCR and keep the PDF. It looks unchanged and becomes searchable.
- You want one page as an image — PDF to JPG or PDF to PNG.
Why copy and paste sometimes produces nonsense
Occasionally a PDF lets you select text, but what you paste comes out as gibberish — random symbols, or letters in the wrong order. This is not corruption, and it is worth understanding because no tool fully solves it.
A PDF stores which glyph to draw at which position, and separately a mapping from those glyphs back to actual characters. When a document is produced by unusual software, or with a subsetted or badly embedded font, that mapping can be wrong or missing. The page renders perfectly — the shapes are drawn correctly — but the file's own idea of which characters those shapes represent is broken.
When this happens, the reliable workaround is to stop trusting the text layer and read the page visually instead: run OCR, which ignores the faulty mapping and recognises the characters from the rendered image, then extract from that.
Extracting from part of a document
Text extraction returns the whole document. For a long report where you only need one section, pulling out the pages first is usually faster than wading through the output — Extract Pages gives you just the range you care about, and you extract text from that.
This also matters for accuracy on scans. OCR time scales with page count, so running it across three hundred pages to get at four of them is a slow way to reach the same answer.
A caution about sensitive documents
Text extraction pulls out everything the file contains, which is occasionally more than what is visible. Content hidden behind a graphic, text in a layer that is not displayed, or words underneath a black box that was drawn rather than properly redacted — all of it can appear in the extracted output.
That is a useful diagnostic. If you have received a document that is supposed to be redacted, extracting its text is a quick way to check whether the redaction was real. If the words that were meant to be gone come out in the text file, they were never removed — only covered.
It works the other way too. Before sending a document you have redacted yourself, extract its text and search the output for what you removed. If it appears, the redaction did not work. Secure Redact deletes the underlying text rather than drawing over it, which is what makes it survive this test.
Accuracy expectations on scans
Text extracted from a born-digital PDF is exact — it is the same characters the file already stored. Text extracted after OCR is a recognition result, and very good is not the same as perfect.
Clean printed text at 300 dpi comes out extremely well. Faded receipts, faxes, heavy background patterns and handwriting are where errors appear, usually as single wrong characters rather than whole wrong words. Check anything numeric — account numbers, totals, dates and reference codes are both the most damaging things to get wrong and the least likely to be caught by reading it over.
Cleaning up the output
Extracted text almost always needs a little tidying, and knowing what to expect makes it quick rather than annoying.
- Hyphenated line breaks. Printed text often splits words across lines with a hyphen. Extraction preserves that faithfully, so you get “infor-” and “mation” on separate lines. A find-and-replace on “-” followed by a line break fixes the lot in one pass.
- Headers and footers on every page. Page numbers, document titles and confidentiality notices repeat at each page boundary and land in the middle of your text. They are easy to spot because they recur identically.
- Line breaks mid-sentence. The extraction preserves where lines ended on the page, not where sentences end. Most editors can rejoin these; some tools call it removing hard returns.
- Stray characters from graphics. Bullet glyphs, decorative rules and icons sometimes come through as odd symbols.
For a document you will reuse repeatedly, it is worth doing this cleanup once and keeping the tidied version, rather than re-extracting and re-fixing every time.
Feeding documents into other tools
A growing reason people extract text has nothing to do with reading it: they are putting documents into something else — a search index, a spreadsheet, a database, or an AI assistant that needs the content as text rather than as a file.
Plain text is usually the right format for that, because those systems care about words and not about how the page looked. Two things help. First, extract from a born-digital PDF where you have the choice — the text is exact rather than recognised, so nothing needs checking. Second, if you are working from scans, run OCR at good quality once and keep the OCR'd PDF, so you are not repeating the recognition every time you need the content again.
And check the output before feeding it anywhere that will act on it. A recognition error in a document you read is a typo you will notice; the same error inside an automated pipeline propagates silently.
Try it now
PDF to Text is free, needs no sign-up, and your file is never stored.
FAQ
- Why is my extracted text file empty?
- Because the PDF is a scan — an image of a page with no characters in it. There is nothing to extract. Run OCR first to add a real text layer, then extract.
- How do I know whether my PDF has real text?
- Try selecting a sentence with your cursor. If it highlights, the text is there. If nothing highlights, it is a scan.
- Why does the copied text look like nonsense?
- The PDF's mapping from glyph shapes back to characters is faulty, usually because of an unusually embedded font. The page draws correctly but the file's own character data is wrong. Running OCR ignores that mapping and reads the page visually instead.
- Will I keep the formatting?
- No. Plain text is content without presentation — fonts, styling, images and table grids are all discarded. If you need formatting preserved, convert to Word instead.
- Can I extract text from just a few pages?
- Yes. Pull out the pages you want first, then extract from that shorter document. On scans this is also much faster, since OCR time scales with page count.
- Does extraction change the original PDF?
- No. You download a separate text file and the source PDF is untouched.
- Is it free?
- Yes. Text extraction is free and unlimited with no account. OCR, if your document is a scan, gives you five free uses a day.
- What happens to my file?
- It is processed and discarded the moment your download is ready — never stored, never queued, never read by a person.