The job
What the strip HTML step does in a cleanup
Markup in, text out. Script and style blocks are removed whole, contents included. Every other tag is deleted and the text between the tags is kept. The transform runs in your browser, so nothing is uploaded and there is no allowance to spend.
Treat it as the first pass rather than the only one. A tag strip is deliberately simple, and simple transforms leave predictable residue. The rest of this page is about what that residue is and what to do with it, because knowing the failure modes in advance turns a two-minute fix into a five-second one.
The run
How to strip HTML tags in three steps
No options to set. The decisions all happen after the output appears.
- Step 1
- Paste the markup. Full documents, CMS fragments and email source all go through the same path, and there is no length ceiling.
- Step 2
- Press Strip HTML. The pass runs locally and the plain text appears immediately.
- Step 3
- Scan the output for the two known residues: sentences that ran together where a block element ended, and entities that came through as text.
What to fix afterwards
The residue a strip HTML pass leaves
Four things to look for, in the order they are likely to bite. None of them is a malfunction, all of them are consequences of how the transform works, and each one takes seconds once you know it is coming.
- Joined paragraphs
- Tags are deleted, not replaced with newlines. Minified markup comes out as one long line, while source with newlines between its tags keeps them.
- Undecoded entities
- Four are decoded: the non-breaking space, the ampersand, less-than and greater-than. A copyright, a euro or any numeric entity arrives as literal text.
- Escaped tags as content
- Decoding happens after stripping, so an escaped tag becomes visible angle brackets in the output rather than disappearing.
- Title text
- Head content is not special-cased, so the text of a title element lands at the top of your plain text and needs deleting by hand.
The big one
Why stripping HTML joins your paragraphs together
This is the one that catches people, and it decides whether you need a second pass. Nothing is inserted where a block element ended. Paste two paragraphs written on one line with no whitespace between the tags and the two sentences arrive welded together.
Whitespace outside tags is left completely alone, which is the saving grace. Markup copied from a file, a view-source panel or a formatted export already carries newlines between its tags and those newlines survive the pass intact. Minified HTML, a database field, or markup pasted out of a single-line log does not. Check which kind you have before you paste, because the fix differs entirely: formatted source needs nothing, minified source needs the paragraph breaks put back by hand.
The second pass
Dealing with the entities a strip HTML pass leaves behind
Four entities are handled here. A competing tool advertises more than twenty named and numeric entities, and another decodes none at all and refers you to a separate decoder. Ours sits between those positions and the page names the four rather than leaving you to discover the gap.
So build the workflow around it. If your source came from a CMS that escapes aggressively, expect a second pass with a dedicated entity decoder after this one. If it came from a hand-written page or an editor export, the four handled here usually cover everything that actually appears.
Asked directly
Can stripping HTML be used to sanitise input?
No, and this is the one place where using the wrong tool has real consequences. A competing tool on this term frames the job around users injecting markup into comment fields. That is a genuine concern and a regex tag strip is not the answer to it.
Deleting everything between angle brackets is not the same as parsing markup, and malformed input is exactly where a regex and a parser disagree. Sanitising belongs inside your application, with a real parser and an explicit allow-list. This transform belongs in a content workflow, where the job is reading a document rather than defending one.
Order of operations
Where the strip HTML step goes in a pipeline
Early. Strip the markup first, because every later cleanup gets easier once there are no tags in the way. A word count run over raw HTML counts the tags. A hidden-character check run over raw HTML has to wade through attributes.
After stripping, the usual next moves are a whitespace pass if the source was minified, an entity decoder if the source was heavily escaped, and a hidden-character check if the text passed through a chat window at any point. Each of those is its own route on this site and each one is local, so the whole chain runs without anything leaving your browser.
In practice
Who strips HTML tags, and on what
Content teams migrating between systems, where an export arrived as markup and the destination wants text. Writers pulling copy out of a CMS field. People moving an HTML newsletter into a document, where every tag is noise.
Developers use it as a fast way to see what a page actually says, which is what the script and style removal exists for. And it is the standard first step before any other text cleanup, because everything downstream is simpler once the angle brackets are gone.