Markdown to Google Docs

Convert Markdown to formatted text you can paste straight into Google Docs, Word, Gmail or Teams.

0 characters

Or drop a .md/.txt file onto the box above.

Preview (what will be pasted)

The formatted result appears here as you type.

Copy & open Google Doc ↗

How to use

  1. Paste the Markdown into the left box. The preview on the right shows the formatted result as you type: headings, bold, lists, tables, code, links.
  2. Click Copy for Google Docs (or press Ctrl+Enter in the input box). The formatted text and a plain-text copy both go on the clipboard.
  3. Open your document (Copy & open Google Doc ↗ copies and opens a new one in a single click) and press Ctrl+V (⌘+V on a Mac). Word, Gmail, Outlook, Teams and Notion accept the same paste.
  4. Need the code instead? Copy HTML or Download .html give you the fragment the preview is made of.

How formatting travels through the clipboard

When you copy text from a web page and paste it into Google Docs, the headings and bold come with it. When you copy Markdown from a chat window and paste it, they do not. The difference is not the editor, it is the clipboard: the first copy carried an HTML flavour alongside the plain text; the second carried only text, and Markdown's ** and # are just characters to Docs. Docs' own Paste from Markdown option exists for exactly this and is worth switching on if your account offers it.

This tool converts the Markdown to HTML in your browser, shows you that HTML rendered, and on Copy for Google Docs writes both the HTML and a plain-text version to the clipboard. Any editor that understands formatted paste (Google Docs, Microsoft Word, Gmail, Outlook, Teams, Notion, Confluence) reads the HTML and applies its native styles. A plain text box, a terminal or a code editor takes the text version. The HTML is deliberately simple: semantic tags, a monospace font on code, a border on tables, nothing else, so the destination's own styles apply rather than fighting inline ones.

Example

Load sample inserts a deploy checklist with 1 heading, 3 lists (one nested, one of tasks), 1 table, 1 code block and 3 links. The preview shows it formatted; the HTML that goes on the clipboard begins:

<h2>Deploy checklist</h2>
<p>Run the <strong>full test suite</strong> before tagging a release: <code style="font-family:Consolas,'Courier New',monospace">npm test</code> takes about <em>two minutes</em>.</p>

Pasted into Google Docs, that is a Heading 2, a paragraph with a bold phrase, monospace npm test and an italic phrase, then a numbered list with a nested bulleted list, a three-column table with a header row, an indented quote, a monospace command and a two-item list beginning with ☑ and ☐. The table is <table border="1" style="border-collapse:collapse"> and the code block is <pre style="font-family:Consolas,'Courier New',monospace;white-space:pre-wrap">, which is what makes Docs keep the border and the font.

Options explained

Edge cases and common errors

Do the same thing in code

Shell (pandoc)

pandoc -f gfm -t html notes.md -o notes.html    # the same kind of fragment
pandoc -f gfm -o notes.docx notes.md              # straight to Word

Python

import markdown
html = markdown.markdown(text, extensions=["tables", "fenced_code"])

JavaScript (browser)

import { marked } from "marked";
const html = marked.parse(text);
await navigator.clipboard.write([
  new ClipboardItem({
    "text/html": new Blob([html], { type: "text/html" }),
    "text/plain": new Blob([text], { type: "text/plain" }),
  }),
]);

When the destination is a chat box rather than a document, formatting is the problem, not the goal: Markdown to Plain Text removes it while keeping the structure, or rewrites it as Slack, WhatsApp or Google Chat markup. Text that came out of an AI assistant with curly quotes and em dashes can go through the AI Text Cleaner first.

Markdown to Google Docs FAQ

Why does pasting Markdown into Google Docs leave the asterisks and hashes in?

A normal paste carries plain text, and Google Docs shows plain text as typed: **bold** stays four characters, not a bold word. Formatting only travels when the clipboard also holds an HTML version of the text, which is what this tool puts there. Docs then reads the HTML and applies its own styles: Heading 1–6, bold, italic, lists, a real table, links.

Google Docs has a “Paste from Markdown” option, so why use this?

It does, since July 2024: Tools → Preferences → Enable Markdown, then right-click → Paste from Markdown. If it is on for your account, use it. This page is for when it is not (a Workspace admin has not enabled it, or the destination is Word, Gmail, Outlook, Teams or Notion rather than Docs), when you want to see the result before it lands in the document, or when you need the HTML itself.

Do tables and code blocks survive the paste?

Tables paste as real tables: the HTML carries a bordered table with a header row, and Google Docs, Word and Outlook build one from it. Code pastes as monospace text; Docs has no "code block" style, so the tool marks code with a monospace font (Consolas / Courier New) that the editor keeps. Nested lists paste as nested lists; task items paste with ☑ and ☐ characters, since checkboxes are not something HTML can carry into Docs.

Can I download a .docx file?

Not from this page. Paste into Google Docs and use File → Download → Microsoft Word, or paste into Word directly. For a command-line route, pandoc converts a Markdown file to .docx in one step (see the code section below). Download .html gives you a standalone file that Word also opens.

Is my document uploaded anywhere?

No. The Markdown is parsed and rendered by JavaScript in this page; the clipboard write happens in your browser. There is no server, so nothing you paste can leave your device, and the only network request on the page is for the page itself.

Runs entirely in your browser: this page is a static file with no server behind it, so nothing you paste can be uploaded. Last reviewed by Parthesh Gupta. Implements GitHub Flavored Markdown.