HTML Tag Remover – Turn Markup Into Clean, Readable Text
Copy anything out of a CMS, an email template, a scraped page or a rich-text editor and you rarely get text. You get a soup of <div>, <span>, inline style attributes, entities and script blocks wrapped around a few sentences you actually wanted. The HTML Tag Remover strips that markup away and hands back the readable content — as flat plain text, as a structured layout that keeps headings and lists, or as sanitised HTML reduced to a tag whitelist.
Why a regular expression is not enough
The classic one-liner, text.replace(/<[^>]*>/g, ""), fails on real documents. It stops at the first > it finds, so <div title="a>b"> leaves b"> stranded in your text. It cannot tell that the JavaScript inside a <script> element is not copy, so your output ends up containing analytics calls. It has no idea that </p> should become a paragraph break while </span> should not, and it never decodes entities, so Tom & Jerry survives untouched. This tool uses a real scanner that tracks parser state instead, which is why nested elements, unquoted attributes, self-closing tags and unclosed tags all come out correctly.
The seven cleaning modes
Strip All returns only the visible text. Structured preserves the reading layout — headings sit on their own line, paragraphs are separated by a blank line, <li> becomes - item, <blockquote> is prefixed with > and tables become tab-separated rows you can paste into a spreadsheet. Keep Tags is a sanitiser that keeps only the tags you whitelist. Remove Tags is the inverse: it deletes named elements together with their contents, which is the fastest way to lift an article out of a scraped page by dropping nav, aside and footer. Extract Links harvests every href, src and alt into a numbered reference list so no URL is lost. Decode Only leaves the markup alone and converts entities. Batch splits the input on a delimiter line and cleans each block independently.
Tags, entities and attributes
A tag is structure: <p>says "a paragraph starts here". An entity is an escape code for a character the source could not write directly — & for &, ’ for a curly apostrophe, for a non-breaking space. Stripping tags without decoding entities leaves visible gibberish, which is why decoding is on by default. Non-breaking and zero-width spaces are separately normalised to ordinary spaces, because they are the usual reason a word count or a database import behaves strangely after a paste from Word.
Sanitising user-submitted HTML
Keep Tags mode always strips every on* event handler, style attributes, and href or src values beginning with javascript:, vbscript: or data: — even if you explicitly list them in the attribute whitelist. Those are the classic cross-site scripting vectors, and a whitelist that admits them is not a whitelist.
Reading the statistics
The reduction ring shows what share of the characters were markup rather than content. Sixty to ninety-five percent is normal for a real web page, and the tag frequency bars usually explain why: a document that is forty percent <span> is a WYSIWYG export wrapping every styled run in its own element. The stats strip also reports words, lines, entities decoded, comments removed, script and style blocks dropped, and a reading-time estimate at 200 words per minute — a far more honest word count than one taken over raw source.
Malformed markup
Real-world HTML is rarely well formed. Unclosed <div> elements, mismatched closing tags and tags missing their final angle bracket are all reported as non-blocking warnings, and the tool still produces a best-effort result rather than refusing to run. The Removed view shades every span the cleaner discarded, so you can confirm that a warning is harmless before you trust the output.
Practical workflows
Use Structured with tab-separated tables to move a pricing page into a spreadsheet. Use Strip All with line breaks turned off to flatten an HTML field into a single-line CSV cell. Use Extract Links before an SEO audit to see every anchor and its text in one table. Use Batch when you have exported a column of HTML values from a database and need them all cleaned in one pass.