Remove HTML Tags

Strip HTML tags from text.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Paste HTML and press Run to delete the tags, leaving the text between them. It is a quick strip, not a full HTML parser.

How to use

1
Step 1
Paste the HTML into Input.
2
Step 2
Press Run.
3
Step 3
Copy the plain text.

How it works

HTML comments and anything that looks like a tag (< followed by a letter or /, up to the next >) are removed; a stray < followed by a space, as in 1 < 2, is left alone. The text inside script and style elements stays because only the tags around it are deleted, and entities such as &amp; or &nbsp; are left as written.

Worked example

A snippet with a script

Input
<p>Hello <b>world</b> &amp; <script>alert(1)</script>bye</p>
Output
Hello world &amp; alert(1)bye
Walkthrough
All tags disappear. The entity &amp; and the script body alert(1) are kept.

Limitations

  • Does not remove the contents of script or style tags.
  • Does not decode HTML entities.
  • A < directly followed by a letter, such as a<b, is read as the start of a tag.

Questions

How do I strip HTML tags from text?
Paste the HTML and press Run.
Why do I still see &amp;?
Entities are not decoded. Replace them by hand or with Find and Replace.
Will it remove JavaScript?
It removes the script tags but leaves the code between them.

Features

  • Deletes anything in < >
  • Fast plain-text strip
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • HTML Crash Course For Absolute Beginners

    Traversy Media

    Text on the web often starts as HTML you clean or count.

    Watch on YouTube
  • CSS Flexbox Crash Course

    freeCodeCamp.org

    Case and spacing tools show up constantly in front-end copy.

    Watch on YouTube