How to extract text from a PDF
Copying text from a PDF by hand gives broken lines, odd spaces and missing pages. Extracting it with a tool gives you a clean text file in seconds. This guide shows how to get plain text, Markdown or HTML out of a PDF, and what to do when the PDF turns out to be a scan.
Which tool for which result
There are three ways to take text out of a PDF. PDF to Text gives plain text with no formatting, the right choice for searching, editing or feeding text into another program. PDF to Markdown rebuilds headings, paragraphs and lists from the size and position of the text, ideal for notes and documentation. PDF to HTML does the same for web use, and can produce a complete web page with simple styling.
If you want a document you can edit with layout in a word processor, use PDF to Word instead.
- PDF to Text: plain text, no formatting.
- PDF to Markdown: headings, paragraphs and lists marked up.
- PDF to HTML: the same for web pages.
- PDF to Word: editable document with layout.
How to extract text, step by step
Open PDF to Text. The work is done in your browser and nothing is uploaded.
- Drop your PDF into the box. You can add several files.
- Choose the pages, if you do not want the whole document.
- Decide on the two options: add a marker line such as “--- Page 2 ---” between pages, and join lines into paragraphs.
- Click Extract text.
- Read it, copy it, or download the file.
Joining lines into paragraphs
A PDF stores text line by line, with no idea of paragraphs. Copying it gives a hard break at the end of every line, which is a nuisance when you paste it somewhere. The option “Join lines into paragraphs” guesses where a paragraph really ends, from the spacing between lines and how a line ends, and joins the rest. It works well for running text and less well for tables, poems and addresses, where line breaks matter. Untick it for those.
The page marker option helps when you need to know where each page started, for example to refer back to the original.
Markdown and HTML output
For Markdown and HTML, the tool looks at the size and position of the text to decide what is a heading, a paragraph or a list item. Large text becomes headings, bullets and numbers become lists. The results are a good starting point, but PDF does not say what a heading is, so check the output and fix what is wrong.
Markdown has an option to add a line (---) where each page ends, and HTML can be a complete web page with simple styling or just the fragment for pasting into your own page.
When there is no text
If the tool says that no text was found, your PDF is a scan: pages are pictures with no letters. Try to select a word with the mouse in a PDF viewer. If you cannot, it is an image. Use OCR PDF, which reads the pictures and gives you text, as a searchable PDF and as a .txt file. Accuracy depends on scan quality and on choosing the right language.
Reading order and tables
Text comes out in the order in which it is stored, which usually matches the reading order. Documents with several columns, sidebars and tables can be scrambled, because the file stores the columns in an order that suits the layout and not the reader. If tables matter, PDF to Excel keeps cells in a grid.
Special characters such as ligatures, bullets and symbols usually extract correctly. Occasionally, fonts with unusual encodings give odd characters. In that case, OCR may give cleaner text.
Privacy
The extraction runs on your device. Nothing is uploaded, so contracts, medical papers and private notes stay with you. There is no limit and no signup.