Strip HTML Tags from Text

Paste HTML source and get readable plain text back. Paragraphs, headings and list items become line breaks, entities are decoded and scripts are dropped without ever running.

Runs entirely in your browser. Nothing you enter is uploaded or stored.

How to use the HTML tag remover

Paste HTML, from a full page source to a small snippet from a CMS or an email, and the plain text appears below as you type. Three options control the result:

  • Line breaks for block elements keeps the structure readable. Paragraphs, headings, list items, table rows, <div> and <br> become line breaks, and paragraphs are separated by a blank line. Turn it off to get one continuous line of text.
  • Decode entities turns &amp;, &nbsp; or &eacute; into the actual characters. Turn it off to keep the output HTML-safe: &, <, > and non-breaking spaces are then written as entities.
  • Remove script and style content drops the code inside <script>, <style>, <noscript> and <template>, which is almost never wanted in plain text.

Whitespace is handled the way a browser renders it: runs of spaces and line breaks inside normal text collapse to a single space, while text inside <pre> keeps its formatting. Comments are always removed.

Why a real parser is safer than a regex

The classic shortcut html.replace(/<[^>]*>/g, "") fails on ordinary HTML. A > inside an attribute such as title="a > b" ends the "tag" too early, comments and CDATA leave fragments behind, and script content survives as text. This tool uses the browser's DOMParser to build a document tree, exactly as the browser would, and then reads out the text. A document created by DOMParser is inert: scripts do not run, event handlers such as onerror never fire and images or other resources are not loaded. The output is placed in a plain text box, so it is never interpreted as HTML.

Worked example

<h1>Release notes</h1>
<p>Version 2.1 is <b>faster</b> &amp; smaller.</p>
<ul><li>New export</li><li>Bug fixes</li></ul>
<script>track()</script>

becomes

Release notes

Version 2.1 is faster & smaller.

New export
Bug fixes

With line breaks turned off, the result is Release notes Version 2.1 is faster & smaller. New export Bug fixes.

Common uses

  • Creating a plain-text version of an HTML newsletter.
  • Cleaning text copied from a CMS or a WYSIWYG editor before pasting it elsewhere.
  • Getting the word count of an article without markup, together with the word counter.
  • Preparing page content for search snippets, meta descriptions or data analysis.

Common mistakes

  • Using stripping as XSS protection. Removing tags for display is fine, but to accept user HTML on a site, use a dedicated sanitiser with an allow-list.
  • Losing link targets. Only the visible link text is kept, not the href. Copy URLs separately if you need them.
  • Images and alt text. Images are removed without their alt text, because it is not part of the visible text.

Frequently asked questions

How do I remove HTML tags but keep the text?

Paste the HTML into the input box. The tool parses it like a browser, removes all tags and comments and shows only the text content, with paragraphs and list items on separate lines.

Is it safe to paste HTML with scripts?

Yes. The HTML is parsed with DOMParser into an inert document, where scripts do not run, event handlers do not fire and images are not loaded. The result is shown as plain text.

Why not just use a regular expression to strip tags?

Regular expressions do not understand HTML. They break on a greater-than sign inside an attribute, leave comment fragments behind and keep script code as text. A real HTML parser handles all of these cases correctly.

What happens to entities like &nbsp; and &amp;?

With Decode entities on, they become the real characters: a non-breaking space and an ampersand. With it off, the output keeps them as entities so it can be pasted back into HTML safely.

Can I keep the paragraph structure?

Yes. Keep Line breaks for block elements switched on. Paragraphs and headings are separated by a blank line, and list items, table rows and br tags become single line breaks.