Skip to content
PlainPaste

Blog

Pasting Markdown into Word or Google Docs with the formatting intact

rich textwordgoogle docsclipboard

Stripping Markdown down to characters is the right answer for a form field. It is the wrong answer for a document. If you are pasting into Word or Google Docs, you want the headings to be headings and the table to be a table.

That is a different conversion, and it works through a part of the clipboard most people never think about.

The clipboard holds more than one thing

A single copy operation can carry the same content in several formats at once. When you copy from a word processor, the clipboard receives text/html and text/plain. The application you paste into picks whichever it understands: Word takes the HTML and rebuilds the formatting; a terminal takes the plain text and ignores the rest.

This is why pasting from a browser into Word keeps bold text, and pasting the same thing into a code editor does not. Nothing was lost — two versions travelled together and each destination chose one.

Rich-text conversion here writes both. Choose Rich text as the output format and press Copy, and the clipboard gets the rendered HTML alongside a plain-text fallback. Paste into Word, Docs, Gmail or Outlook and the formatting arrives. Paste into a terminal and you get readable text rather than markup.

What comes through

Headings, bold and italic, ordered and unordered lists with their nesting, tables with real cells, links as real links, inline code and code blocks, blockquotes, and images where the destination can reach them.

Task lists come through as checkboxes. Footnotes come through as links to their definitions.

Where it gets awkward

Firefox gates the clipboard API that writes multiple formats behind a preference, so the automatic path is unavailable there. The fallback selects the rendered preview so a manual Ctrl/+C still carries the formatting — the browser’s own copy handles the two flavours even when the API will not.

Images are references, not data. If the Markdown points at https://example.com/chart.png, the pasted document points at the same URL. It renders where that address is reachable and breaks where it is not. If the image needs to travel with the document, download the HTML and keep the image beside it, or insert the picture in the destination yourself.

Google Docs is stricter than Word about which HTML it accepts and will occasionally simplify a nested structure. Deeply nested lists are the usual casualty.

Settings still apply

A common assumption is that rich text ignores the conversion settings, since HTML has a real element for everything. Mostly true — but not entirely. Several settings change the document itself rather than how it is drawn:

  • Links can keep just their text, show the URL, or become the URL.
  • Images can be kept or dropped.
  • Code blocks and quotes and footnotes can be dropped.
  • Headings can be uppercased.
  • Punctuation can be normalised to ASCII.

Those apply to rich text and HTML as much as to plain text. The ones that genuinely do not are the character-shaping ones — bullet glyph, table layout, task-list markers, blank-line collapsing — because an HTML list needs no bullet character chosen for it. Those switch off when you leave plain-text mode, and the panel says why.

If you need a file rather than a paste

The same rendering downloads as a self-contained .html with its styling inlined, so it opens correctly with no network connection — or prints to PDF.

Try the converter →