Why pasting into VS Code makes a mess
When you copy from a web page, the clipboard holds the page's full HTML fragment — inline styles, spans, smart quotes, tracking attributes. What happens on paste depends on where you land:
Into a .md file
VS Code inserts the raw HTML verbatim. Markdown renderers tolerate some inline HTML, so nothing errors — but your clean document fills up with <p style="..."> noise that is painful to edit later.
Into source code
Smart quotes and non-breaking spaces are invisible in the editor but break string literals, YAML values and regexes at runtime. Classic source of "works on my machine".
Into commit messages or docs
Hidden markup bloats diffs and makes documentation inconsistent with hand-written Markdown around it.
The fix is to convert the clipboard between copy and paste — ideally with one keyboard shortcut, without leaving the editor.
Your options today
| Option | What it does | Catch |
|---|---|---|
| Built-in paste | Inserts clipboard as-is (rich HTML kept when target accepts it) | No conversion at all — the whole problem |
| Paste as plain text | Strips all formatting via the command palette (Paste as plain text) | Loses everything — no headings, no links, no lists |
| Manual cleanup | Paste, then find-and-replace the worst offenders | Slow, error-prone, different every time |
| Clean Copy for VS Code | Converts clipboard HTML to proper Markdown or spotless plain text on paste | Free extension install — one time |
The fix: Clean Copy for VS Code
Clean Copy brings the converter behind the Clean Copy browser extension into your editor. Same core, same output — so text you copy to research and text you paste into docs behave identically.
- Install the extension (see the Clean Copy page for the current install options).
- Copy any content from the web.
- In VS Code, press Ctrl+Shift+V (Cmd+Shift+V on Mac) — the clipboard lands as clean Markdown.
- Want zero formatting instead? Run Clean Copy: Paste as Clean Text from the command palette.
- Already typed something messy? Select it and run Clean Copy: Convert Selection to Markdown.
# Headings preserved
H1–H6 map to the right number of # characters, so document structure survives the trip.
[Links](intact)
Links become standard Markdown references with the original URL — no relative-path surprises.
Tables → pipe tables
Simple HTML tables convert to Markdown pipe tables, including alignment.
Local only
Conversion happens inside the editor. Nothing is uploaded, nothing is tracked.
Frequently asked questions
Can VS Code paste HTML as Markdown?
Not natively. Pasting rich text into a Markdown file inserts raw HTML tags. You need an extension such as Clean Copy for VS Code, which converts the clipboard HTML to Markdown (Ctrl/Cmd+Shift+V) before it lands in your editor.
What is the shortcut to paste without formatting in VS Code?
By default there is none. With Clean Copy installed, Ctrl+Shift+V (Cmd+Shift+V on Mac) pastes the clipboard as clean Markdown, and the command palette offers a paste-as-plain-text command as well.
Does the conversion keep links, headings and tables?
Yes. Headings map to # levels, links become [text](url), lists stay lists, bold and italic survive, code blocks become fenced blocks, and simple tables convert to pipe tables.
Does anything get uploaded to a server?
No. Clean Copy runs entirely inside your editor. The clipboard content is converted locally and never leaves your machine.
Related: Copy as Markdown in Chrome · Paste Without Formatting · HTML to Markdown Converter · HTML to Markdown from the Terminal · HTML to Markdown API
Free e-book: Build Your First Chrome Extension
The complete guide is available as a free EPUB — no signup required.
Get the free e-book →Want all six guides? Complete EU Compliance Bundle — combined PDF + all EPUBs, $29.
Keeping websites online? DeskUptime is a free desktop uptime & SSL-expiry monitor for macOS, Linux and Windows.