HandyBench

PDF to Text Extractor

Pull the text out of a PDF, ready to copy or download.

How to use the PDF to Text Extractor

  1. 1 Upload your PDF.
  2. 2 Click Extract text and wait for every page to be read.
  3. 3 Copy the text or download it as a .txt file.

What "extracting text" really does

A PDF does not store paragraphs. It stores drawing instructions such as "show this string at position x, y in this font". This tool uses Mozilla's pdf.js to call getTextContent() on each page, which returns those positioned strings in the order they appear in the file. The tool rebuilds lines from the position of each string: when pdf.js flags the end of a line, or the next string sits at a different vertical position, a line break is inserted. Strings on the same line are joined with a space only when there is a visible gap between them, so words split by kerning are not torn apart.

It does not try to detect paragraphs or columns, so each line on the page becomes one line of text. A paragraph that is hard-wrapped in the PDF stays wrapped in the output.

Page separators

With "Insert page separators" ticked, each page's text is preceded by --- Page N --- on its own line. Pages are separated by a blank line, and the whole result is trimmed. Unticked, pages are simply separated by blank lines. The counter below the box shows the page count and character count.

Worked example

Take a two-page PDF where page 1 holds "Invoice 1042" and "Total: 250.00" on two separate lines, and page 2 holds "Thank you". With separators on, you get:

--- Page 1 ---
Invoice 1042
Total: 250.00

--- Page 2 ---
Thank you

When extraction returns nothing or garbage

  • Scanned documents. A scan is a picture. With no text layer in the file, the tool reports that no text was found and that it does not perform OCR. A search-and-copy test in a PDF viewer tells you whether a layer exists.
  • Columns and tables. Strings come out in file order, which is usually reading order but can interleave columns or put table cells in odd sequences. Cells in the same table row are separated by a space, not a tab.
  • Broken font mappings. Some PDFs embed fonts without a proper Unicode map, so copying produces symbols or stray characters even though the page looks correct. The text layer, not the page's looks, is what counts.
  • Ligatures and hyphens. Words split by an end-of-line hyphen stay split, and some fonts store "fi" as a single glyph that may come out unexpectedly.
  • Right-to-left scripts may arrive in visual rather than logical order.
  • Encrypted PDFs cannot be read.

Once you have the text, tidy it with Remove Line Breaks or measure it with the word counter.

Examples

  • ▸ Pulling the body text out of a PDF report to paste into an email.
  • ▸ Extracting text from an e-book chapter for a word count check.

Frequently asked questions

Does this work on scanned PDFs?

No. This tool reads text that is already embedded in the PDF. A scanned document is just an image of text, so it needs OCR (optical character recognition) first, which this tool does not perform.

Will the original formatting be preserved?

Only partly. Line breaks are kept, but layout, fonts, columns and tab alignment are not. The output is plain text in reading order, which is ideal for copying content but not for recreating the original design.

Why are my columns or table cells in a strange order?

The text comes out in the order it is stored in the file, with a line break wherever the PDF moves to a new line. In multi-column layouts and tables that order can interleave columns or cells, so tidy the result afterwards.

Can I keep track of which text came from which page?

Yes. Turn on "insert page separators" to add a "--- Page N ---" marker before each page's text.

Is my PDF uploaded to a server?

No. Text extraction runs entirely in your browser using pdf.js, so your document never leaves your device.