Why converting PDF to Word is so hard, and how to get the best result

Converting a PDF to Word is hard because a PDF does not contain paragraphs, columns or tables. It contains instructions to draw characters at exact positions on a fixed page. A converter has to reconstruct the structure from those positions, and that is guesswork. My PDF to Word converter takes the honest route, getting the text and its basic structure out cleanly, and this guide explains why every converter, mine included, makes trade-offs.

Two different kinds of document

A Word document is a flow format. It stores paragraphs, headings, lists and tables, and the layout is calculated each time it opens: change the margins and the text reflows. A PDF is a fixed-layout format, descended from the PostScript printing language. It stores the finished page, the same everywhere, which is exactly why people send PDFs. Turning one into the other means inferring the logical structure that the PDF was designed not to need.

What a PDF page actually contains

Inside a page's content stream, text appears as operations like "set font F2 at 10 points, move to these coordinates, draw these glyphs". Several things that look obvious on screen are not recorded:

  • Lines and paragraphs. Each line, or even each word, may be a separate drawing operation. Nothing says where a paragraph ends.
  • Spaces. Gaps between words are often produced by moving the drawing position, not by a space character.
  • Reading order. Text is stored in whatever order the creating software wrote it, which may jump between columns, headers and footnotes.
  • Tables. A table is ruled lines plus text that happens to line up; there are no cells.
  • Meaning of characters. Glyphs are codes into a font. If the font lacks a map back to Unicode, the text extracts as gibberish; ligatures such as fi can also come out oddly.

How PDF files work: why some have text and some are pictures goes deeper into content streams and fonts.

What a converter has to guess

From positions alone, a converter must decide which fragments form a line, which lines form a paragraph, where columns are, which large text is a heading, whether a repeated line at the top of every page is a running header to drop, whether a hyphen at a line end is part of the word, and whether a grid of text is a table. Each heuristic works on typical documents and fails on unusual ones. Tagged PDFs help: when the creating software recorded a structure tree of headings, paragraphs and tables, a converter can follow it instead of guessing. Many PDFs are untagged. Scanned PDFs are harder still, because the page is a picture with no text at all until optical character recognition reads it, as How OCR works, and why scans read better than photos explains.

Two approaches to conversion

Converters choose between two outputs. A reflowed document rebuilds paragraphs and headings as real Word text, which is easy to edit but looks simpler than the original. A layout-faithful document reproduces the look by placing text boxes and frames at exact positions, which looks right but is awkward to edit, because changing one sentence does not push the rest of the page along. Commercial tools often mix the two and add table detection, with varying success.

What my converter does

The converter reads the positioned text from each page with the pdf.js library, then groups it: a vertical jump of more than about 1.6 times the text height starts a new paragraph, and text much larger than the document's typical size becomes a heading, with two heading levels. Page breaks are kept if you choose, and the .docx opens in Word, Google Docs, Pages and LibreOffice. It does not keep columns, tables, images, fonts or exact layout. A scan with no text layer is detected and pointed to OCR. Everything runs on your device.

Getting the best result

  • Find the source. If the original Word file exists, ask for it; nothing beats it.
  • Want only the words? Extract the text and paste it where you need it.
  • Scanned? Run PDF OCR first, or make the file searchable with searchable PDF, and check the recognised text carefully.
  • Comparing versions? PDF diff compares the text of two PDFs directly, without converting either.

Sources and further reading

The claims in this guide rest on these references, which were checked when the guide was last updated. Spotted an error? The contact page says how to report it.

  1. PDF โ€” Wikipedia (content streams and text)
  2. Tagged PDF โ€” Wikipedia
  3. Office Open XML โ€” Wikipedia (the .docx format)

Try the tool

Frequently asked questions

Why does my PDF look wrong when converted to Word?

A PDF stores characters at fixed positions, not paragraphs, columns or tables, so the converter has to guess the structure and often gets complex layouts wrong.

Can a scanned PDF be converted to Word?

Only after OCR. A scan is an image with no text layer, so the text must be recognised first.

Why does copied PDF text come out as gibberish?

The font has no map from its glyph codes back to Unicode characters, so extraction cannot tell which letters the shapes represent.

Is it better to keep the layout or the text?

For editing, reflowed text is easier to work with. Layout-faithful output looks closer to the original but uses text boxes that are awkward to edit.