Skip to content
YardMaths PDF

Copy text from any PDF: what works and what does not

Updated ยท 5 min read

Drag your cursor across the words, copy, and paste. That works whenever the PDF has a real text layer. If the words will not highlight, the page is most likely a picture of text. To pull out all the text from a file in one go, use our PDF to text tool. It runs inside your browser, so the file stays on your device.

This guide shows how to tell which kind of PDF you have, how to copy a few lines or a whole file, why pasted text often looks broken, and what to do with scanned pages.

Find out what kind of PDF you have

Not every PDF stores words the same way. Some hold real characters. Others hold only a photo of a page. You cannot copy words that are really pixels, so a quick test saves a lot of time.

Try to highlight one word with your mouse. Then type that same word into your viewer's search box. If the word highlights and the search finds it, the file has a text layer and copying will work. If neither happens, you are looking at an image.

Adobe explains the cause plainly: when you scan a paper document into a PDF, the file can contain only image data and no searchable text. The words you see are just part of the picture.

What you noticeWhat it usually meansWhat to do
Words highlight and search finds themThe PDF has a text layerCopy by hand or use the PDF to text tool
A box or a whole page highlights at onceThe page is an imageYou need OCR (see the scan section below)
Text copies but looks scrambledThe layout confuses the order of the wordsCopy one column at a time or clean up after pasting
Some pages copy and others do notThe file mixes typed pages and scanned pagesTreat each kind of page separately

Copy a few lines in your PDF viewer

For a paragraph or two, your PDF viewer is the fastest tool. Switch on its text selection tool, drag across the words, and use the copy command. Then paste into a document or a note.

Apple's Preview app on a Mac works this way. Apple's help page says to choose Tools, then Text Selection, drag over the text, and choose Edit, then Copy. Holding the Option key while you drag selects a vertical strip, which is handy for one column of a table. The Rectangular Selection tool copies part of the page as a picture instead of as text, which is useful when you want a chart but not good for editing words.

Other viewers have similar tools under different names. If your viewer has a hand tool and a text tool, make sure the text tool is the one that is active. A hand tool will drag the page and never select anything.

Copy all the text from a PDF at once

Dragging across fifty pages is slow and easy to get wrong. A text extraction tool reads the whole file and gives you the words in one block. With our tool the work happens in your browser tab, so a contract, a bank statement, or a medical letter is never sent anywhere.

  1. Open the PDF to text tool.
  2. Drop your PDF onto the page, or press Choose PDF file.
  3. Optionally type the pages you want in the Pages box, and choose whether to mark where each page starts and whether to join the lines of each paragraph.
  4. Press Extract text. A preview of the text appears under the result.
  5. Press Copy to clipboard, or download the text as a .txt file.
  6. Paste it into your document, email, or notes app.

Only need one page?

If you want the text from a single page, type its number in the Pages box of the text tool, and only that page is read. If you also want that page as a PDF of its own, pull it out with the extract PDF pages tool. Our step-by-step guide to extracting one page from a PDF covers that first step.

Why copied PDF text often looks messy

A PDF is built to look the same everywhere. It is not built to be read by software. The documentation for the open source pypdf library says PDF files have no semantic layer, so they do not record where headers, footers, page numbers, tables, and paragraphs are. It adds that text is absolutely positioned on the page, and that tables are usually just text placed in a grid.

That is why a pasted paragraph may break at the end of every line, why two columns can run together, and why a table turns into a stack of cells. The words are right, but the PDF never told anyone which words belong to which paragraph.

  • Paste into a plain text editor first. This removes odd fonts and styles so you can see the raw lines.
  • Copy one column at a time. Dragging across a two-column page often mixes the columns.
  • Fix line breaks with find and replace. Most editors let you replace the break at the end of each line with a space. Keep the breaks between paragraphs. In our PDF to text tool, the option Join the lines of each paragraph does this for you.
  • Check numbers and special symbols. Fractions, math, and bullet marks sometimes arrive as other characters.
  • Read the first paragraph and the last. If both are right, the middle is usually right too.

What to do when the PDF is a scan

A scan needs optical character recognition, usually called OCR. OCR looks at the picture, works out which letters it shows, and adds a text layer. Adobe describes the result as a layer of searchable text that sits on the page while the page looks the same as before. It also suggests reviewing the output afterward for recognition mistakes.

Our PDF to text tool reads the text that is already inside a file. It does not read pictures of words, so on a scan it tells you that no text was found and that you need an OCR tool. We would rather tell you that now than have you wonder why the result is empty.

Our OCR PDF tool does that step in your browser. It recognizes English only. It can make a searchable PDF, a plain text file, or both, and the first time you press Start OCR in a visit it downloads its engine, about 7 MB, from this site. Accuracy depends on the scan, so check the result.

Google offers a free route if you have a Google account. In Google Drive, right-click the file, choose Open with, then Google Docs. Google's help page lists these conditions: PDFs or photos in JPEG, PNG, or GIF format, a file of 2 MB or less, text at least 10 pixels tall, and the image right side up. Google says bold, italics, font size, and line breaks are likely to be kept, while lists, tables, columns, footnotes, and endnotes are unlikely to be detected. Remember that this route uploads your file to Google, so skip it for anything private.

For the best results, start with a sharp, evenly lit scan with strong contrast between the text and the background.

Need the text in an editable document instead?

If you want to edit the content and not just copy it, converting to a Word file may suit you better. Our PDF to Word tool makes a document you can edit. Read what formatting survives a PDF to Word conversion first so you know what to expect.

Questions people also ask

Why does text I copy from a PDF break at the end of every line?

A PDF stores each line as separate text placed at a position on the page. It does not record where a paragraph starts or ends. When you paste, you get the lines as they were placed. Paste into a plain text editor, then replace the line breaks inside paragraphs with spaces.

Does copied PDF text keep the original fonts and layout?

No. Copying and the PDF to text tool both give you plain words. Fonts, colors, columns, and the position of images are left behind. If you need to keep more of the look, try the PDF to Word tool, and expect to tidy the result.

How can I copy text from a scanned PDF for free?

A scan is a picture, so you need OCR. Our OCR PDF tool reads English text in your browser without uploading the file. Another free route is to open the file with Google Docs from Google Drive, which reads text from PDFs and photos that meet its size and quality rules, but it uploads the file to Google, so avoid it for private documents.

Is it safe to use an online tool to pull the text out of a private PDF?

It depends on how the tool works. Many online tools send your file to their servers. Our PDF to text tool runs in your browser, so the file is read on your own device and is not uploaded.

Why do some words look right on screen but paste as strange symbols?

The text layer inside a PDF does not always match what you see. Some files use special font encodings, and some pages are images with a hidden text layer from poor OCR. Compare a few words after pasting. If many are wrong, the file may need to be scanned again at higher quality.

Sources

Updated . Written for YardMaths PDF Tools: free tools that run in your browser.