Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Remove Markup TagsNew to Visual Studio Code? Get it now.
Remove Markup Tags

Remove Markup Tags

zero3

|
1,910 installs
| (0) | Free
Remove HTML/XML markup from selected text, leaving plain text.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Remove Markup Tags

English | 日本語

Strip HTML/XML markup from the selected text in Visual Studio Code, leaving just the text.

Remove Markup Tags in action

Features

  • Removes tags, comments, doctype and processing instructions from every selection — multi-cursor selections included — as a single undoable edit.
  • Converts HTML to plain text by default: <script> and <style> elements are dropped together with their contents, character references such as &amp;, &lt;, &nbsp; and &#8212; are decoded, and <br> becomes a line break. Each of these can be switched off (see Settings).
  • Text that is not markup is not changed. This includes comparisons such as a < b and any > inside comments or attribute values. CDATA sections keep their contents.
  • Works with XML as well as HTML, including non-ASCII element names.

Usage

  1. Select the text that contains markup. Multiple cursors are supported.
  2. Open the Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on macOS) and run Remove Markup Tags. The command is listed only while something is selected.
  3. Each selection is replaced by its text content and the selection is cleared. Use Undo to restore the original text.

To bind a key, add a shortcut for extension.removeMarkupTags in Keyboard Shortcuts (Ctrl+K Ctrl+S).

Settings

Setting Default Description
removeMarkupTags.removeScriptAndStyleContent true Drop <script> and <style> elements together with their contents, not just their tags.
removeMarkupTags.decodeEntities true Decode &lt; &gt; &amp; &quot; &apos; &nbsp; and numeric character references after removing tags.
removeMarkupTags.replaceLineBreaks true Replace <br> with a line break (matching the document's end-of-line sequence) instead of removing it.

All of them can be overridden per language — for example, to keep character references intact while editing HTML source:

"[html]": {
  "removeMarkupTags.decodeEntities": false
}

Limitations

The extension works on the text itself rather than parsing it as a document:

  • Only the named character references listed above are decoded; others such as &copy; are left as written. Numeric references always work.
  • For a <script> or <style> element without a closing tag, only the opening tag is removed; its contents remain.
  • Any text in the form of a tag is removed, including <T> in generic code.

Installation

Search for Remove Markup Tags in the Extensions view (Ctrl+Shift+X), or open Quick Open (Ctrl+P) and run ext install zero3.vscode-rmt.

Development

pnpm install
pnpm test   # compile, lint, and run the Jest suite

Press F5 to launch an Extension Development Host with a sample file open.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft