Blog

Why copying from ChatGPT or Claude loses the Markdown

Select part of a reply in ChatGPT or Claude, copy it, and paste it into Google Docs: the headings and bullets come through. Paste the same thing into VS Code, a terminal, a commit message or a Markdown file, and you get flat lines of text. The ##, the - before each item and the fences around code blocks are gone.

Nothing was lost on the way. Your clipboard holds the formatting; the app you pasted into just didn't ask for it.

Your clipboard holds more than one version

When you copy formatted text, from a web page or from apps like ChatGPT and Claude, the copy is stored several times over, in different formats. On a Mac you can see the list with this command:

osascript -e 'clipboard info'

After copying a formatted reply you'll see «class utf8» (plain text) next to «class HTML», «class RTF » (rich text) or both: the same selection in several formats. Web-based apps like Claude's usually add HTML; native Mac apps like ChatGPT's usually add rich text.

When you paste, the app you paste into picks the richest format it understands. Docs, Notion, Mail and Slack read the HTML, so the formatting survives. Code editors, terminals and plain text fields read the plain text, and that plain text is the reply as it looked on screen, not the Markdown the model wrote. The words are there; the Markdown syntax never was.

How to keep the Markdown

Use the copy button for whole replies

The copy button under a reply in ChatGPT and Claude copies the whole reply, usually as its Markdown source. That's the simplest fix when you want all of it. It doesn't help when you only need one section.

Convert a selection in your browser

The free rich text to Markdown tool reads the HTML version of whatever you paste into it and writes it out as Markdown: headings, nested lists, code blocks with their language, tables, links, bold and italics. It also works for Google Docs, Notion and ordinary web pages, and it runs entirely in your browser.

Fix it as you copy, on your Mac

Unwrap reads that same HTML or rich text when you copy from the Claude, ChatGPT or Perplexity apps, and puts Markdown on your clipboard instead, so your editor gets it on the first paste. For Claude's Code tab and the Codex app it goes one step further and pastes the reply's exact Markdown from the sessions saved on your Mac.

Why not just paste and fix it?

For one line, that's fine. For a reply with a numbered list, two code blocks and a table, retyping the syntax is slow and easy to get wrong, especially code fences and list indentation. Letting the HTML do the work is faster and keeps what the model actually wrote.