How to Extract Text from a PDF and Save TXT

Plain text extracted from PDF pages

Converting a PDF to text is useful for search, quotation, accessibility review, note-taking, or moving content into another system. The result depends on what the PDF contains. Some documents have a clean text layer; others store glyphs in a confusing order; scanned pages may contain only images and no extractable characters at all.

HatchMyPDF reads the existing PDF text layer with PDF.js in your browser. It does not upload the document or send extracted text to analytics. The result is a read-only preview with Copy all and a UTF-8 TXT download.

In short: choose a PDF, enter its password if required, select all pages or a range, decide whether to keep standard page separators, extract sequentially, review the preview, and download or copy the text.

Text extraction is not OCR

A normal digital PDF often contains text objects as well as the visual page design. PDF.js can expose those objects, their coordinates, writing direction, and line-ending hints. The extractor uses that information to add reasonable spaces and line breaks.

An image-only scan has no such text layer. Optical character recognition, or OCR, would need to analyze page pixels with a model or recognition engine. OCR is outside version 1. When no text is found, the tool shows a distinct “possibly a scan” state rather than returning a misleading blank download.

If you can select words in a normal PDF viewer, extraction is more likely to work. Selection is not a guarantee: custom encodings, missing character maps, or unusual font construction can still produce incomplete text.

Step-by-step: convert PDF to TXT

  1. Open PDF to Text and choose a PDF up to 50 MB and 1,000 pages.
  2. Enter a password if PDF.js requests one. The password remains in memory and the source document is not modified.
  3. Select all pages or enter a range such as 2-6,9.
  4. Keep standard page separators enabled when downstream software should know where one PDF page ends and the next begins.
  5. Start extraction. Pages are read sequentially, and the process can be cancelled between pages.
  6. Review the read-only preview. Copy all text or download a UTF-8 TXT file with a byte-order mark for broad editor compatibility.

PDF to Text

Extract an existing PDF text layer to UTF-8 TXT locally.

CONVERT

Page boundaries and the form-feed character

By default, the TXT output uses form feed U+000C between pages. Form feed is a standard plain-text control character historically associated with a page break. Many editors display it as whitespace or a special symbol, so HatchMyPDF shows a visible “Page break” divider in the preview instead of exposing an ambiguous blank area.

Disable page separators when the result should behave as one continuous text stream. The tool then joins pages with ordinary blank lines. Either choice loses the exact visual geometry of the PDF because TXT stores characters and line breaks, not positioned page objects.

The output is limited to 10 million characters or 20 MB of UTF-8 data. This prevents an unusually large or malformed text layer from consuming unbounded browser memory. The PDF input and page limits still apply separately.

Columns, tables, and reading order

PDF is a presentation format. A page can draw the right column before the left column, place each letter separately, or position table cells without a semantic row structure. The visual result may look correct while the internal object order is not a natural reading order.

The extractor considers text items, hasEOL hints, coordinates, spaces, and writing direction. It can produce useful plain text for common documents, including right-to-left content, but it does not reconstruct a Word document, spreadsheet, or accessible tagged-PDF structure. Columns may interleave, table cells may flatten, and headers or footers may appear in the middle of a copied passage.

For visual preservation rather than text reuse, PDF to Images exports rendered pages. Images preserve appearance but do not create editable text and should not be confused with extraction.

Protected PDFs and privacy

Reading a protected document does not change it, so the tool does not need to re-encrypt an output PDF. The password is used to open the local PDF.js session and is cleared when the file is removed or the page is closed. Filenames, passwords, extracted text, page counts, selected pages, and document contents are excluded from analytics.

Browser-local processing does not make every clipboard or download destination private. After copying text, the operating system clipboard and any application where you paste it become part of the data flow. Save sensitive TXT files only to an appropriate location.

Troubleshooting

The tool says the PDF may be a scan

Open the file in a viewer and try to select individual words. If selection only draws a rectangle over the whole page, the page is probably an image. OCR is required and is not included in this tool.

Words run together or have unexpected spaces

PDF text positioning does not always record normal word boundaries. The extractor estimates spaces from item coordinates and line hints. Custom fonts or individually positioned glyphs can still produce unusual results. Compare important quotations with the visible source.

Columns or tables appear in the wrong order

That is a limitation of plain text and PDF drawing order. Extract a smaller page range, copy sections separately, or use a specialized table/document conversion workflow when structure matters.

Some pages are blank while others work

A PDF can mix digital pages and scanned images. The extractor returns text for pages with a supported text layer and keeps page boundaries for blank results. Use Organize PDF when blank or unwanted pages should be removed from a separate working copy before extraction.

Review before reuse

Treat extracted TXT as a working representation, not an authoritative replacement for the PDF. Verify names, numbers, punctuation, reading order, and the page where a quotation originated. Preserve the original for context and use page separators when traceability matters.