Skip to content

Strip HTML Tags

Delete every tag from a piece of HTML and keep only the text, with your choice of line breaks and entity decoding.

Processed locally in your browser

Options
0 chars · 0 lines
The result will appear here.

What is Strip HTML Tags?

Stripping tags is the quick way to get the text out of markup copied from a web page, a CMS field or an e-mail. Unlike a full HTML-to-text conversion, it keeps your text as it is and simply removes the <tags>, comments and, optionally, script and style content.

With "keep line breaks" on, <br>, paragraphs, divs, list items and headings are replaced by a newline so lines do not merge. HTML entities such as &amp; and &eacute; can be decoded, and the tidy option trims each line and collapses runs of blank lines.

How does it work?

  1. Paste the HTML into the input box.
  2. Leave "keep line breaks" on to separate block elements, or turn it off to join everything.
  3. Choose whether entities are decoded, script and style content is removed and lines are tidied.
  4. Copy or download the plain text.

Common use cases

  • Getting the plain text of a description copied from a product page.
  • Cleaning a CMS export before counting words or checking spelling.
  • Removing markup from a database field that should have been plain text.
  • Reading the text of an HTML e-mail without the styling code.

Examples

Try this input in the tool above:

Input
<div class="card">
  <h2>Caf&eacute; &amp; Th&eacute;</h2>
  <p>Open <b>daily</b> from 8&nbsp;am.<br>Free Wi-Fi.</p>
  <style>.card { color: red }</style>
  <script>track("x")</script>
  <!-- internal note -->
</div>
Output
Café & Thé

Open daily from 8 am.
Free Wi-Fi.

Privacy

Strip HTML Tags runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

This is a text-extraction tool, not an XSS sanitizer: do not use it to make untrusted HTML safe, and without line breaks the text of adjacent table cells can run together.

Frequently asked questions

How is this different from HTML to Text?

Stripping only deletes tags and keeps the text as written. HTML to Text also builds structure: bullets for lists, "text (url)" for links, blank lines between paragraphs and tabs between table cells.

Can I use it to sanitize user input?

No. Removing tags with a tool is not a reliable defense against cross-site scripting. Sanitize on the server with a dedicated library and encode output for its context.

Which entities are decoded?

A common set of named entities (&amp;, &lt;, &nbsp;, &eacute;, &euro;…) and every numeric entity such as &#233; or &#x1F600;. Rare named entities are left as they are.

More tools in Developer Tools →