PDF to text

Extract PDF text by page range, edit individual pages, copy and export TXT.

  • Runs locally
  • Free

Use the tool

Your files are processed in your browser and are not uploaded to a server.

About this tool

Extract text from PDF page ranges, review and edit each page, copy one page or everything, and download TXT with optional page labels. Works with CJK text — handy for copying long passages from digital contracts, papers and reports.

Typical uses

  • Copy quotations from a research paper
  • Turn a PDF report into text for analysis
  • Extract manual text for translation

How to use

  1. Upload a PDF and select all pages or a range such as 1-3,5.

  2. Extract, review and edit individual pages, copy a page or all results, and download TXT with optional page labels.

Example

Enter 1-3,5 to extract those pages. Review line breaks in each page, edit the text and download all results as TXT. Page labels can be disabled.

Good to know

Source: up to 80 MB and 5000 pages. Per run: 100 pages, 500K characters per page and 4M total. Encrypted PDFs are unsupported. Reads the text layer; scanned, blank or outlined-text pages may return no text. Does not reconstruct tables or multi-column layouts.

Scanned images are not automatically recognized. Pages without text link to PDF-to-images and OCR. Reading order depends on the source; columns and unusual fonts may need manual cleanup.

What the output looks like: line breaks, spaces and columns (tested)

The tool reads only the PDF’s text layer and joins the pieces in the order the file stores them. Two pieces on the same line get a space when the gap between them exceeds 15% of the text height (at least 1 pt); a new line starts when the baseline moves by more than half the text height (at least 2 pt) or PDF.js marks a line end. Nothing analyses the layout, so the reading order is whatever the producing application wrote. The test pages below were built with pdf-lib in Helvetica and extracted by this tool on the real PDF.js; “↵” marks a line break.

On the pageExtractedWhy
Two lines of 12 pt text, 14 pt apart“Line A ↵ Line B”An ordinary line break.
The same two lines with a 44 pt gap, like a paragraph break“Line A ↵ ↵ Line B”A gap of more than 1.8 times the text height adds one blank line, so paragraphs stay separated.
Two columns, written into the PDF left column first“Left one ↵ Left two ↵ Right one ↵ Right two”Output follows the order of writing: the whole left column, then the right one.
Two columns, but written row by row (left 1, right 1, left 2, right 2)“Left 1 Right 1 ↵ Left 2 Right 2”Lines at the same height are joined across the gutter. Many two-column papers are exported like this.
A three-column table written row by row“Item Qty Price ↵ Paper A4 2 4.50 ↵ Toner 1 39.00”Cells are separated by one space, not a tab; split them with “space as delimiter” in a spreadsheet.
Letters placed one by one with 1 pt extra spacing“REPORT”The gap is under 15% of the text height, so the letters stay together.
The same with 4 pt extra spacing (a letter-spaced heading)“S P A C E D”A space lands between every letter, so a search for “SPACED” will not match.
“Footnote” followed by a 7 pt superscript “1”“Footnote1”The superscript is glued to the word.
A word broken at the line end: “inter-” / “national”“inter- ↵ national”Hyphen and line break both stay; the word is not rejoined.
One line of black text and one line of white (invisible) text“Visible ↵ Hidden white”Invisible text is extracted too.
A label rotated 90° and one normal word“Vertical label ↵ ↵ Normal”Rotated text is read as well, in the order it was written.
A page holding a single image (a scan)(empty)No text layer, so the result is empty and the page menu shows “ · no text”.
Try one page of a two-column paper first

Pages of one PDF are usually written the same way. Extract a single page, check that the columns were not merged line by line, then extract the rest. If they were merged, OCR of that page or a fresh export from the original application gives a cleaner result than fixing the text by hand.

Page selection and the TXT format

  • With “Pages to extract” set to “Page range”, pages come out in the order typed: 3,1 gives 3, 1, so page 3 comes first. A repeated page is kept once (2,1-3 gives 2, 1, 3).
  • A full-width comma typed with a Chinese or Japanese input method is accepted: 5,1-2 gives 5, 1, 2.
  • With “Page labels in export” ticked, each page is preceded by a marker line in the site language. Two pages exported from the English interface read: --- Page 3 --- ↵ Total: 42 ↵ ↵ --- Page 1 --- ↵ Title. Without labels, pages are separated by one blank line only.
  • For files over 100 pages, the tool switches to a page range of 1-100 on load and says “This file has more than 100 pages. The first 100 are selected; edit the range as needed.” For pages 101–200, change the range to 101-200 and extract again.
  • The result box is editable and “Download all as TXT” saves the edited text. The TXT file is UTF-8 with LF line endings; spaces and symbols in the name become underscores: “Q3 report (final).pdf” → Q3_report_final_-text.txt.

A page comes out empty, or the text looks wrong

SymptomCauseWhat to do
The page menu shows “· no text”PDFs made from scans or photos contain only images, with no text layer. Text converted to outlines in a design application has none either.Run the page through scanned PDF OCR; for a short passage, render the page as an image and use image OCR.
Text appears that is not visible on the pageWhite text, text under an image and text outside the page are still part of the text layer, for example the hidden layer left by earlier OCR.Check it and delete it in the result box.
Characters turn into gibberish or boxesThe font has no Unicode mapping, so the text layer itself cannot be turned back into the right characters. The PDF.js CMap data is loaded, so standard Chinese, Japanese and Korean fonts read correctly.Export the PDF again from the original application, or use OCR.
A heading has spaces between all its lettersLetter-spaced text is drawn letter by letter with gaps above the threshold (see S P A C E D above).Remove the spaces in the result box or with a text editor.

Messages and limits

MessageWhen it appearsWhat to do
Encrypted, password protected or access restricted PDFs are not supported. Use an authorized unencrypted copy.The file has an open password, or opens without one but carries permission restrictions such as no printing or copying (any permission flags reported by PDF.js lead to a refusal).Use an authorized unencrypted copy; for your own file, remove the protection with the PDF password tool.
This PDF could not be read. It may be damaged or use an unsupported text encoding.No “%PDF-” marker in the first 1024 bytes, or the file fails to parse.Make sure it is a real PDF; export it again if needed.
PDFs must be at most 80 MB. Split this file and retry.The file is over 80 MB.Split it first.
PDFs must contain at most 5000 pages. Split this document first.More than 5,000 pages.Split it first.
Invalid page range. Use pages in this document, for example 1-3,5.Page 0, a page beyond the end, a reversed range (5-3) or a malformed entry.Write it as 1-3,5.
Extract up to 100 pages per run. Choose a smaller page range.More than 100 pages selected.Extract in several runs.
A page contains too much text. Processing stopped. Try a smaller or simpler PDF.One page holds more than 500,000 characters or 100,000 text pieces.Typical of data dumps; process fewer pages or use the original data file.
Text exceeds 4 million characters. Choose fewer pages.The selected pages add up to more than 4,000,000 characters.Select fewer pages.

Frequently asked questions

Why do some pages return no text?

Scans, blank pages and outlined text have no text layer. Use scanned PDF OCR for scans.

Are tables and columns preserved?

No. Text is extracted in reading order without rebuilding tables or multi-column layouts.

What are the limits?

Source up to 80 MB and 5000 pages; up to 100 pages per run.