Tools

PDF to text extractor

Copy the text layer out of a PDF, page by page, with lines kept in reading order.

Runs in your browserPDF tools53.9K
Free
Drop files here

Or choose them. Files are processed in this tab and never uploaded to any server.

Selecting text in a PDF viewer tends to grab it in the wrong order, drop the spaces between words, or stop at the page break. This reads the text layer of every page with pdf.js and rebuilds the lines from where the glyphs actually sit, giving you plain text you can paste into an editor, a translation tool or a prompt. It only works on PDFs that contain real text: a scanned page is a photograph, and needs OCR instead.

How it works

  • pdf.js returns text in the order the file draws it, which for most producers is reading order; a new line starts whenever the baseline moves, and a large jump becomes a paragraph break.
  • Spaces are inserted where there is a visible gap between two runs of text, which fixes the run-together words many PDFs produce when copied.
  • Each page is preceded by a marker such as --- 3 / 12 --- (turn it off for one continuous text), and pages with no text layer are counted separately.

Where your data goes

Nowhere. This tool runs entirely in your browser: the text you paste is processed by the page and is never transmitted to a server or written to a log.

This tool is free and needs no account. Its results exist only in your open page and are not saved anywhere.

What it costs

This tool is free, with no sign-in and no points.

Common questions

Why is the output empty for my scanned PDF?
A scanner produces pictures of pages, with no text inside the file at all. Convert the pages to images with the PDF-to-images tool, then run them through the OCR image-to-text tool on this site (ocr-image-to-text), which recognises Chinese and English in the browser.
Why is a two-column paper jumbled?
Most PDFs draw one column after the other, and the text comes out correctly. A few producers draw across both columns line by line, and since the file carries no notion of columns, the lines interleave. For those, extract one page at a time and fix the order by hand, or use a layout-aware tool such as GROBID for academic papers.
Why do Chinese characters come out as gibberish?
Some PDFs map glyphs to characters through Adobe's predefined CJK encodings, which pdf.js loads on demand from the jsDelivr copy of pdfjs-dist. If that download is blocked, or the PDF's font has no usable character map at all, the text cannot be recovered and OCR is the only route.

The open-source behind it

This tool runs on mozilla/pdf.js, released under Apache-2.0. If you need the same behaviour inside your own program, that is the library to reach for.

mozilla/pdf.js

Also known as

  • pdf to text
  • extract text from pdf
  • copy text from pdf
  • pdf text extractor
  • pdf to txt
  • convert pdf to plain text