To extract text from a PDF, first check whether it has real text or is just a picture of pages. Text PDFs can be copied or converted in seconds. Scanned PDFs need OCR (optical character recognition) to turn the page images into text, and the free tools below handle both.
| Method | Scanned PDFs | Best for | Effort |
|---|---|---|---|
| 1PDF to Text converter | Yes (OCR) | Clean text or Markdown, any device | Upload |
| 2Scanned PDFs with OCR | Yes | Scans, photos, faxes | Upload |
| 3Adobe Acrobat | Yes (Pro) | Export to .txt or Word | A few clicks |
| 4Google Drive and Docs | Yes | Small scans, free | Upload, right-click |
| 5Mac Preview | Often (Live Text) | Quick copies on a Mac | Drag and copy |
| 6Copy and paste from Chrome or Edge | Sometimes | A paragraph or two | Select and copy |
| 7Microsoft Word | Varies | Editing the text | File > Open |
| 8pdftotext and ocrmypdf | Yes (ocrmypdf) | Many files, scripts | Commands |
| 9Python | Yes (with Tesseract) | Pipelines and apps | Write code |
| 10Table tools | No | Tables to CSV or Excel | Varies |
First: is your PDF text or scanned?
A text PDF (exported from Word, a website or an app) stores real characters. A scanned PDF stores a photo of each page, so there's no text until OCR reads it. Many PDFs mix both, such as a typed report with signed, scanned pages at the end.
How to tell:
- Try to select a word. If your cursor draws a box around the whole page instead of highlighting words, it's a scan.
- Search it. Press Ctrl + F (Cmd + F on Mac) and type a word you can see. No results usually means no text layer.
- Check the fonts. In Acrobat Reader, press Ctrl + D (Cmd + D on Mac) for Document Properties and click the Fonts tab. An empty list means a scan. On the command line,
pdffonts file.pdfshows the same.
Recent versions of Chrome and Preview can run OCR quietly in the background, so a scan may look selectable there. That text is often less accurate than real text.
1Extract text from a PDF with a free converter
Our free PDF to Text converter handles text PDFs and scans in one place, keeps paragraphs and headings, and turns ruled tables into real tables. No sign-up.
- Open urltotext.com/pdf_to_text.
- Click Choose a PDF or drop the file on the box. For a PDF online, switch to Paste a PDF link, paste the direct link to the .pdf, and click Convert.
- When it's done, pick Text or Markdown above the result.
- Click Copy, or Download to save a .txt or .md file.
Text or Markdown? Plain text is best for notes, emails and documents. Markdown keeps headings as # headings, bullet lists as lists and tables as Markdown tables, which is ideal for pasting into ChatGPT, Claude, Notion or a docs site.
Open Options: pages, scanned PDFs, password for more control:
- Pages: convert only what you need, like
1-3, 7, or10-for page 10 to the end. - Password (if the PDF has one): for files you're allowed to open. If you skip it, the converter asks for it and you click Open PDF. The password is only used to open the file and isn't stored.
- Read scanned pages and Language of scanned pages: see the next section.
Multi-page results show --- Page N --- between pages. Untick Page markers to remove them. A summary line shows the page, word, character and table count.
Limits: files up to 20 MB and 500 pages per conversion. Free use allows about 5 PDFs every 10 minutes. Sign in to convert up to 10 PDFs at once and use Download all. Your file is deleted as soon as the text is out.
Line breaks are already fixed: wrapped lines are joined into paragraphs, hyphenated words at line ends are mended, and two-column layouts come out in reading order.
2Convert a scanned PDF to text with OCR
The same converter reads scanned pages automatically. Any page with almost no text and an image on it is read with Tesseract OCR.
- Upload the scanned PDF to PDF to Text.
- Open Options: pages, scanned PDFs, password. Make sure Read scanned pages (OCR, up to 5 per PDF) is ticked.
- Set Language of scanned pages. There are 19, including Spanish, French, German, Portuguese, Russian, Arabic, Hindi, Chinese, Japanese and Korean.
- Convert. A note under the result tells you how many pages were read with OCR.
Limits: OCR covers 5 scanned pages per PDF without an account and 20 when you're signed in. For a longer scan, use Pages to convert it in batches (1-20, then 21-40), or use ocrmypdf for the whole file. OCR is very good on clean printed scans and weaker on handwriting, faint photocopies and crooked pages. Always check names, numbers and amounts.
Have a photo or screenshot instead? Use Image to Text, or see how to extract text from an image.
3Use Adobe Acrobat
Copy text in the free Acrobat Reader
- Open the PDF and drag over the text with the cursor. Press Ctrl + A to select a whole page's text.
- Press Ctrl + C (Cmd + C on Mac) and paste.
The free Reader doesn't convert files or run OCR. Those need Acrobat Pro or Standard.
Export to text or Word (Acrobat Pro)
- Open the PDF and select Convert (in some versions, ).
- Choose Microsoft Word for an editable document, or for plain text.
- Click Convert to DOCX (or Convert to TXT), choose a folder, and click Save.
OCR a scanned PDF (Acrobat Pro)
- Open the scan and choose .
- Under Recognize text, choose In this file.
- Set the pages and the document's language, then click Recognize text.
- Save the file. It now has a hidden text layer you can select, search and export.
Save a copy of the original first. Acrobat's export to Word gives the best layout of any method here, but it's a paid subscription.
4Use Google Drive and Google Docs
Google Drive runs free OCR when you open a PDF or image as a Google Doc.
- In Google Drive, click and upload the PDF.
- Right-click the file and choose .
- A new Doc opens with the extracted text.
- Copy it, or choose .
Limitations: Google says the file should be 2 MB or smaller, and text at least 10 pixels high. Bold and line breaks usually survive; tables, columns, lists and footnotes often don't. Long PDFs may be cut short, so split big scans first. Google detects the language automatically.
5Copy text with Preview on a Mac
- Open the PDF in Preview.
- Choose if the cursor doesn't select text.
- Drag over the text (or Cmd + A for the page), then Cmd + C.
Scanned PDFs: on recent macOS versions with Live Text turned on (), Preview can often select text in a scanned page too. If it can't, take a screenshot of the page with Cmd + Shift + 4, open the screenshot in Preview, and copy the text from it.
Preview has no "export as text" option. For a whole document, use a converter.
6Copy and paste from a browser, and fix line breaks
Chrome, Edge, Firefox and Safari all open PDFs. Drag over the text, press Ctrl + C, then paste without formatting: Ctrl + Shift + V on Windows, Cmd + Shift + Option + V on Mac. Recent versions of Chrome on desktop also run OCR on scanned PDFs, so you can often select text in a scan.
The usual problem: every line of the PDF becomes its own line, with breaks in the middle of sentences. That happens because a PDF stores lines, not paragraphs. To fix it in Word:
- Paste into Word and press Ctrl + H (Find and Replace).
- Replace
^p^pwith@@@to protect real paragraph breaks. - Replace
^pwith a space. - Replace
@@@with^p^p.
Also search for - (a hyphen and space) to rejoin words that were split at line ends. In a code editor, a regex like (?<!\n)\n(?!\n) replaced with a space does the same job. Or skip the cleanup: PDF to Text joins lines into paragraphs for you.
7Open the PDF in Microsoft Word
Word for Microsoft 365 can turn a PDF into an editable document:
- In Word, choose and pick the PDF.
- Word says it will convert the PDF to an editable Word document. Click OK.
- Copy the text, or a .docx or .txt.
It works best on simple, text-heavy PDFs such as letters and reports. Columns, tables, footnotes and page layouts can shift, and results with scanned PDFs vary (OCR them first for the best result). Keep the original PDF.
8Use the command line: pdftotext and ocrmypdf
pdftotext for text PDFs
pdftotext from Poppler is fast and free. Install it with brew install poppler (Mac) or sudo apt install poppler-utils (Ubuntu/Debian).
pdftotext report.pdf # writes report.txt
pdftotext -layout report.pdf out.txt # keeps columns and table spacing
pdftotext -f 3 -l 5 report.pdf out.txt # pages 3 to 5 only
pdftotext -upw secret locked.pdf out.txt # a PDF you have the password for
ocrmypdf for scanned PDFs
OCRmyPDF adds a text layer to scans using Tesseract. Install it with brew install ocrmypdf or sudo apt install ocrmypdf.
ocrmypdf --skip-text --deskew -l eng --sidecar scan.txt scan.pdf scan-ocr.pdf
That makes scan-ocr.pdf (searchable and selectable) and scan.txt (the text). --skip-text leaves pages that already have text alone, --deskew straightens crooked scans, and -l eng+spa reads two languages (install the language pack, such as tesseract-ocr-spa). Use --force-ocr to redo bad OCR from another tool.
Bulk extraction
Convert a whole folder in one go:
for f in *.pdf; do pdftotext "$f"; done
for f in scans/*.pdf; do ocrmypdf --skip-text --sidecar "${f%.pdf}.txt" "$f" "${f%.pdf}-ocr.pdf"; done
9Extract text from a PDF with Python
For text PDFs, PyMuPDF is the fastest choice (pip install pymupdf):
import pymupdf
with pymupdf.open("report.pdf") as doc:
text = "\n\n".join(page.get_text() for page in doc)
print(text[:500])
pypdf is pure Python and handles passwords (pip install pypdf):
from pypdf import PdfReader
reader = PdfReader("report.pdf")
if reader.is_encrypted:
reader.decrypt("your-password")
text = "\n\n".join(page.extract_text() or "" for page in reader.pages)
For scanned PDFs, render each page to an image and run Tesseract (pip install pdf2image pytesseract, plus Poppler and Tesseract installed):
from pdf2image import convert_from_path
import pytesseract
pages = convert_from_path("scan.pdf", dpi=300)
text = "\n\n".join(pytesseract.image_to_string(p, lang="eng") for p in pages)
Or call ocrmypdf from Python with subprocess.run(["ocrmypdf", "--skip-text", "--sidecar", "scan.txt", "scan.pdf", "out.pdf"]). A good pattern: try PyMuPDF first, and OCR only the pages where page.get_text().strip() comes back empty.
For our hosted option, the PDF to Text API converts text PDFs up to 10 MB with an API key. It doesn't OCR scans.
10Extract tables from a PDF
Tables are the hardest part of a PDF, because a PDF stores words at positions, not rows and cells.
- PDF to Text: in Markdown mode, ruled tables (with lines between cells) come out as Markdown tables.
- pdfplumber: good control in Python.
import pdfplumber
with pdfplumber.open("report.pdf") as pdf:
for page in pdf.pages:
for table in page.extract_tables():
for row in table:
print(row)
- Camelot:
camelot.read_pdf("report.pdf", pages="1-3"), thentables.export("tables.csv", f="csv"). Useflavor="stream"for tables without lines. - Tabula: a free desktop app. Upload the PDF, drag a box around the table, and click Export to get CSV.
tabula-pydoes the same from Python (it needs Java). - Excel for Windows: imports tables directly.
None of these read scanned tables. OCR the PDF first with ocrmypdf, or ask an AI chatbot to return the table as CSV and check every number.
Password-protected and secured PDFs
There are two kinds of protection:
- An open password: you can't see anything without it. If you have it, enter it in PDF to Text, Acrobat, or
pdftotext -upw. To save an unlocked copy,qpdf --decrypt --password=yourpassword locked.pdf unlocked.pdf. - Permission restrictions: the PDF opens, but copying or printing is turned off. Ask the owner for an unrestricted copy.
Only unlock PDFs you own or have permission to use. Restrictions are often there for copyright or confidentiality reasons.
Feeding a PDF to ChatGPT or Claude
You can attach a PDF in ChatGPT, Claude or Gemini with the + (or paperclip) button and ask questions about it. OpenAI's limits are 512 MB and 2 million tokens per file, and free accounts get only a few uploads a day.
For better answers, extract the text yourself first:
- Long PDFs may not be read in full, and scanned pages may be skipped or misread.
- Pasting Markdown from PDF to Text keeps headings and tables, so the model understands the structure.
- Use Pages to send only the chapter you care about.
Always check numbers and quotes against the PDF. Chatbots can summarize or "fix" text when you asked for it word for word.
Frequently asked questions
How do I extract text from a PDF for free?
Upload it to the free PDF to Text converter, choose Text or Markdown, and click Copy. You can also copy from any PDF viewer, or use Google Drive's .
How do I OCR a PDF for free?
Use PDF to Text with Read scanned pages on, Google Drive's , or the open-source ocrmypdf on the command line to make the whole file searchable.
Why can't I copy text from my PDF?
Either it's a scan with no text layer, or the author turned off copying. Try searching for a word: if nothing is found, it's a scan and needs OCR. If the text is there but copying is blocked, ask the owner for an unrestricted copy.
Why does my copied PDF text have line breaks everywhere?
PDFs store each line separately, so a copy keeps every line break. Use Find and Replace in Word (see method 6), or convert with PDF to Text, which joins lines into paragraphs.
Can I extract text from a password-protected PDF?
Yes, if you know the password. Enter it in PDF to Text when asked, in Acrobat, or with pdftotext -upw. Without the password, you can't, and you shouldn't try on files that aren't yours.
How do I extract text from many PDFs at once?
Sign in to PDF to Text to convert up to 10 at once and download them all. For hundreds, loop over a folder with pdftotext and ocrmypdf, or use a short Python script.
Is it safe to upload a PDF to an online converter?
It depends on the service. PDF to Text deletes your file as soon as the text is extracted and never stores your password. For highly confidential files, use offline tools like Preview, pdftotext or ocrmypdf.
Which method should you use?
- Most PDFs, text or scanned: PDF to Text, in Text or Markdown.
- A paragraph or two: copy from your viewer and paste without formatting.
- An editable document: Word, or Acrobat Pro.
- Long scans: ocrmypdf.
- Tables: pdfplumber, Camelot or Tabula.
- Hundreds of files: a pdftotext loop or Python.