PDF to Text Converter
Extract plain text from PDF files in the browser — pure JavaScript PDF content-stream parser. Reads each page's text operators (Tj, TJ, ', "), joins text with configurable separators, and downloads a .txt file. 100% client-side.
About PDF to Text Converter
Extract plain text from PDF files in the browser — pure JavaScript PDF content-stream parser. Reads each page's text operators (Tj, TJ, ', "), joins text with configurable separators, and downloads a .txt file. 100% client-side. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
What does this tool do?
It extracts plain text from PDF files entirely in your browser. We load the PDF using pdf-lib, walk each page's content stream looking for text-showing operators (Tj, TJ, ', "), decode the string operands (literal and hex strings), and join them into a .txt file. No external API, no upload — everything runs in JavaScript.
What PDF features are supported?
We support: text in standard content streams (Tj/TJ/'/" operators), text in compressed streams (FlateDecode is decompressed via DecompressionStream), multiple pages, page ranges, custom line separators, whitespace trimming, empty-line removal, line numbering, and basic font-based character decoding. We do NOT support: scanned PDFs (images of text — needs OCR which requires a 5MB+ WASM blob), encrypted/password-protected PDFs (pdf-lib throws — we surface a clear error), embedded fonts with custom encodings (we treat strings as UTF-16BE or PDFDocEncoding heuristically), right-to-left scripts, and form fields with appearances.
Why is the extracted text sometimes garbled?
PDF text strings can use one of several encodings: PDFDocEncoding (Latin-1-like), UTF-16BE (with BOM), or custom font-specific encodings (Type1/CIDFont with custom CMaps). We heuristically detect UTF-16BE (strings starting with 0xFE 0xFF) and decode the rest as PDFDocEncoding (treated as Latin-1). For fonts with custom CMaps (common in CJK PDFs), the extracted bytes will not map to readable characters without the CMap data. Use pdftotext (poppler-utils) on desktop for those cases.
What extra features does this tool have compared to others?
10 extras: (1) Drag-drop input. (2) Page range selector (e.g. '1-3,5,7-9'). (3) Custom line separator (\n, \r\n, or custom). (4) Trim whitespace per line. (5) Remove empty lines. (6) Stats — page count, word count, character count, line count. (7) Output encoding (UTF-8 with/without BOM). (8) Line numbers prepended. (9) History of recently converted PDFs (localStorage — last 10). (10) Shareable URL with conversion options.
Is my PDF uploaded anywhere?
No. All PDF parsing and text extraction runs in your browser using pure JavaScript and pdf-lib. File contents never leave your device. Only conversion summaries (filename + page count) are saved to local history.
Why does my PDF say 'encrypted' or 'password-protected'?
PDFs can be encrypted with a user password (required to open) or an owner password (required to remove restrictions like copy/print). pdf-lib cannot decrypt password-protected PDFs in pure JavaScript — that requires a native crypto library. Use qpdf --decrypt (command-line) or Adobe Acrobat to remove the encryption first, then upload the decrypted PDF here.
Related tools
7Z Extractor
Inspect and extract files from 7z archives. Detects the 7z signature (0x37 0x7A 0xBC 0xAF 0x27 0x1C), parses the SignatureHeader and StartHeader, lists files from the archive metadata, and extracts STORE-method files when possible. Honest about LZMA compression limitations. 100% client-side.
APK Extractor
Extract and inspect Android APK files in the browser — pure JavaScript APK (ZIP) parser. View AndroidManifest.xml (binary XML detection), list DEX files, resources, and assets, extract individual files, detect app info (package name, version) from manifest. 100% client-side.
ARJ Extractor
Inspect ARJ archives. Detects the ARJ magic (0x60 0xEA), parses header structures, lists file entries with sizes and CRCs, and extracts STORE-method files when possible. Honest about ARJ compression limitations. 100% client-side.