Copying from ChatGPT/Claude loses formatting: how to get clean Markdown
Why copying an AI answer into a blog or doc loses headings, tables and code — and how to turn it into clean Markdown without going back to the chat.
You just got a good answer from ChatGPT or Claude. You select it, copy, paste into your blog or notes — and get a mess: headings become bold lines, lists collapse into paragraphs, code blocks lose their line breaks. Check carefully and the original Markdown was never in the clipboard.
I ran into this often enough to build a small tool: Markdown Cleaner. Paste the answer, get clean Markdown, no need to go back to the AI tab and ask it to “output Markdown”.
Why copying from an AI web app loses formatting
Chat pages render HTML. When you copy, the browser puts two versions on the clipboard: text/plain and text/html. If your editor only accepts plain text, the structure disappears. If it accepts HTML, it may keep the visual formatting but produce rich text that is hard to control — not Markdown.
The “Copy” button inside a code block often returns only the code, without the language. And if you ask the AI to “output Markdown again”, you wait for another answer — sometimes it rewrites the content instead of keeping the original.
Three ways to handle it
- Ask the AI to output Markdown. Works, but costs another turn and may rewrite the content.
- Rebuild the format by hand. Accurate but slow; easy to miss a code block or table.
- Convert the HTML already on your clipboard. Fastest, keeps the original content, no extra AI call.
The third option is why the tool exists.
How I use it
- Select the answer on ChatGPT/Claude and press
Ctrl/⌘ + C. - Open Markdown Cleaner and paste into the left pane.
- Check the Markdown pane, switch to Preview if needed, then Copy Markdown or Download .md.
The tool reads text/html from the clipboard and converts it to Markdown: headings, lists, blockquotes, tables, links, images, fenced code blocks with language. For formulas, if the source page has TeX annotations (KaTeX), it keeps $...$ or $$...$$.
The result should look like this:
## Why use Markdown
- Keeps structure when moving to a blog
- Easy to review before publishing
> AI answers often lose formatting when copied.
What to check after converting
- Code block language: if the fence is just
```with nots/python, add it by hand. - Tables: HTML tables become GFM tables; trim columns that are too wide before publishing.
- Internal links: links inside AI answers may point to the chat or temporary sources; replace them with real URLs.
- Images: images hotlinked from the AI page may expire; download and keep them next to the post if they need to last.
- Repeated sections: AI intros and conclusions often repeat; cut before publishing.
Why the tool runs in your browser
Content you copy may be internal notes, plans or customer data. Sending it to a random server to “format” it is unnecessary risk. Markdown Cleaner runs entirely in JavaScript in your browser: no API, no stored content, no analytics reading the content. You can go offline after the page loads and it still works.
When to still do it by hand
If the content has unusual structure — diagrams, deeply nested tables, or code mixing several languages — read and fix it. The tool removes 80% of the repetitive work, not the editing.
If you write your blog in Markdown and want to move AI answers quickly, try the tool here: Markdown Cleaner.



Discussion
Comments 0
No comments yet. You can be the first.