Remove HTML Tags
Strip HTML tags out of a block of markup to leave the readable text, optionally keeping line breaks.
Everything you type here is processed on your own device. No input is sent to a server, logged, or stored.
What the Remove HTML Tags tool does
The remove HTML tags tool on this page will strip HTML tags out of a block of markup to leave the readable text, optionally keeping line breaks. Paste your text in, pick the options you need, and copy the result straight back out. It is most often used for pulling the readable text out of an HTML email or export. Companion tools to this one live on FreeToolsWorld.org.
How to use it
- Paste the HTML.
- Keep the line-break option on if you want paragraphs and list items separated.
- Collapse whitespace to tidy up the indentation the markup left behind.
- Copy the plain text.
How it works
Script and style blocks are removed along with their contents, because their text is code rather than prose and leaving it in produces nonsense. Everything else keeps its text and loses its tags.
HTML entities are decoded, so & becomes & and becomes a space. That is almost always what you want from a plain-text extraction, and it is one more reason not to treat the output as safe to re-insert into a page.
This is a text-extraction convenience and not a sanitiser. Stripping tags with pattern matching cannot be made safe against hostile or malformed markup, and anything going back into a web page should be escaped rather than stripped. If you are trying to make untrusted HTML safe to display, use a real sanitiser library on the server, not this.
When to use it
- Pulling the readable text out of an HTML email or export.
- Getting a word count on page content without the markup.
- Extracting copy from a template for review.
- Cleaning up text pasted from a web page with formatting.
Common mistakes to avoid
- Using the output as a security measure. This is not a sanitiser.
- Expecting table structure to survive. It does not — tables become lines of text.
- Running it on XML where tag names carry the meaning, which is then lost.
Frequently asked questions
How do I strip HTML tags from text?
Paste the markup in. Tags are removed, entities decoded, and script and style contents discarded.
Is this safe for sanitising user input?
No. Tag stripping by pattern matching cannot be made safe against hostile markup. Use a proper sanitiser library server-side for that.
Does it keep the structure?
Only line breaks, and only if you leave that option on. Headings, lists and tables all flatten to plain lines.