Remove HTML Tags

Turns HTML source into plain text by removing the tags and, if you want, converting entities such as & into normal characters. It is useful for pulling readable copy out of a web page, an email template or a content management system export.

Up to 1 MiB.

Options

Also tidies the spaces and line breaks of the HTML source (except inside <pre>).

How to use the Remove HTML Tags

  1. Paste HTML source code into HTML code.
  2. Keep Turn paragraphs, headings, list items and
    into line breaks
    on for readable text, or turn it off to remove tags only.
  3. Keep Decode entities on to turn &amp; into & and &eacute; into é.

Safety

  • The HTML is never displayed, run or loaded: it is read as plain text by a simple scanner. Scripts, styles, templates and comments are removed with their content, and images or links are not fetched.

Limitations

  • This is not a full HTML parser: badly broken markup (for example an attribute with a missing closing quote) may remove more text than a browser would show.
  • Tables become tab-separated text and list items lose their bullets.

Worked examples

Web page fragment

Input

<h1>Welcome</h1>
<p>Hello <b>world</b> &amp; caf&eacute;!</p>
<script>alert("hidden")</script>
<ul><li>One</li><li>Two</li></ul>

Result

Welcome

Hello world & café!

One
Two
Remove tags only

Input

<p>Price: <em>5 &euro;</em></p>

Result

Price: 5 &euro;

Practical uses

  • Getting text from a web page

    A content editor copies HTML source from an old page and wants only the readable words for a rewrite. They paste it into the tool and the tags are stripped, along with any scripts and styles. What is left is plain text that is easy to work from.

  • Cleaning an email template

    A marketer wants a plain-text version of an HTML email. They keep the option that turns paragraphs, headings, list items and line breaks into line breaks. The text stays readable and the layout of the original is still clear.

  • Reading entities as normal text

    A developer's database export contains HTML such as &amp; and &eacute; in product descriptions. They keep Decode entities on while removing the tags. The entities turn into the ordinary characters & and é, so the descriptions read normally.

Privacy: this tool runs entirely in your browser. Your text is not uploaded, logged or saved, and it is never sent to analytics. Maximum input: 1 MiB.