Skip to content

PDF to text: extract the text from a PDF

Copying text out of a PDF by hand often goes wrong: lines break in odd places, columns run into each other and Arabic comes out backwards. This tool reads the PDF in your browser and rebuilds the text in reading order, line by line and page by page, ready to paste into an email, a translation tool or a document, or to save as a plain .txt file. Pages that are only pictures, such as scans, are pointed out instead of silently coming back empty.

Quick answer

To convert a PDF to text, choose the file on this page. The text of every page appears at once in reading order, with an optional "--- Page N ---" line between pages. Type a page range if you only need some pages, then copy the text or download it as a UTF-8 .txt file. Nothing is uploaded.

Your file never leaves your device

Or drag and drop it here. Up to 150 MB. The text is read on this device; the file is never uploaded.

The PDF is read by this browser tab with pdf.js. Nothing is uploaded and nothing is kept after you close the page.

How to use the PDF to Text

  1. Tap "Choose a PDF file" or drop the PDF onto the box. The text of all pages appears below.
  2. If you only need some pages, type them, for example 2-5, 9, and press "Extract text".
  3. Untick the page markers if you want one continuous text, or tick the BOM option for an old Windows Notepad.
  4. Press Copy to paste the text somewhere else, or "Download .txt" to save it as a file.

How the text is put back in reading order

Inside a PDF, text is not stored as lines and paragraphs. Each word or piece of a word is placed at a position on the page, often in the order the program happened to draw it. The tool reads every piece with pdf.js, groups pieces that share a baseline into a line, puts the lines in order from top to bottom and adds a space wherever there is a visible gap between two pieces. A wide gap, as between table columns, becomes several spaces, so tables stay readable. A clearly larger gap between lines becomes a blank line, which keeps paragraphs apart. Pages turned with the rotate setting, and text drawn sideways, are read in their own direction.

Arabic and mixed Arabic-English PDFs

An Arabic line is read from right to left, but an English name, an email address, an IBAN or a phone number inside it keeps its own left-to-right order, and two numbers next to each other stay in the order they were written. Many Arabic PDFs store the joined letter shapes (presentation forms) instead of normal letters; the tool turns them back into ordinary Arabic letters, so you can search and edit the text. Brackets that some PDFs store reversed are put back the right way round. In our tests on an Arabic invoice and a 112-page official gazette, 98% or more of the Arabic words that Poppler's pdftotext found were found here too, in reading order. Some designed PDFs draw two letters as one shape (for example في); in those files the two letters can come out swapped. A PDF whose font maps letters to the wrong codes gives wrong letters in every tool, ours included.

Scanned pages and photos of documents

A scan or a phone photo saved as PDF is a picture of the page, with no text inside it. The tool checks every page that gives no text: if the page holds an image, it is listed as a scanned page, so you know why that part of the result is empty; a page with nothing on it is simply skipped. Getting text out of pictures needs optical character recognition (OCR), which is a different job: open the same file in Image to Text (OCR), which reads scanned pages in the browser too. A PDF that has a scan with an invisible text layer added by a scanner app is read like any other text PDF.

Page ranges, page markers and the .txt file

By default every page is read. To take only part of the file, type pages and ranges separated by commas, such as 1-3, 8 or 10- for page 10 to the end; Arabic digits work too. With page markers on, each page starts with a line such as "--- Page 4 ---", which helps when you quote or check the text later; with them off, pages are separated by a blank line. The download is UTF-8, which every current editor reads correctly. The BOM option adds three invisible bytes at the start of the file so that old versions of Windows Notepad recognise UTF-8 and show Arabic properly.

Privacy and honest limits

The PDF is read by this browser tab and is never uploaded, so contracts, payslips and bank letters stay on your device. A password-protected PDF has to be unlocked first with Unlock PDF. Text in two columns side by side is read across both columns line by line, and table cells come out as text separated by spaces, not as a spreadsheet. Files up to 150 MB work on most computers. If you need the content in an editable document with its layout, use PDF to Word instead. For a scanned PDF, image to text reads the pages with OCR.

Frequently asked questions

How do I convert a PDF to text?

Choose the PDF on this page. The text of all pages appears in reading order within seconds. Press Copy, or Download .txt to save it as a file. It is free and the PDF is never uploaded.

Does PDF to text work with Arabic PDFs?

Yes. Arabic lines are read right to left, English words and numbers inside them keep their order, and joined letter shapes are turned back into normal Arabic letters so the text can be searched and edited.

Why is the text from my scanned PDF empty?

A scan is a picture of the page and contains no text. The tool lists those pages so you know which ones they are. Reading text from pictures needs OCR: open the same file in our Image to Text (OCR) tool.

Can I extract text from only some pages of a PDF?

Yes. Type the pages in the Pages box, for example 2-4, 7 or 10- for page 10 to the end, and press Extract text. Only those pages are read and saved.

Why does Notepad show strange characters in the .txt file?

Old versions of Windows Notepad may not detect UTF-8 and show Arabic as symbols. Download the file again with the BOM option ticked and it will open correctly. Current Notepad, phones and other editors need no BOM.