w2mWord to Markdown

How to convert a Google Doc to Markdown

There are three good ways to get Markdown out of a Google Doc. Word to Markdown handles two of them, and it converts everything in your browser, so the document never leaves your computer.

Option 1: Copy and paste

  1. In Google Docs, select the text you want (Ctrl+A or ⌘A for the whole document) and copy it.
  2. Open word2md.com and paste anywhere on the page.
  3. Copy the Markdown, or download it as a .md file.

Pasting is quickest for part of a document. Google Docs puts its own markup on the clipboard, and Word to Markdown strips it out before converting.

Option 2: Download as .docx, then convert

  1. In Google Docs, choose File → Download → Microsoft Word (.docx).
  2. Drag the .docx onto word2md.com, or click to choose it.
  3. Copy the Markdown, download a .md file, or download a .zip with the images as separate files.

This works best for whole documents, especially ones with images or footnotes. Images come along in the .zip, and footnotes become GitHub-flavored [^1] footnotes.

Option 3: Google’s built-in export

Google Docs can also save Markdown directly: File → Download → Markdown (.md). If that output works for you, use it. Word to Markdown is useful when you want the same conversion for Google Docs and Word files alike, images as separate files, or (with a downloaded .docx) a warning when something can’t come across, such as comments or headers.

Tips for cleaner Markdown

Converting lots of Google Docs

To convert a folder of documents, download them as .docx (Google Drive can download several files at once as a .zip; unzip it first), then use the command-line tool to convert them all:

for f in *.docx; do npx -y word-to-markdown "$f" -o "${f%.docx}.md"; done

Convert a Word document to Markdown now. It's free, and nothing is uploaded.