How to Extract Text From a PDF for Free
Pull plain text out of PDF files without paid software or accounts. Free browser-based PDF text extractor works offline with no file upload to any server.
When You Need PDF Text
A client sends a contract as a PDF, but you need to quote specific clauses in an email. A research paper is locked in PDF format and you want to search the full text with grep or Ctrl+F across your whole library. You received a PDF form and need the filled-in values as structured data. You are migrating documentation from PDF archives into a CMS or knowledge base.
Extracting text from a PDF means getting the raw text content out of the file, without the formatting, images, columns, and layout that the PDF wraps around it. What you get is plain, searchable, copyable text.
How PDFs Store Text
PDFs do not store text as a continuous flow like a word processor document. They store it as positioned glyphs: "the letter H at x=72, y=680 on page 1." Each character has a font, size, and exact coordinate on the page.
The extractor reads these character-by-character instructions and reconstructs words, lines, and paragraphs from the positions. It groups nearby characters into words by looking at gaps, and groups words into lines by looking at vertical alignment.
This works well for text-based PDFs, which are created by word processors, layout software, or any program that writes actual text objects into the PDF. It does not work for scanned documents, which contain only images of text.
Using the Browser Tool
The PDF to Text Converter extracts text in three steps:
- Upload a PDF. The file stays in your browser memory and is never sent to a server.
- The tool parses the PDF with pdf.js, reading every text object on every page and reconstructing the text flow.
- Read the extracted text in the output panel. Copy it to your clipboard or
download it as a
.txtfile.
If your PDF has multiple pages, the output shows a page separator so you know where each page starts and ends.
Text-Based PDFs vs. Scanned PDFs
This distinction determines whether text extraction will work at all.
Text-based PDFs contain real text objects. When you open one, you can select and copy text with your mouse. Search works. The PDF to Text Converter extracts all of this text programmatically, producing complete and accurate output.
To check if your PDF is text-based, open it and try to select a word with your cursor. If the word highlights, it is a text-based PDF.
Scanned PDFs are images. Each page is a photograph of paper. You cannot select text because there is no text to select, there are only pixels. The PDF to Text Converter will produce little or no output from a scanned PDF.
For scanned PDFs, you need OCR (Optical Character Recognition). OCR software looks at the image of each page, identifies shapes that look like letters, and outputs text. The quality depends on the scan resolution and clarity. Third-party OCR tools like Tesseract (open source, free) can process scanned PDFs if the browser-based extractor produces nothing.
Structured Extraction Challenges
PDF text extraction is not perfect. Common issues:
- Column confusion: a two-column PDF layout may interleave lines from the left and right columns. The extractor reads top-to-bottom, left-to-right, and does not understand column boundaries.
- Table data: table structure is lost. Column values become interleaved lines of text. For tabular data, extract the text and reconstruct tables manually, or use a dedicated table-extraction tool like Tabula.
- Headers and footers: page numbers, document titles, and dates that repeat on every page show up in the extracted text. You will need to strip these manually or with a script.
- Ligatures and special characters: some PDFs use ligature glyphs (fi, fl) that may extract as odd characters. Most modern extraction handles these correctly.
After Extraction: Cleanup
Extracted text rarely comes out publication-ready. Expect to:
- Remove repeated headers and footers from every page.
- Fix line breaks where paragraphs were split across lines.
- Rejoin hyphenated words that were broken across line endings.
- Correct encoding issues with special characters (curly quotes, em dashes, accented letters).
- Reconstruct tables and lists.
The text is a starting point. It saves you from retyping, but it needs review.
Extracting to Markdown
If you need more structure than plain text, use the
PDF to Markdown Converter. It detects headings, lists,
and basic formatting and outputs Markdown instead of raw text. This saves you
from manually adding ## to section titles and - to list items.
Command-Line Alternatives
Several free tools extract PDF text from the terminal:
# pdftotext (poppler-utils)
sudo apt install poppler-utils # Linux
brew install poppler # macOS
pdftotext document.pdf output.txt
# Extract with layout preservation
pdftotext -layout document.pdf output.txt
# Python with PyMuPDF
pip install pymupdf
python -c "
import fitz
doc = fitz.open('document.pdf')
for page in doc:
print(page.get_text())
"
pdftotext with the -layout flag preserves whitespace, which helps with
tables and columnar data. The plain mode (no flag) produces flowing text that
is easier to read but loses spatial information.
When Extraction Fails
If the tool produces empty or garbled output:
- Confirm the PDF is text-based (try selecting text in a viewer).
- Try a different extraction method (command-line
pdftotextsometimes handles edge cases that browser-based extraction misses). - If the PDF uses a custom or embedded font with non-standard encoding, extraction may produce gibberish. This is rare but happens with some government and legacy PDFs.
- For scanned PDFs, extract produces nothing. Use OCR.
Try it yourself: open the PDF to Text Converter. Upload a text-based PDF, such as a Word-exported document or a digitally created report (not a scan). The tool extracts text from every page. Compare the output to what you see in a PDF viewer. Try selecting small portions and copying them manually to compare accuracy. If your PDF has headings and lists, try the PDF to Markdown Converter for output that preserves document structure.