How to extract text from a PDF without the mess

Get the text out of a PDF as plain text, why copy and paste mixes up columns and line breaks, and what to do when a scan or odd font gives you nothing.

Compress & convertBy the EddiesPDF teamUpdated 5 min read
Open PDF to text

You select all the text in a PDF, paste it into an email or a document, and get a mess. Sentences from the left column are spliced into sentences from the right one. Every line ends with a hard break. Words are cut in half with hyphens. Sometimes you get nothing at all.

None of that is your fault. A PDF stores text in a way that makes plain copying hard. PDF to text works out the reading order from where the text sits on the page and gives you clean plain text you can copy or save as a .txt file.

Why copying text out of a PDF goes wrong

A PDF page is a list of drawing instructions: draw these characters, in this font, starting at this point. Nothing in the format says "this is a paragraph" or "the left column comes before the right one". The order of the instructions in the file is whatever order the program that made the PDF happened to write them in.

When you select and copy in a reader, you mostly get that internal order. For a two-column article, a newsletter or a page with a sidebar, the reader may run straight across both columns, line by line, which turns two sensible texts into one nonsense text.

Line breaks are the second problem. The PDF knows where each line ends on the page, but not whether that line ends a paragraph or just ran out of room. So a copy keeps every break, and a paragraph pasted into Word or Gmail comes out as a ragged column of short lines.

Spaces are the third. Many PDFs don't store a space character between words at all. The gap is just the next word starting a bit further to the right. A reader has to guess, and that's where "th e" and "thewordsruntogether" come from.

How the tool puts the text back in order

PDF to text doesn't trust the order in the file. It reads every piece of text with its position and size, then rebuilds the page:

  • Spaces come from the gaps. If the gap between two pieces of text is wide enough for the font size, a space goes in.
  • Columns are found by looking for a vertical strip of white space that runs down the page with text on both sides. When that strip spans at least three lines of ordinary sentences, the page is treated as columns and the left column is read top to bottom before the right one.
  • Headings and full-width blocks above or below the columns are read before or after them, where they belong.
  • Tables are detected and written out one row per line, with a tab between cells. If you paste that into Excel or Google Sheets, the cells land in separate columns.

Text that runs sideways, like a label along the edge of a page, is kept, but it's put at the end of that page's text.

Extracting text on EddiesPDF

Everything happens in your browser, so the PDF isn't uploaded. If the file has an open password, you'll be asked for it.

  1. Open PDF to text and drop the PDF on the page.
  2. Leave "Pages" empty for the whole document, or type a range like 1-3, 5.
  3. Tick "Add page separators" if you want a line such as --- Page 3 --- before each page's text.
  4. Open "More options" if you need to change "Line breaks" or "Line endings" (more on both below).
  5. Click "Extract text". The text appears in a box under the file.
  6. Click "Copy text" to put it on the clipboard, or "Continue to download" to save it as a .txt file named after the PDF.

The .txt file is UTF-8, so accented letters, Greek, Cyrillic and Asian scripts come through intact as long as the PDF stores them properly.

Keep lines or join them into paragraphs

"Line breaks" has two settings. "Keep lines as on the page" is the default: the text breaks exactly where it breaks in the PDF, with a blank line between paragraphs. That's what you want for addresses, poems, code listings or anything where the line structure means something.

"Join lines into paragraphs" turns each paragraph into a single line. Words split across lines with a hyphen are put back together, so "infor-" plus "mation" becomes "information". For text you're going to paste into an email, a Word document, a translation tool or a chatbot, this is the setting I'd use. It saves you removing dozens of line breaks by hand.

"Line endings" is about how a line break is stored in the file. "Unix and macOS (LF)" is the default and works almost everywhere, including current Windows Notepad. Pick "Windows (CRLF)" only if an older Windows program shows the whole file as one long line.

When you get no text, or garbage

If the tool says "No text was found in this PDF", the document is almost certainly a scan: a picture of a page with no text in it. If it finds only a few characters per page, you'll see a warning that the PDF is probably scanned and that this tool doesn't run OCR.

For scans, use OCR PDF. It recognises the characters in the page images, and its "Output format" includes "Text", so you can get a .txt file straight from it without coming back here. The guide to making a scanned PDF searchable explains the settings and what accuracy to expect.

The other failure looks different: the text comes out, but as strings of odd symbols or the wrong letters. That happens when a PDF embeds a font without a proper map from its glyphs back to real characters. The page looks fine because the shapes are right, but the file doesn't know which letters they are. No text extractor can fix that, because the information isn't in the file. OCR can, since it reads the shapes. In OCR PDF, untick "Skip pages that already have text" for these files, otherwise it will see the broken text layer and skip the page.

What this tool won't give you

Plain text has no fonts, no bold, no images and no layout, and that's the point of it. If you want headings, lists and tables kept as structure, PDF to Markdown gives you the same text with that structure marked up. If you want a document you can edit with its formatting, use PDF to Word. And if the goal is a table you can add up, PDF to Excel keeps the rows and columns as real cells.

Whichever you use, check the first page that has columns or a table before you rely on the rest. If that page reads in the right order, the others almost always do too.

Try PDF to text
Free, no sign-up, and it works on your phone too.
Open PDF to text

Also useful: OCR PDF · PDF to Markdown

More guides