PDF to TXT Converter

Save the words of a PDF as a plain TXT file in your browser, with no upload.

or drop files here

PD

PDF Format

Portable Document Format

A document format created by Adobe in 1993 and standardized as ISO 32000. It keeps text, fonts, images and layout the same on any device.

  • Fixed page layout
  • Embedded fonts
  • Vector and raster content
  • Optional encryption and signatures
TX

TXT Format

Plain text file

A file that holds unformatted text with no fonts, styles or images. It is readable by any text editor, on any operating system.

  • No formatting
  • Character encoding such as UTF-8
  • Very small files
  • Readable everywhere

How to convert a PDF to TXT (plain text)

The PDF's text is read in your browser and saved as a UTF-8 TXT file named after your PDF.

    1

    Upload your PDF.

    2

    We read the text of each page in order, line by line, with a blank line between paragraphs and between pages.

    3

    Download the TXT file, which opens in any text editor.

What to know before converting PDF to TXT

  • Only the text is kept: no layout, fonts, tables, images, links or form fields.
  • A scanned PDF has no text to extract, and the page does no OCR.
  • A table's cells come out as lines of text.
  • A PDF that needs a password to open can't be converted.
  • The TXT is UTF-8, with a blank line after each paragraph and between pages.
  • Up to 2,000 pages and 20 million characters, read in your browser.

About PDF and TXT files

What is a PDF file?

PDF is a document format made by Adobe. Its roots lie in Camelot, a project John Warnock began in 1991 that had become PDF by 1992. The goal was a file that captures a document from any application and shows or prints it the same way anywhere. The ISO 32000-1 standard of 2008 is PDF 1.7, and ISO 32000-2 of 2017 is PDF 2.0. Its media type is application/pdf.

Besides text, a PDF can hold vector graphics and raster images, plus links, bookmarks, form fields and annotations. To look the same everywhere it needs its fonts embedded. The text is stored as drawing instructions positioned on a page, which is why pulling it out takes some work: a PDF page is not a paragraph in a word processor. Scans are different again, because a scan is an image of text, not text. Adobe's own help notes that scan imagery is distinct from extractable text, so a page can look full of words and still give a TXT nothing.

Programs that open PDF files

Windows and Mac

  • Mozilla Firefox: built-in PDF viewing and annotations.

Windows

  • GIMP: imports PDF pages, and asks for the password of a protected file.

Mac

  • Apple Preview: shows PDF pages and thumbnails.

Linux

  • Evince and Okular, which uses Poppler to render PDF.

Web and Mobile

  • Adobe Acrobat: the online version lets you annotate an uploaded PDF in the browser, and Acrobat Reader views PDFs on Android and iOS.

Mobile

  • Firefox for Android opens PDFs stored on the device.

PDF and TXT compared

  • File names and media types: .pdf is application/pdf and .txt is text/plain.
  • Layout: a PDF has fixed pages and embedded fonts. A TXT has no layout at all.
  • Content: a PDF holds text, graphics and images. A TXT holds text only.
  • Encoding: this page writes the TXT as UTF-8.
  • What carries over: the words, taken in storage order, which is usually reading order. A line ends where pdf.js marks one, and its spaces are collapsed.
  • What is lost: layout, fonts, tables, images, links, annotations and form fields.
  • Line breaks: a TXT can hold only lines and blank lines. A paragraph's lines stay on lines of their own, with a blank line after each paragraph and between pages.
  • Hyphens: a word broken at a line's end keeps its hyphen in the TXT.

The page reads each page's text with pdf.js. A paragraph ends at an empty line, where the next line is higher up the page, where the font size changes by more than a fifth (a heading), or where the gap to the next line is much larger than the page's usual spacing.

Other ways to convert PDF to TXT

  • pdftotext (Poppler): run pdftotext input.pdf output.txt. The command converts a PDF to plain text, and without a second name it writes a file named after the PDF with .txt.
  • PyMuPDF (Python): follow the "Extract all Document Text" recipe. It opens the PDF, joins the page.get_text() string of every page with a form feed and writes the encoded text to a file. The recipe warns that text may not come out in reading order.
  • Preview and TextEdit (Mac): in Preview choose Tools > Text Selection, select text and use Edit > Copy. Paste into TextEdit and choose Format > Make Plain Text before saving. This suits an excerpt, not a whole PDF.

Problems with PDF files

  • No text comes out: a scan or photo has no text layer. Run OCR first, then convert. The converter does none.
  • A password is asked for: the PDF needs one to open. Remove it in a reader, then convert the copy.
  • Columns come out mixed: the PDF stores columns a row at a time. Copy the columns by hand or use a layout-preserving tool.
  • Chinese, Japanese or Korean text is missing: text in a font with no Unicode map that relies on one of Adobe's predefined CMaps is dropped here, and a PDF with only such text is refused as having none.
  • Words are out of order: pdf.js follows the order inside the file, usually but not always reading order. Check a page or two.
  • A file will not open at all: the file could be damaged, truncated or not a PDF at all. The page calls it unreadable. Download it again.

Frequently Asked Questions

Everything you need to know about our converter

How do I convert a PDF to a TXT file?

Why does my PDF come out with no text?

Does the TXT keep my tables and columns?

What happens to images, links and formatting?

Can I convert a password-protected PDF?

What encoding is the TXT file?

How are paragraphs and pages separated?

Why are words split with a hyphen at line ends?

Is there a limit on pages or size?

Can I get the text of a PDF without converting it?