# Word to Markdown: converting a manuscript cleanly

> A .docx carries thirty years of invisible formatting. What survives conversion, what has to be thrown away, and the cleanup that takes an hour once.

Canonical: https://buk.press/blog/word-to-markdown

4 September 2026 · 4 min read

Pandoc converts a .docx to Markdown in one command and gets the structure right about 90 percent of the time. The remaining 10 percent is the part that matters: direct formatting that was never a real heading, smart quotes, tracked changes, embedded images and Word's own list numbering. Budget an hour of cleanup, once, and you never do it again.

Almost every manuscript that ends up in Markdown started somewhere else, and that somewhere is usually Word. The conversion itself is easy. What is not obvious is that a Word file is not really a document. It is a document plus a long history of every formatting decision anyone ever made in it, including the ones they made by accident.

## The one command

Pandoc is the tool. It reads the real .docx XML rather than guessing at a copy-paste, which is why it is the only route worth taking:

```
<code># Basic conversion
pandoc manuscript.docx -o manuscript.md

# Better: extract images, and use ATX headings (#) rather than underlines
pandoc manuscript.docx -o manuscript.md \
  --extract-media=./images \
  --markdown-headings=atx \
  --wrap=none</code>
```

Those three flags are worth knowing. `--extract-media` pulls the embedded images out into a folder and rewrites the links; without it, images either vanish or arrive as unreadable base64. `--markdown-headings=atx` gives you `## Chapter` instead of an underline of equals signs, which is what every other tool expects. `--wrap=none` puts each paragraph on one long line rather than hard-wrapping at 80 characters, which makes later editing far less painful.

If you do not want to install anything: Google Docs can open a .docx and export it, and there are web converters. Both are fine for a short document and neither handles images or footnotes as well as the command above.

## Why the headings come out wrong

This is the big one, and it is not Pandoc's fault. In Word there are two ways to make text look like a chapter title. You can apply the **Heading 1** style, or you can select the text and make it 18pt and bold. On screen these look identical. In the file they are completely different things: the first is structure, the second is decoration.

Pandoc can only convert structure. A chapter title that was manually bolded arrives in your Markdown as `**Chapter One**`: a bold paragraph, not a heading. Which means it will not appear in a table of contents, will not start a new page, and will not be styled as a chapter by anything downstream. [Headings are the book's structure](https://buk.press/blog/markdown-headings-book-structure), and a book with no real headings has no structure to convert.

The fix is in Word, before you convert. Open the navigation pane (View → Navigation Pane). Any chapter that does not appear in it was never a heading. Select it, apply Heading 1, and repeat. On a 30-chapter manuscript this is twenty minutes and it makes the conversion work.

## What else needs cleaning

| What comes across | What to do |
|---|---|
| Tracked changes and comments | Accept or reject all, delete all comments, before converting |
| Smart quotes and dashes | Keep them; they are correct. Just be aware they are not ASCII |
| Manual line breaks mid-paragraph | Find and remove. They become real breaks and wreck reflow |
| Double spaces after full stops | Find and replace with one. A typewriter convention |
| Tabs and manual indents | Delete. First-line indent is a type setting, not a character |
| Empty paragraphs for spacing | Delete. Spacing is a margin, not a row of blank lines |
| Word's automatic list numbers | Check they arrived as `1.` text rather than vanishing |
| Text boxes and floating images | These do not survive. Re-insert them as normal images |
| Footnotes | Pandoc converts them, but confirm your destination supports them |

The empty-paragraph row is the one people resist, because those blank lines are load-bearing in Word. They are not load-bearing in a typeset book: the space between paragraphs is a property of the paragraph style, applied consistently everywhere, which is exactly why a typeset page looks even and a word-processed one does not.

## A cleanup pass you can run

After conversion, these regular expressions catch most of what is left. Run them in any editor that supports find-and-replace with regex:

```
<code>Find                    Replace     What it fixes
\ {2,}                  (space)     Multiple spaces
\n{3,}                  \n\n        Runs of blank lines
^\t+                    (nothing)    Leading tabs
\\$                     (nothing)    Stray hard line breaks
\*\*(.{1,60})\*\*$      ## $1        Bold-only lines that were headings</code>
```

The last one is a helper, not a rule. Review each match rather than replacing blindly, because a paragraph that legitimately ends in bold text will be caught too.

Do this once, properly, and commit the result somewhere. The whole benefit of moving to Markdown is that it is the last conversion you have to do; a half-cleaned file means doing this again in six months.

## Going the other way, and why you might not need to

Pandoc converts back (`pandoc manuscript.md -o manuscript.docx`), which is worth knowing if an editor or a competition demands a Word file. Supply a reference document to control the styling:

```
<code>pandoc manuscript.md -o manuscript.docx \
  --reference-doc=house-style.docx</code>
```

But if the destination is a finished book rather than an editor's inbox, the round trip is unnecessary. The point of getting the manuscript into Markdown is that it is now plain text you own, readable in thirty years, versionable, and ready to be designed once and exported as many times as you like: [a PDF](https://buk.press/markdown-to-pdf) and [an EPUB](https://buk.press/markdown-to-epub) from the same file, without either being converted from the other.

That is the honest argument for spending the hour. The conversion is a one-off cost; what you get is a manuscript that no longer depends on one application being able to open it. [Google Docs versus Markdown](https://buk.press/blog/google-docs-vs-markdown) makes the same case from the other direction, if you are still deciding.

**About this article.** Written by the team that builds bukpress, which turns Markdown into print-ready PDF and EPUB books. Spotted something wrong or out of date? Write to [support@buk.press](mailto:support@buk.press).

## Read next

Explainers 30 August 2026 · 4 min read

## [Google Docs, Word or Markdown: what to write a book in](https://buk.press/blog/google-docs-vs-markdown)

Write in Google Docs if other people need to comment on the draft while you write it, in Word if an editor or publisher will hand you tracked changes, and in Markdown if the same manuscript has to become several finished formats without being reformatted each time. Most people who finish books use two of the three, in sequence.

[Read it](https://buk.press/blog/google-docs-vs-markdown)

Tools 8 September 2026 · 6 min read

## [Scrivener to PDF: getting a book out of Compile](https://buk.press/blog/scrivener-to-pdf)

Compile to PDF directly when the book is plain prose and the default layouts are close enough; set the page size and margins in the Page Settings pane before anything else. When you need control over page breaks, running heads or an image-heavy interior, compile to Markdown or DOCX instead and typeset from there: Scrivener is a superb drafting environment and a blunt typesetter.

[Read it](https://buk.press/blog/scrivener-to-pdf)

Tools 30 August 2026 · 5 min read

## [Pandoc Markdown to PDF: the commands, and where it stops](https://buk.press/blog/pandoc-for-books)

To convert Markdown to PDF with Pandoc, install Pandoc and a PDF engine (a LaTeX distribution such as TeX Live or MiKTeX, or an alternative like Typst or WeasyPrint), then run pandoc input.md -o output.pdf. Add --pdf-engine=xelatex to use your own fonts, -V geometry:margin=2.5cm for margins and --toc for a contents page. Pandoc is the best tool for documents with citations, cross-references or mathematics, and for books built by a script; it stops being pragmatic when the requirements are visual, because every visual change means LaTeX or a template.

[Read it](https://buk.press/blog/pandoc-for-books)

## Write it in Markdown. Ship a book.

bukpress turns the file you are already writing into a typeset PDF and EPUB: your type, your covers, no watermark, ever.

[Get Lifetime, $27 once](https://app.buk.press/signup)
