HTML to Markdown extendsion convert HTML code snippet to markdown.
There is one available command:
HTML to Markdown: convert current opened editor HTML code snippet to Markdown and open a new tab. If HTML code snippets are selected in the current editor the HTML is converted to Markdown without opening a new tab.
Press F1 or Ctrl + Shift + p or Cmd + Shift + p(macOS) to open command palette, input HTML to Markdonw, then execute it.
VS Code has a built-in "Paste As" featurefor inserting copied HTML content, so a separate plugin is often not needed for basic functionality.
Using the Built-in Feature
This method is recommended for most users as it preserves HTML structure directly from a web browser.
Copy the desired HTML content from a web page or another source to your clipboard.
In VS Code, open the Command Palette by pressing Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS).
Type Paste As in the command palette search bar.
Select the Insert HTML option from the list.
The HTML code will be pasted into your editor. You may need to manually indent or format the code afterward, or enable editor.formatOnPaste in your settings to do so automatically.
Alternative: Extensions
If the built-in feature doesn't meet your needs (e.g., for specific advanced formatting or cross-platform compatibility issues), you can explore dedicated extensions:
Paste Special: This extension provides a command to paste various clipboard formats, including HTML.
To use, press Ctrl+Alt+V (Windows) or use the Command Palette to select Paste Special.
Paste from Web: An extension specifically designed to handle content copied from the web.
You can install extensions by navigating to the Extensions view (Ctrl+Shift+X) in VS Code and searching for the extension name.
Paste from Web is a Visual Studio Code extension that enables the ability to copy a resource from a copied URL directly without having to download the asset and import manually.