DEVELOPER · VSCODE · MARKDOWN

Paste as Markdown
in VS Code

Copy something from the web, paste it into your notes or README — and get a wall of <span> tags instead of clean Markdown. Here is why it happens, what VS Code can do about it on its own, and the fastest way to fix it properly.

Updated August 2026 · 5 minute read

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

OptionWhat it doesCatch
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.

  1. Install the extension (see the Clean Copy page for the current install options).
  2. Copy any content from the web.
  3. In VS Code, press Ctrl+Shift+V (Cmd+Shift+V on Mac) — the clipboard lands as clean Markdown.
  4. Want zero formatting instead? Run Clean Copy: Paste as Clean Text from the command palette.
  5. 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.

Get Clean Copy free →

Related: Copy as Markdown in Chrome · Paste Without Formatting · HTML to Markdown Converter · HTML to Markdown from the Terminal