Skip to content
Marvin's Toolbox.

Search tools

Type to filter all tools

PDF Text Extractor

Pull the text out of a PDF, page by page or all at once. Keeps the reading order, lets you pick a page range, and gives you plain text you can copy, download or send to another tool.

Everything runs locally in your browser. Your data never leaves your device.

PDF

Drop a PDF here

or click to browse, or paste one with Ctrl+V

The text layer is read page by page, so long documents work too.

Page range

Text options

Every line of the page stays a line of its own.

Wide gaps on the page become blank lines, as many as the spacing suggests.

One blank line between pages.

Extracted text

Load a PDF and its text shows up here, ready to copy.

Next steps

Send this tool's output straight into another tool.

Count words, characters, sentences, paragraphs, lines and more as you type, with estimated reading and speaking time.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.

Convert text into every case at once: title case in the APA, AP, Chicago, MLA, Bluebook, AMA and NYT styles, sentence case, upper, lower, camelCase, snake_case, kebab-case and more.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Compare two texts and see every added, removed and changed line highlighted, side by side or inline, with the changed words marked within each line. Ignore case, whitespace or blank lines, read a summary of how much changed, and export the result as a unified diff.

Paste a UUID to see what it carries: version, variant, and for time-based versions the exact timestamp, clock sequence and node. Also shows the raw bytes, the 128-bit integer and the URN form.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Convert numbers between binary, octal, decimal, hexadecimal and any base up to 36. Type into any field and the others update as you go. Handles huge integers without losing precision and accepts 0x, 0b and 0o prefixes.

Convert between scientific notation and full numbers as you type. Reads 1.23e5, 1.23 × 10^5 and plain numbers, shows the value written out, in normalized scientific notation and in engineering notation, and can round to any number of significant digits.

About the PDF Text Extractor Tool

This tool pulls the text out of a PDF and gives it back as plain text. Drop a file in and every page is read in turn, in the order the document stores it.

You decide how the text is put back together: keep the line breaks or reflow the paragraphs, keep or drop the blank lines, rejoin words that a line break split with a hyphen, and mark where each page starts. Copy the result, download it as a .txt file, or open a single page and copy just that one.

What you can do

  • Extract the text from a PDF and copy it as plain text.
  • Convert a PDF to a .txt file.
  • Copy the text of one page instead of the whole document.
  • Extract a page range like 1-3, 7 instead of the whole file.
  • Reflow the lines of a PDF back into paragraphs.
  • Rejoin words that are hyphenated across a line break.
  • Drop the header and footer that repeat on every page.

How to use the PDF Text Extractor

  1. 1Drop a PDF onto the upload area, or paste one with Ctrl+V.
  2. 2Wait while the pages are read. A progress bar shows how far along it is.
  3. 3Keep all pages, or switch to a page range like 1-3, 7.
  4. 4Set the line break, blank line and page marker options until the text reads the way you want.
  5. 5Copy the text, download it as a .txt file, or open a page in the page by page list to copy that page on its own.

What can be extracted, and what cannot

A PDF written by a program (a word processor, LaTeX, a report generator, a browser's print to PDF) carries its text inside the file, and that text is what comes out here. A PDF made by a scanner or a phone camera carries pictures of pages instead, so there is no text in it to pull out. The tool says so when that happens, and the way forward is Image to Text (OCR), which recognizes words in an image, or PDF to Images to turn the pages into image files first.

Line breaks, paragraphs and hyphens

A PDF stores positions, not paragraphs. Every line sits where the layout put it, which is why extracted text usually arrives as a stack of short lines. Keeping those line breaks suits poetry, code and tables. Reflowing paragraphs joins the lines of a paragraph back into running text, which is what you want before pasting into a document. Wide gaps on the page are turned into blank lines, and you can keep them, collapse each gap to a single blank line, or remove them.

Printed text often splits a word across two lines with a hyphen. Joining hyphenated words puts those words back together and leaves the hyphen alone when the next line starts with a capital letter or a digit, so names like Mayer-Schmidt and ranges like 10-20 survive.

Page markers and repeated headers

Pages can follow each other directly, be separated by a blank line, or start with a marker line you write yourself. {page} in the marker becomes the page number and {pages} the page count, so a marker like Page 3 of 12 tells you where you are in a long export.

Long documents also repeat a title at the top and a page number at the bottom of every page, which turns into noise once the text is out of the file. The repeated header and footer option finds the lines that show up on most pages in the same spot and removes them, page numbers included, since it compares the lines with the digits masked out.

Columns and tables

Text comes out in the order the file stores it, which matches the reading order for ordinary documents. Two-column layouts and tables depend on how the file was written, so a scientific paper can come out column by column and a table row can arrive as separate lines. For those, extracting one page at a time and tidying the result afterwards works better than fighting the layout.

Send the text onward

The extracted text goes straight to Word & Character Counter for a word and character count, or to Find and Replace to clean up whatever the layout left behind. The PDF itself can be forwarded as well, for example to PDF to Images or PDF Compressor.

Credits

Open source does the heavy lifting in this tool. Thank you to:

  • PDF.js

    Mozilla's PDF renderer, the same engine that displays PDFs in Firefox.

Everything this site builds on is listed on the credits page.

Encode and decode Base16, Base32, Base36, Base45, Base58, Base62, Base64 and Base85. Pick the alphabet variant you need, from Crockford Base32 to Bitcoin Base58 and Ascii85, and convert in either direction.

Decode Base64 to text or encode text to Base64. Paste into the top box, read the result below, and flip the direction with one click. Handles Unicode correctly, reads URL-safe Base64, and shows binary payloads as a hex dump you can download.

Format code in JavaScript, TypeScript, JSON, JSON5, HTML, Vue, CSS, SCSS, LESS, Markdown, YAML, GraphQL, XML and SQL. Pick tabs or spaces, set the indent width, and format the input in place with one click.

Open a CSV or TSV file and read it as a proper table. Sort by any column, filter rows with a search or per-column conditions, hide columns you do not need, and copy or download what is left.

Remove duplicate lines from a list or text, keeping the first occurrence. Optionally ignore case and whitespace, or drop blank lines too.

Replace text in two modes: plain find and replace all, or regular expressions with flag controls and capture group references like $1.