Remove HTML Tags
Paste HTML, strip the tags, and get plain readable text. Options to keep or drop tag content, decode entities, remove comments, and preserve line breaks from <br> and <p>. Runs in your browser.
<p> tags, convert newlines to <br>, and escape special characters into entities.How to remove HTML tags from text
1. Paste the HTML
Drop the HTML source into the Input box. You can paste a full page, a snippet from "View Source", a rich-text email export, a CMS field, or any string that contains tags. Malformed and broken HTML works too; the stripper does not validate.
2. Set the toggles
Six toggles control the behavior. Remove all tags is the main switch. Keep text inside tags controls whether the readable content survives (default on). Decode HTML entities turns &amp; back into &. Remove HTML comments drops <!-- ... -->. Remove script and style content drops the contents of <script> and <style> blocks so JavaScript and CSS source does not end up in your output. Preserve line breaks inserts newlines at <br> and <p> boundaries.
3. Click Strip
The result appears on the right with a tag count and a comment count. The character count shows how much shorter the output is than the input.
4. Copy or download
Use the Copy button to grab the result, or Download to save a .txt file.
When you need to strip HTML
HTML lives inside a lot of pipelines that ultimately need plain text. Here are the common ones.
What each toggle does
Toggles run in a fixed safe order: comments first, then script and style content, then the remaining tags, then entity decoding, then line-break insertion at <br> and <p> markers (markers are recorded before tag removal).
| Toggle | What changes | Default |
|---|---|---|
| Remove all tags | Master switch. Off means the tool only runs the other toggles (entity decode, comment removal, script and style content). | On |
| Keep text inside tags | On: text between <p> and </p> survives. Off: text gets dropped along with the wrapping tags. | On |
| Decode HTML entities | Converts &amp;, &nbsp;, &mdash;, &#8217;, &#x27; to the real characters. | On |
| Remove HTML comments | Drops <!-- ... --> blocks before any other processing. | On |
| Remove script + style content | Drops the contents between <script> and </script>, and between <style> and </style>. Without this, you would see raw JS or CSS code in the output. | On |
| Preserve line breaks | Inserts a newline at each <br> and a double newline before each block-level tag (<p>, <div>, <li>, <h1> to <h6>). | On |
Related tools
Frequently asked questions
What is the difference between "Remove all tags" and "Keep text inside tags"?
Remove all tags strips the angle-bracket markup (<p>, <a href>, </div>). Keep text inside tags controls whether the visible content survives. With both on (the default), you get plain readable text. With Keep text inside tags off, the content between opening and closing tags is also dropped, useful when you want only what is outside tags.
Why is "Remove script and style content" on by default?
Browser-rendered HTML hides <script> JavaScript and <style> CSS from view. If you only strip the opening and closing tags but keep the content between them, you get pages of JavaScript or CSS text in your output. Removing the content of these blocks gives you the user-facing text. Turn it off only if you genuinely want the raw script or style source.
What does "Decode HTML entities" do?
HTML uses entity references like &amp; for &, &quot; for ", &lt; for <, and &#8217; for an apostrophe. If you only strip the angle-bracket tags, these entities stay as the literal &amp; in your output. Decode HTML entities converts them to the real character. The tool handles named entities (&amp;, &nbsp;, &mdash;), numeric entities (&#8217;), and hex entities (&#x27;).
How is this different from just looking at the rendered web page?
The rendered page hides tags but keeps layout: links are clickable, images are visible, lists are bulleted. This tool gives you the underlying text as a plain string, with no markup at all. Use it when you need the text for a different format (a plain-text email, a database field, a search index, a word count) and the visual layout does not matter.
What about <br> and <p> tags, do paragraphs survive?
Yes, when Preserve line breaks from <br> and <p> is on (the default). The tool inserts a newline at each <br> and a double newline before each block-level tag. Turn the toggle off if you want a single continuous string of text with no breaks at all.
Does the tool handle malformed HTML and broken tags?
Yes. The stripper matches any pattern that looks like a tag (anything between < and > on the same line), so unclosed tags, mismatched tags, and tags missing attributes all get removed. Self-closing tags like <br/> and void elements like <img> are handled the same way.
I want to convert text to HTML instead. Is there a reverse tool?
Yes. Use the Text to HTML tool to wrap plain text in <p> tags, convert line breaks to <br>, and escape <, >, and & to their entity equivalents. It is the inverse of this stripper.
I'm pasting scraped HTML and customer support tickets. Are any of these stored on your end?
No. The tag strip runs in your browser using JavaScript regex. The raw HTML you paste and the cleaned plain text output both stay on your device. We don't log the input, the output, or anything in between.
More wordcounter.ai tools
Other tools you might find useful.