Extract Text from PDF (PDF to TXT)

Drop a PDF file here

or click this area to pick a .pdf file

Text layout
Extracting…
Extracted text
How to use:
1. Upload a PDF and click “Extract text”. The result appears in the box below, ready to select and copy, or to download as .txt.
2. Leaving “Page range” empty means every page; you can also write a combination like 1-3,5,8 to extract only the pages you need.
3. Merge into paragraphs: every line in a PDF stands alone, so a raw extraction gives you a pile of short sentences chopped up by hard line breaks. With this on, a line that does not end in sentence-final punctuation is joined to the previous one and the result reads like prose; turn it off when you need to check the original line by line.
4. Insert page markers: adds a line reading —— Page N —— at the top of each page, so you can match the result back against the original page numbers.
5. Drop blank lines: clears out the mass of blank lines PDF layout leaves behind; turn it off to preserve the original line spacing as far as possible.
6. The downloaded .txt is UTF-8 with a BOM, so Chinese opens correctly in Windows Notepad and Excel.
7. A scan (a page that is entirely an image) has no text layer, so nothing can be extracted; the page says so explicitly — this tool does not do OCR.
8. Everything is processed locally in your browser — your PDF is never uploaded.
Pulls the text layer out of a PDF as plain text: you can specify a page range and choose between merging lines into paragraphs and keeping the original line breaks, then copy the result in one click or download it as .txt. Chinese gets special handling — no stray spaces are ever inserted between Han characters, which is the most common flaw in comparable tools. The downloaded TXT carries a BOM, so Notepad shows it correctly. No limit on file size or page count, no sign-up. All processing happens locally in your browser; nothing is uploaded.

About extracting text from PDF

A PDF does not store text in paragraphs — it paints it on in pieces

This is the key to why the tool has the switches it has. A PDF describes a printed result: it records “draw these characters at coordinate (72, 640) in 11pt Song”, a page may hold hundreds of such instructions, and there is nothing in between saying “this is a paragraph” or “this line ended”. So extracting text really means reassembling those fragments by coordinate into readable text: group the fragments into lines by their vertical coordinate, sort within each line by horizontal coordinate, and only then decide which lines belong to the same paragraph. Different tools give different results for the same PDF, and the whole difference is in this step.

Why Chinese is especially easy to mangle

Deciding whether two adjacent text blocks need a space between them usually comes down to their horizontal gap — more than about a quarter of a character width counts as a break. That rule holds for English but goes wrong for Chinese: Chinese typesetting already has inter-character spacing, and many PDF generators split one sentence into a dozen separately positioned fragments, so the extraction comes out as “这 是 一 句 话”. What this tool does is check whether both sides are Han characters before inserting a space, and never insert one when they are, while keeping the space at a Chinese/English boundary. The same logic applies to paragraph merging: Chinese lines are joined end to end directly, English lines get a single space, and a hyphen at the end of a line is dropped before joining.

A scan yields no text, and that is not the tool's fault

If the PDF came out of a scanner or a phone camera, each page is really an image with no text layer to extract — every tool gives you an empty result. This page tells you outright that the file is probably a scan when far too few characters come back, instead of handing you an empty file. Turning characters inside an image into text needs OCR (optical character recognition), a different kind of technology requiring recognition models tens of megabytes in size, which this site does not provide. The check is easy: open the PDF in a reader and try to select the body text with your mouse — if you cannot, it is a scan.

How this differs from converting to images or to Word

If what you want is plain text you can search, copy and feed to another program, use this page. If you want an image that shows the layout at a glance — to drop into a chat window, paste into a slide deck, use as a cover — use PDF to Image, which renders each page to PNG or JPG. Plain text inevitably loses font size, colour, table rules and images; that is its definition, not a defect. If you need the layout preserved so you can go on editing, desktop Word's “Open PDF” beats any online tool. Going the other way, if what you have is Markdown and you want a PDF or Word file, this site has Markdown to Word / PDF .

FAQ

Does this tool upload my PDF to a server?

No. Reading the file and extracting the text both happen locally in your browser; the page never uploads your file contents, which makes it suitable for contracts, papers, internal documents and other material that should not leave your machine. Once the page has loaded you can keep using it offline.

Why is the extracted text empty?

The most common reason is that the PDF is a scan, or a set of stitched images, with no text layer inside. The page tells you when that happens. Open the original in a reader and try to select a passage of body text with your mouse: if you cannot, there really is no text layer and OCR is needed, which this tool does not provide.

Why are there spaces between the Chinese characters I extracted?

This tool goes out of its way to avoid that: a space is only inserted when the gap between adjacent text blocks is clearly wide and the two sides are not both Han characters. If it still happens somewhere, it is usually because those characters really were typeset with very wide letter-spacing in the original PDF (common in titles and title pages), and the space reflects the original layout. You can paste the result into Markdown Formatter for a pass of Chinese/English spacing cleanup.

Can “Merge into paragraphs” join lines that should stay apart?

It can. That step infers structure from punctuation and from how a line starts: lines are joined only when the previous line did not end in a full stop, question mark, colon or similar and the current line is not a list item or a number. Poetry, code and tables — content where every line stands alone — get merged wrongly, so turn the switch off for those documents and you get one output line per source line.

Can tables be extracted?

The text inside a table comes out, but the structure is lost — plain text has no notion of cells, so several cells on one row become a single string separated by spaces. Preserving table structure needs a converter that understands page layout, or simply opening the PDF in desktop Word.

The txt I downloaded shows mojibake in Notepad — what do I do?

The .txt this tool downloads is UTF-8 with a BOM, which Windows Notepad, Excel and almost every editor read correctly for Chinese. If you copied the text out of the page by hand and saved it yourself, remember to choose UTF-8 encoding when saving.

Can it handle a PDF with hundreds of pages?

Yes — extraction runs page by page, showing progress and cancellable at any time. If you only need part of it, filling in a page range is much faster. The result text for a very large document can run to hundreds of KB, which makes the text box a little sluggish; in that case download the .txt and open it in an editor.

Can encrypted PDFs be extracted?

A PDF with an open password cannot be read; the page says “password required”, so remove the password protection first. Files that WPS and similar software label “encrypted” but that open without a password are unaffected and are processed normally.