PDF Text Extractor
PDF Text Extractor
How to extract text from a PDF
Add your PDF
Drag your file onto the dropzone or click to choose. The tool reads every page's text content and shows the result in the textarea.
Toggle page headers if needed
Tick Include page headers to add === PAGE N === dividers between pages — useful if you need to know which page each line came from. Untick for clean plain text suitable for re-processing.
Copy or download
Copy to clipboard drops the entire output into your clipboard — paste into Word, Notes, ChatGPT, anywhere. Download .txt saves the text as a UTF-8 file named after the source PDF.
PDF text extraction — the hidden plumbing of every document workflow
People pull text out of PDFs to quote a contract, feed a paper into a search index or a language model, or hand a translator plain text. The page on screen is no guarantee of what comes out: what matters is what the file says behind the shapes it draws.
How PDF text actually works
A PDF doesn't store text the way a Word document does — as a flat stream of characters with formatting. Instead, each page's content is a sequence of drawing instructions: "place this glyph at this exact x,y coordinate." Text extraction means walking those instructions in the order the file gives them, identifying which ones place glyphs, and mapping each glyph back to a Unicode character — which only works if the font says which character each glyph is. pdf.js — Mozilla's PDF engine, the one inside Firefox's built-in viewer — does this work for us, and marks where each line ends so the output keeps its line breaks.
Text in a PDF is drawing instructions, not paragraphs. It comes out in the order the file drew it, and a glyph is only a letter if the font says which letter it is.
Why it runs in your browser
Documents people extract text from — contracts, theses, filings, client files — are usually confidential. This tool reads the file in your browser tab and never uploads it; open the network panel while it runs and you will see no request carrying your document.
What this tool does — and what it doesn't
This extractor reads PDFs that have an embedded text layer whose fonts map glyphs to characters — the usual case for files saved from a word processor, LaTeX, a browser's Print to PDF or a design tool. It does NOT read scanned PDFs (pictures of pages, with no text layer); those need OCR first, which is a different operation. It does not guess either: it checks what came out and says so on the status line, page by page.
What the status line tells you
| Status says | What it means | What came out |
|---|---|---|
| Done — N characters extracted. | Every page had text, and none of it was control codes, private-use or unassigned code points. | The text, as drawn. |
| No text layer | The page holds no text at all: a scan, or text turned into shapes. | Nothing for that page. OCR it. |
| No usable character map | The page has a text layer, but at least half of it is control codes or letters from unrelated scripts: the font gives glyph numbers, not characters. | Nothing for that page — the junk is held back. OCR it, or copy from the source document. |
| N characters could not be mapped | A few glyphs had no character. Control codes are removed; private-use or unassigned code points stay in. | The text, with letters that may be missing or wrong. Check it against the page. |
| Thai: N ำ came out split | Each ำ (sara am) came out as ํ followed by า: the page draws it as two glyphs, and a character-by-character map cannot join them back. | Text that looks right but will not match a search for ำ. |
The check reads the characters, not the page image, so it cannot catch everything: a font with no map whose glyph numbers happen to land among ordinary letters or Chinese characters comes out as plausible-looking nonsense, and only reading it against the page shows that.
Glyph positions, not paragraphs: CMaps, columns, ligatures and tables
PDFs store text as glyph-positioning instructions, not as paragraphs. Extraction walks those instructions in the order the page draws them (see 03).
A font's ToUnicode CMap (character map) says which Unicode character each glyph is. Without one, pdf.js outputs the glyph numbers as if they were characters. On our own test PDFs that gave invisible control codes when the font's glyphs were renumbered from 1, and letters from Telugu, Greek and Sinhala for a Chinese sentence when they kept their original numbers — while the page rendered exactly like its correctly mapped twin (compared in poppler's renderer).
pdf.js returns text in the order the page's drawing instructions put it there, not sorted by position — tested here, a right-hand column drawn first comes out first. Most writers draw in reading order, which is why extraction usually works, and why multi-column pages and sidebars sometimes come out shuffled.
Ligatures (fi, fl, ffi) are stored as single glyphs but should decode to multiple Unicode characters. pdf.js handles the common cases automatically.
A table's cell structure is not in the text layer: cells come out as runs of text in the order the file drew them. For tabular data, use a dedicated PDF-to-CSV tool.
pdf.js marks the last run of each line with hasEOL; this tool turns those into line breaks. In our test, Chrome 157 printed a vertical Chinese column one glyph at a time, each marked hasEOL, so the column came out one character per line; the tool now joins a glyph to the column when it sits directly below the last one.
Right-to-left scripts (Arabic, Hebrew) are the hardest case: pdf.js records each run's direction, but mixed-direction lines can still come out in an order you need to check.
Mathematical formulas extract as the letters and operators drawn, not as math. A superscript is just a smaller glyph set higher on the line: tested here, "x² + y²" drawn that way comes out as "x2 + y2", and fractions or roots lose their layout entirely.
pdf.js is Mozilla's, Apache-2.0 licensed, and served from this site: a 353 KB module plus a 1.4 MB worker (about 99 KB and 403 KB gzipped).
FAQ
-
No. pdf.js runs entirely in your browser. The PDF is read into memory, text is extracted in memory, output is written to a textarea you can copy or download from. Open DevTools → Network and watch: the only requests are for pdf.js and, for some CJK fonts, its character maps, all from this site — none of them carries your document.
-
Read the status line. "No text layer" means the pages hold no text: most often the PDF came from a scanner and holds only pictures of the pages; less often the text was converted to outlines (drawn as shapes) or placed as an image. "No usable character map" means there is a text layer, but its fonts do not say which character each glyph is, so the tool holds the junk back rather than copying it out. Either way, OCR the pages (Adobe Acrobat, or the free Tesseract), or copy from the document the PDF was made from.
-
Because the font in the PDF does not say which character each glyph is. A PDF draws glyph shapes by number; copying works only if the file also maps those numbers to Unicode (a ToUnicode CMap) or the extractor can find the map elsewhere. We built test PDFs in Chinese, Japanese, Korean and Thai without that map, and pdf.js — the engine this tool uses — returned none of their characters: invisible control codes when the font's glyphs were renumbered from 1, letters from unrelated scripts when they kept their original numbers. Blanks and random letters are the same defect. On those test files the tool now says "No usable character map" instead of "Done" — for all but one Thai file, whose junk happened to look like ordinary letters and gets only a warning to check the text. It cannot catch every such file. No setting here can recover the text, because it is not in the file; OCR the page, or copy from the document the PDF was made from.
-
pdf.js returns text in the order the page draws it, not sorted by position, and this tool keeps that order. Most files draw in reading order; multi-column layouts, sidebars and footnotes are where it differs, so check those against the original — or use a layout-aware tool such as pdfplumber on the desktop.
-
No — output is plain text (UTF-8). For formatted output (Word, HTML, Markdown) you need a richer conversion tool. Plain text is what's useful for LLM ingestion, search indexing, and translation workflows.
-
If the password is restriction-only (no-copy, no-print), pdf.js will still extract via its own decoder. Open-password protected PDFs need the password removed first via Adobe Acrobat or macOS Preview.
-
Soft limit: browser memory. Large files are limited by memory rather than by the tool. The textarea preview may slow down with millions of characters — for very large documents, download as .txt and open in a real text editor (VS Code, Sublime).
-
Yes, when the font says which character each glyph is. On our own Chinese, Japanese and Korean test PDFs with that map, every character came out right; so did test files that name one of Adobe's predefined Chinese, Japanese and Korean encodings (Big5, GBK, Shift-JIS and others) without embedding the font, because the tool loads Adobe's character maps for them. Thai is harder even in a correct file: in our test line 44 of 47 characters came out right, and all three misses were ำ (sara am), which the text shaper drew as two glyphs with the tone mark between them (HarfBuzz did that even with the font's own rules removed). A character-by-character map cannot join those back into ำ, so it comes out as ํ + า; the PDF's /ActualText can carry the true text, but pdf.js does not read it. A Chrome 157 print of the same line kept 39 of 47 in pdf.js: the same three, plus five glyphs with no character at all. The status line counts both. Scripts whose letters are reordered or combined when shown — Devanagari, Tamil and other Indic scripts — behave like Thai; check them, and right-to-left lines, against the original.
-
Tables in PDFs are positioning instructions, not table structures. The extractor returns the cells in the order the file drew them, one run after another — often across a row, sometimes down a column, rarely in a form that keeps the grid. For tables, use a dedicated PDF-to-CSV tool or pdfplumber on the desktop.
-
Yes — that's a primary use case. The output is clean UTF-8 plain text suitable for chunking, embedding, and storage in a vector database. The per-page header option is useful for citation tracking (knowing which page a chunk came from).
-
It runs the same pdf.js in any current browser, phones included, but we have not tested it on phones. Large files are limited by the phone's memory, and speed depends on the page count.
Method & sources
How it computes
pdf.js getTextContent() per page, with CMaps for non-embedded CJK fonts. Runs come in content-stream order; the page then rebuilds lines from hasEOL and baseline changes, adds a space only at a visible gap (over a fifth of the font size), starts a new line when a run jumps back more than a font size, and joins a vertical CJK column printed one glyph at a time. Control codes are removed; a page mostly made of unmapped glyph numbers is withheld and named, as is every page with no text layer.
What this tool implements
- Corrected 2026-10-26: the page said pdf.js "walks left-to-right top-to-bottom by position". It returns text in the order the content stream draws it and does not sort: measured on pdf.js 4.10.38 with a right-hand column drawn first, the right column extracts first. Text in a PDF is positioned glyph runs (ISO 32000-1 §9.10), and reading order is whatever the writer drew.
- Corrected 2026-10-26: the shared line rebuild added no break when a run started BEHIND the previous one on the same baseline, so "RIGHT one" then "LEFT one" came out "RIGHT oneLEFT one" — one word to PDF Word Counter and PDF Diff too. A jump back of more than one font size now starts a new line; kerning-size overlaps stay inside the word.
- Corrected 2026-10-26: "No embedded text found" appeared only when EVERY page was empty, so a partly scanned file lost pages silently; every empty page is now named. The info line counted words by whitespace (a Chinese sentence as one word) and now uses the word counter's segmenting count. Measured: "x² + y²" drawn as raised glyphs extracts as "x2 + y2", not "x 2 + y 2". An empty page is not proof of a scan — outlined text has no text layer either.
- Privacy: nothing is uploaded, but the page does request pdf.js (353 KB module, 1.4 MB worker) and, for some CJK fonts, its character maps (ISO 32000-1 §9.7.5) from this site; "zero outbound traffic" was replaced with that. Restriction-only (owner-password) files extract; an open-password file is refused with a plain message.
- Corrected 2026-11-18: the status line said "Done" over text with no usable characters. Measured on 40 one-page test PDFs we built (Chinese, Japanese, Korean, Thai; OFL fonts), pdf.js 4.10.38 returns the glyph numbers of a font with no ToUnicode map as if they were characters — control codes, or letters from unrelated scripts — and all 40 got a green "Done", including the 20 with no correct character. Control codes (including Chrome 157's U+0000 in Thai) reached the box, the clipboard and the .txt. Now control codes are removed and counted; a page that is at least half control, private-use, unassigned or script-salad characters is withheld and named as having no usable character map; a split Thai ำ (ํ + า: the shaper drew it as two glyphs, and a per-code ToUnicode map cannot rebuild ำ; /ActualText can, and pdf.js does not read it) is counted and named, never rewritten; and a vertical column that Chrome 157 printed one glyph at a time comes out as one line per column, not one character per line. On the same 40 files, "Done" now appears only over exactly correct text (17 files); before, 23 of 40 statuses were a false "Done". The check cannot catch glyph numbers that land among ordinary letters.
Sources
- Mozilla. PDF.js — a general-purpose, web standards-based platform for parsing and rendering PDFs (Apache 2.0). https://mozilla.github.io/pdf.js/
- Adobe. PDF 32000-1:2008, the free copy of ISO 32000-1 (§9.7.5 CMaps; §9.10 Extraction of text content; §9.10.2 Mapping character codes to Unicode values). https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF…
- PDF Association. ISO 32000-2:2020 (PDF 2.0) clause 9 with approved errata — Table 119, Entries in a Type 0 font dictionary: ToUnicode, "(Optional) A stream containing a CMap file that maps character codes to Unicode values"; §9.10 Extraction of text content (page last modified 15 Aug 2025; read 2026-11-18). https://pdf-issues.pdfa.org/32000-2-2020/clause09.html
What can make this go out of date
- None that carries the document: the PDF is read in the browser by the page's own pdf.js 4.10.38. The page requests the pdf.js module, worker and CMap files from this site.