Skip to contentSkip to the inputSkip to the result

PDF to text

Pull just the text out of a PDF

Loading tool

Instructions

PDF to text

How to use

  1. Choose a PDF, set the pages you need, then press Get the text.

Supported input

  • PDFs up to 100 MB.
  • Pick pages such as 1, 3-5, or leave empty for all.
  • Several pages are separated by page-number lines.

Input example

minutes.pdf · 3 pages

Result example

minutes.txt · 2,140 characters

Troubleshooting

  • Unsupported formats and oversized files are refused with a reason.
  • The original file is never changed.

Limitations

  • Scanned PDFs made of pictures hold no text to pull out (no character recognition).
  • Tables and columns may come out in a mixed order.
  • Password-protected PDFs cannot be opened.

How it works

  • Pulls the text out of a PDF, shows it, and lets you copy it or save it as TXT.

Why text pulled from a PDF comes out jumbled, and how to read it

When only the words matter

  • Quoting a clause of a contract word for word in an email
  • Putting a paragraph of a foreign-language paper into a translator
  • Moving a schedule from a published notice into a spreadsheet
  • Collecting the text of lecture slides in a notes app so terms are easy to search

A PDF has no paragraphs

A PDF is a list of instructions of the form “draw these glyphs at these coordinates in this font”. Where a sentence ends or a column breaks is often not recorded anywhere. Getting text out means mapping glyph shapes back to characters through the font’s ToUnicode table (ISO 32000-1, 9.10.3) and rebuilding lines from positions.

This tool takes the text pieces pdf.js returns and treats pieces whose baselines are within 2 pt of each other as one line. Lines are then sorted top to bottom by position, not in the order the file wrote them, and pieces within a line left to right.

Where one piece ends more than 14 pt (about 5 mm) before the next one starts on the same line, a tab goes between them. pdf.js fills such a gap with a wide piece holding a single space; that piece is not counted as text, so the gap itself is measured. Words end up separated by spaces and table cells by tabs.

Worked example: a two-column page

  1. 1The A4 test page has two lines in a left column (x = 50 pt) and two in a right column (x = 320 pt) at matching heights, a small table below with the columns Item, Qty and Price and two rows, and a footer. A “HEADER” line was written last in the file but sits at the top of the page, at 810 pt.
  2. 2The first line of the result is “HEADER”, because lines are ordered by where they sit, not when they were written.
  3. 3The second line joins the left column’s first line with the right column’s first line, a tab between them. Pieces at the same height count as one line, so instead of reading down the left column and then the right, a two-column layout comes out with the columns interleaved line by line. Pasted into a spreadsheet, the two columns land in columns A and B.
  4. 4The table comes out one row per line with tabs between the cells, so Item, Qty and Price each land in their own spreadsheet cell. The whole page amounted to 163 characters, 8 of them tabs.
  5. 5For a two-column paper, cut the result back into columns afterwards, or extract from a version of the PDF where each column has been split onto its own page.

When text is missing or garbled

  • No character map: some old converters store only the glyph shapes and leave out what characters they stand for. The result is a string of wrong symbols, and the only cure is to produce the PDF again from the original program.
  • East Asian fonts referenced by name: some PDFs name a standard Chinese, Japanese or Korean character map without including it. This site serves the map files pdf.js needs, so such documents do not come out blank.
  • OCRed scans: a scan that an app has run through text recognition carries an invisible text layer (text rendering mode 3, 9.3.6), which is extracted, recognition mistakes and all.
  • Vertical and rotated text: lines are grouped by baseline height, so a title set vertically or a rotated table heading comes out one character per line.
  • Permission-restricted files: a PDF with copy or print restrictions is encrypted even when it opens without a password, and this tool will not open it.

Getting the text ready for where it is going

  • Into a translator or an AI assistant: every visual line ends in a line break, which splits sentences. Replacing breaks inside paragraphs with spaces gives noticeably better translations.
  • Running headers and footers: the header and page number repeated on each page come out once per page. Strip them with find and replace before joining the text up.
  • Several pages at once: each page starts with a line such as “--- 3 ---” giving its original page number, handy when quoting. Typing 3,1 in the pages box extracts in that order.
  • Counting: the character count under the result includes spaces and line breaks and counts a simple emoji such as a smiley as one. For words, counts without spaces or UTF-8 bytes, paste the text into the character counter.

Checked

Frequently asked questions

Why does a scanned PDF give no text?

A scanned page is a picture with no text stored in it, and this tool does no character recognition (OCR). When no text is found, it points you to the PDF to images tool.

Will a table pasted into a spreadsheet keep its columns?

Wide gaps within a line become tabs, so columns often land in separate cells. Complex tables with merged cells and multi-column layouts can come out mixed.

Not all the text from a long PDF appears on screen.

The screen shows the first 60,000 characters, but Copy the text and Save as TXT include everything.