Convert MS Word Document to Markdown

Ravindu Kariyawasam
2 min readDec 15, 2019

--

Source: Ask Different — Stack Exchange

There are numerous ways to convert Word documents to Markdown. I recently entered the Google Code-in competition and was given a task to convert a Word document to Markdown. This post will present you a simple way of achieving the task.

What is Markdown?

According to Wikipedia, Markdown is a lightweight markup language with plain text formatting syntax. Markdown can easily be converted to many output formats, mostly converted to HTML. It is often used in README files and for writing messages in online discussion forums.

MS Word to Markdown

As stated above, there are numerous ways to do the conversion. Here, I’ve used Pandoc to achieve the task.

Step 01: Download and Install Pandoc on your PC

Pandoc is a free and open-source document converter, widely used as a writing tool. You can download Pandoc from here.

Step 02: Convert

On Command Prompt, navigate to the folder where the Word document resides.

Then enter the following command;

pandoc -f docx -t markdown faq.docx -o faq_markdown.md

Note: faq.docx is the source Word document and faq_markdown.md is the file name given to the Markdown file that is generated. You can replace them with your required file names.

Demo:

Command Prompt
Result

Your Markdown file is now ready!

--

--