Convert a Microsoft Word document to markdown

Published on July 16, 2021

How to convert a Microsoft Word document like .doc or .docx to markdown.

# first install pandoc (use brew for macOS)
brew install pandoc

# then this is the command to convert the file
# the markdown type converts tables and the extract media will put all images in ./media
pandoc -f docx -t markdown my-document.docx -o my-markdown.md --extract-media=./

That’s it. Short one. Hope it helps!

Darragh ORiordan

Hi! I'm Darragh ORiordan.

I live and work in Sydney, Australia enjoying the mountains and the ocean.

I build and support happy teams that create high quality software for the web.

Contact me on Twitter!


Sign up for the newsletter

Get new writings, curated tech articles and coding tips!

Read the Privacy Policy.