Remove HTML Tags from Text

Turn a block of HTML into readable plain text. Paragraph breaks are kept, entities are decoded, and scripts and styles are discarded.

Parsing, not pattern matching

The obvious way to strip HTML is to delete everything between angle brackets. It works on tidy markup and fails on everything else — an attribute containing a >, an unclosed tag, a comment containing markup, or a <script> block whose contents are left behind as visible gibberish.

This tool hands your input to the browser's own HTML parser instead, the same engine that renders pages, and then reads back the text. Malformed markup is handled the way a browser would handle it, and the result is what a reader would actually see.

Structure is preserved

Naively extracting text collapses everything into one long line, because HTML uses tags rather than newlines for structure. Here, block-level elements — paragraphs, headings, list items, table rows, <br> — become line breaks, so a stripped article still reads as paragraphs and a stripped list still reads as a list. Runs of blank lines are collapsed to one so the result does not end up full of gaps.

<script>, <style> and <noscript> blocks are removed entirely. Their contents are code, not content, and leaving them in is the most common flaw in simple HTML strippers.

Entities are decoded

Stripping tags without decoding entities leaves you with &amp; where an ampersand should be and &nbsp; where a space should be. Both are decoded here, so the output is genuinely plain text rather than half-decoded HTML.

The two inverse operations

Escape HTML does the opposite job: it converts <, >, & and quotes into entities so that a snippet of code can be displayed on a page as text rather than being interpreted as markup. This is what you need when you want to show an HTML example inside an HTML document.

Unescape entities converts them back. It is the fix for text that has been escaped twice somewhere in a pipeline and now shows &amp;lt; to your readers.

On safety: the parsing here does not execute scripts or load external resources, so pasting untrusted HTML is safe. Do note that escaping for display is only one part of preventing injection attacks — server-side handling matters just as much.

Frequently asked questions

Will the paragraph structure survive?

Yes. Paragraphs, headings, list items, table rows and line breaks are converted into newlines, so the plain-text result keeps the shape of the original document instead of collapsing into one line.

What happens to JavaScript and CSS in the page?

Script, style and noscript blocks are removed completely rather than having their contents dumped into the output, which is what most regex-based strippers do.

Are HTML entities converted back to characters?

Yes. &amp; becomes &, &nbsp; becomes a normal space, and so on, so the output is genuinely plain text.

Is it safe to paste HTML from an untrusted source?

Yes. The markup is parsed in an inert document that does not execute scripts or load external resources, and nothing is sent anywhere.