Remove HTML Tags from String: Strip HTML Tags from Text

Instantly remove html tags from a string of content with this free online tool. Enter all of the code for a web page or just a part of a web page and this tool will automatically remove all the HTML elements leaving just the text content you want.

This JavaScript based tool will also extract the text for the HTML button element and the title metatag alongside regular text content.

If you need to remove HTML tags then give it a whirl - it works pretty darn well at stripping out those unwanted HTML elements.

Strip HTML from Text String

How to Remove HTML Tags from Text

This is just a bit of a technical note about removing html elements using JavaScript code so if you're not into the technical details then just skip this part and use the html stripper tool above.

Generally it's preferable to use an approach that leverages the DOM in a graceful way to find and remove the HTML content over an approach that just uses Regular Expressions to find and remove HTML tags.

Because you will encounter malformed HTML, the regex approach can fail in spectacular ways so here I tried to leverage the javascript innerText property to get the job done in a more dependable way.

The Problem with Using InnerText to Remove HTML

Using the javascript innertext property to remove HTML tags unfortunately doesn't work exactly how I wanted it too so I had to sweeten the deal with some regular expressions to get the text output I wanted.

The big problem, for me, with using innertext to strip html tags was that it would remove script tags but leave the contents in-between the opening and closing script tag in your text content. It also did the same for style tags in those instances where you might encounter some on page style rules.

Although optional, I also added a regex to make the output more readable by getting rid of excess multiple line breaks. It just made the output format a bit more readable.

Anyways if none of these are deal breakers for you then I would just say use the innerText property to remove html tags from your web content. Otherwise you'll need to use some regex to remove the HTML tags.

Humans Can't Win

HUMANS CAN'T WIN!

An online game only AI can win. Humans... don't even try!
Play the Game >

Frequently Asked Questions

What does this tool do?

This tool removes all the HTML tags from your content and returns only the readable text. It’s useful for extracting plain text from web pages, html-based email templates, or HTML snippets.

Does this remove all HTML tags leaving only text content?

Yes. The tool strips out all HTML tags while keeping the text content inside them, so you’re left with clean, readable and usable text.

Will this affect the words or punctuation in my content?

No, it shouldn't. Only the HTML markup is removed. Your text, punctuation, and spacing remain untouched (aside from any line break formatting that was created by this tool).

When is this HTML stripper useful?

It’s great for cleaning copied content from websites, converting HTML into plain text for documents, emails, or notes, and preparing text for further processing.

Is my HTML sent to a server?

Nope. The tool runs solely in your browser, and your content is not uploaded or stored anywhere.

Find the Right Tool Fast