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.

Remove Html Tags From Text Comma Stripper soon Delete Numbers soon Strip Punctuation soon Remove Hyphens soon
Input Load sample
Going the other way?
Use Text to HTML to wrap plain text in <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.

Plain-text email from rich HTML
Many email pipelines need a plain-text alternative version of an HTML email body. Paste the HTML, keep entities decoded and breaks preserved, and you get a clean plain-text variant ready to attach.
Database field from CMS export
CMS exports often ship article bodies as HTML strings. To run word counts, search indexing, or sentiment analysis, you want the underlying text. Strip the tags and decode entities before importing into your database.
Word count of a blog post
Counting words in raw HTML inflates the total because tags and attributes count as characters. Strip the markup first, then run the count on the clean text. See Word Counter.
Sanitize text from a contact form
If a contact form lets users paste rich text, the stored value can contain unwanted markup. Stripping HTML before display prevents broken layouts and removes potential XSS payloads (combine with server-side escaping for full safety).
Search index preparation
A search engine indexing HTML pages will tokenize tag names and attribute values along with body text, polluting results. Strip the tags first so only meaningful content gets indexed.
CSV cell from HTML source
Pasting an HTML article into a spreadsheet cell pulls tags along. Strip the markup, turn breaks off so the result is a single line, and the cell stays clean.
Migration between CMS platforms
When moving content between Wordpress, Ghost, Notion, and similar tools, each platform handles HTML slightly differently. Stripping to plain text gives a portable intermediate format you can re-format in the destination.

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).

ToggleWhat changesDefault
Remove all tagsMaster switch. Off means the tool only runs the other toggles (entity decode, comment removal, script and style content).On
Keep text inside tagsOn: text between <p> and </p> survives. Off: text gets dropped along with the wrapping tags.On
Decode HTML entitiesConverts &amp;, &nbsp;, &mdash;, &#8217;, &#x27; to the real characters.On
Remove HTML commentsDrops <!-- ... --> blocks before any other processing.On
Remove script + style contentDrops 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 breaksInserts 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.

Browse the full catalog →