Markdown to Word

Converts GitHub-flavored Markdown to a Word document

Build Status


While Markdown is the lingua franca of the development world, the rest of the world still sees Word documents as the de facto way to share text. Rather than try to convert the rest of the world, just work in Markdown, and convert things to Word before sending to others.


You can see it in action with this demo


Add the following to your project's Gemfile:

gem 'markdown_to_word'


MarkdownToWord.convert("# Some Markdown").path
=> "/path/to/the/file.docx"

Command line usage

m2w "# Some Markdown" > foo.docx

(Returns the contents of the docx to STDOUT)

How it works

  1. We use HTML Pipeline to convert the Markdown to HTML
  2. We use HTML to Word to convert the HTML to a Word doc

Why not just use Pandoc?

While Pandoc is great on the desktop, it's hard to install on servers or use on Heroku.

Need to go the other way?

See Word to Markdown.