Debug: User object: None

How to Extract Text from a PDF

Copying text out of a PDF usually gives you broken lines, stray page numbers and tables that fall apart.

This guide explains why that happens, compares the three common ways to get your text out, and shows real before-and-after examples of what a good extractor fixes - plus the few things no extractor can fix, and what to do about them.

Extract text from your PDF free

Three Ways to Extract Text from a PDF

MethodGood forWatch out for
Copy and paste A sentence or a short paragraph. A hard line break at the end of every line, words split by hyphens, headers and page numbers mixed into the text, tables that come out one cell per line.
Open the PDF in Word Getting an editable document that looks roughly like the PDF. Word converts the PDF when you open it. Complex layouts often turn into text boxes and frames that are awkward to edit. Needs desktop Word.
A text extractor Clean, usable text: whole paragraphs, headings and tables rebuilt, headers and footers removed. Format Magic's text formatter does this for free. Scanned PDFs have no text to extract and need OCR first (see below).

Why PDF Text Comes Out Messy

A PDF is built for printing, not editing. Instead of paragraphs, headings and tables, it stores where each piece of text sits on the page and which font draws it. The line breaks are simply where one line of print stopped. A running header is just more text that happens to sit at the top of every page. A table is a set of lines with text placed between them.

So any tool that pulls text out of a PDF has to rebuild the structure from positions, font sizes and spacing. Copy and paste barely tries, which is why it produces the mess it does. A good extractor works much harder at it - here's what that looks like on real examples.

Common Problems, Before and After

Every example below is a sample PDF we made, run through a plain text extraction (what copy and paste typically gives you) and through Format Magic's extractor. The outputs are shown exactly as each produced them.

1. Line breaks in the middle of sentences, and split words

Every printed line ends with a hard break, and words hyphenated at the edge of the page come out in two pieces. Pasted into another document, the text won't reflow.

Sample PDF page: a justified report paragraph with words hyphenated at the ends of lines
The sample PDF: a justified paragraph with hyphenated line ends.
Plain extraction
Shipping  performance  improved  across  all  regions  this
quarter, with average delivery times falling from 4.2 to 3.6
days. The new routing software, introduced in July, accoun‐
ted for most of the gain, while warehouse consolidation in
the Midwest reduced handling costs by an estimated elev‐
en percent.
Format Magic
Shipping performance improved across all regions this quarter, with average delivery times falling from 4.2 to 3.6 days. The new routing software, introduced in July, accounted for most of the gain, while warehouse consolidation in the Midwest reduced handling costs by an estimated eleven percent.

Lines are joined back into whole paragraphs, split words are rejoined, and the extra spaces from justified text are removed. Real hyphens - like "order-tracking" or a code such as "SB-2248" - are left alone.

2. Headers, footers and page numbers mixed into the text

Running headers and page numbers are just text in a PDF, so they land in the middle of your paragraphs wherever a page ends.

Two sample report pages, each with a running header at the top and a page number at the bottom
Two pages of a sample report with a running header and page numbers.
Plain extraction (around the page break)
is for more charging points at the busiest depots, where vans queue
at the end of each shift.
Northwind Logistics - Annual Report 2026
Page 1
The company retired forty older delivery vans during the year and
replaced them with electric models, cutting fuel spending by a third.
Format Magic
Driver feedback has been positive overall. The most common request is for more charging points at the busiest depots, where vans queue at the end of each shift.

The company retired forty older delivery vans during the year and replaced them with electric models, cutting fuel spending by a third.

Text in the header and footer areas of each page is left out, and a sentence cut in half by a page break is joined back together.

3. Tables that fall apart

A PDF table is lines with text placed between them. Copy it and you usually get one cell per line, with no way to tell where a row starts.

Sample PDF page with a four-column table of delivery times by region
The sample PDF: a simple four-column table.
Plain extraction (first rows)
Region
Q2 (days)
Q3 (days)
Change
Northeast
4.0
3.4
-0.6
Midwest
4.5
...
Format Magic
| Region | Q2 (days) | Q3 (days) | Change |
| --- | --- | --- | --- |
| Northeast | 4.0 | 3.4 | -0.6 |
| Midwest | 4.5 | 3.7 | -0.8 |
| South | 4.1 | 3.8 | -0.3 |
| West | 4.3 | 3.5 | -0.8 |

The table is rebuilt row by row. The text formatter gives it to you as a Markdown table; in Format Magic's main app it becomes a real, styled Word table. Very complex tables, especially ones with merged cells, are worth a quick look after extracting.

4. Columns read in the wrong order

On a two-column page, the text you want runs down the left column and then down the right. A naive extraction can jump back and forth between the columns, mixing paragraphs together.

Two copies of a two-column page. On the left, reading jumps across between the columns; on the right, it reads down the first column and then down the second. Jumping between columns Reading each column in turn 123 456 123 456

Format Magic works out where the columns are and reads each one top to bottom, including pages with a full-width title above the columns and layouts with a sidebar. Very irregular layouts - magazine-style pages or text wrapped around pictures - can still come out in an odd order, so give those a quick read.

What No Extractor Can Fully Fix

  • Scanned PDFs. A scan is a picture of a page, with no text inside it at all. Quick test: try to select a single word in your PDF viewer. If you can't, it's a scan, and it needs OCR (text recognition) first - many PDF apps, including Adobe Acrobat, have a "recognize text" option. Format Magic doesn't run OCR.
  • Text drawn as pictures. Occasionally a PDF draws small pieces of text as images - heading numbers are a common case. There's no text there to extract, so those pieces go missing. A quick look at a few numbered headings will tell you.
  • Text that copies out as gibberish. Some PDFs look perfect but use fonts that don't record which letter each shape is, so the extracted text is nonsense. If that happens, the original document (or OCR) is the way around it.

Tips for the Cleanest Result

  • Use the original document if you have it. The Word file a PDF was made from has the real headings, lists and tables, so nothing needs rebuilding. From Google Docs, use File > Download > Microsoft Word (.docx). From Pages, use File > Export To > Word.
  • A PDF made from Word or Google Docs extracts well. These have a proper text layer, so most of the time you'll get clean text with no extra work.
  • Converting the PDF to Word first isn't a reliable fix. It can help with an unusual layout, but it often adds text boxes and frames. It's worth a try if a direct extraction struggles - not as a first step.
  • Spot-check the tricky parts. A quick look at a few numbered headings and any complex tables is usually enough to catch anything that didn't come through.
  • Scans need OCR first. Run text recognition on a scanned PDF, then extract the text from the result.

From Extracted Text to a Finished Document

Getting the text out is often only step one. If the end goal is a proposal, report or handout that looks professional, Format Magic can take you the rest of the way: upload the PDF to the main app, pick a design, and download a real, editable Word document - headings, lists and tables rebuilt in proper Word styles.

You wrote it, we format it. Your wording isn't rewritten; the AI handles structure and design.

Ready to get your text out?

Upload your PDF and get clean, usable text in seconds.

Frequently Asked Questions

How do I extract text from a PDF for free?
Upload the PDF to Format Magic's text formatter. It pulls out the text with whole paragraphs, rebuilt tables and headers and footers removed, ready to copy or tidy further. For a sentence or two, plain copy and paste from your PDF viewer is fine.
Why does text copied from a PDF have line breaks in the middle of sentences?
A PDF stores each printed line separately and has no idea where a paragraph starts or ends, so copy and paste puts a hard break at the end of every line. A text extractor joins the lines back into paragraphs and rejoins words that were hyphenated at the edge of the page.
Can I extract text from a scanned PDF?
Not directly. A scanned PDF is a picture of each page, with no text inside it. Run OCR (text recognition) on it first - many PDF apps, including Adobe Acrobat, offer it - then extract the text from the result. To check whether a PDF is scanned, try selecting a word: if you can't, it's a scan.
Will headings, bold text and tables be kept?
Yes, if you want them. In the text formatter, the "Keep headings" and "Keep bold and italics" switches keep them as Markdown symbols, and tables are rebuilt as Markdown tables. In Format Magic's main app they become real Word headings, formatting and tables in the finished document.
Why is my extracted text in the wrong order?
Usually because the page has columns. A PDF doesn't record reading order, so basic tools can read straight across the page and mix the columns together. Format Magic detects the columns and reads each one top to bottom; very irregular, magazine-style layouts can still come out in an odd order.
Is it better to convert the PDF to Word than to extract the text?
If you have the original Word file the PDF was made from, use that - it beats both. Converting a PDF to Word (for example by opening it in Word) can preserve more of an unusual layout, but often adds text boxes and frames that are awkward to edit. For clean text to work with, extracting is usually the better route.
Can I convert a PDF to Markdown?
Yes. Upload the PDF to the text formatter with "Keep headings" switched on, then use Convert to Markdown to tidy the result into clean Markdown, ready for GitHub, Notion or your docs.