Ready, runs in your browser
0 chars · 0 words
leave the browser
0 bytes
on the markup you paste
No cap
HTML entities decoded
4 of many

The job

What the Grok strip HTML tool fits into

It sits at the point where markup has to become words. A page source you want the copy out of, an email template, a database column that stored formatted text, an export that wrapped every paragraph in tags.

The work is four rules applied in order, running in the page. Script blocks go with their contents, style blocks go with their contents, everything between angle brackets goes, and four entities are turned back into characters. Nothing is uploaded and nothing is stored.

Afterwards the tool reports how many characters were removed or changed. On a page source that number will be large, and it is a length difference rather than a count of tags.

The output

What you get back, and what you lose

Worth knowing before you paste, because a tag strip is not a conversion and several things you might expect to survive do not.

Kept
All text between tags, and all whitespace that was already in your source. Blank lines are preserved exactly, so three in a row stay three in a row.
Kept
Anchor text. The words inside a link survive, which is usually what you wanted from the copy.
Lost
Link addresses. The href attribute goes with the tag, so a page full of links comes back as a page full of unlinked phrases.
Lost
Structure. Headings, lists, bold and emphasis all become undifferentiated text with no marker of what they were.
Lost
Break and paragraph tags, without leaving a newline behind. If your source was minified onto one line, the output is one line.
Removed entirely
Script and style blocks, contents included. Not every stripper does this, and one that publishes its code says openly that it leaves the JavaScript in place.

The routine

How to strip HTML from a page source in three steps

Three steps, with a verification pass that is not optional if the markup came from a machine.

Step 1
Paste the whole source. There is no character cap here, so you do not need to cut a page into pieces the way a twenty thousand character limit would force you to.
Step 2
Press Strip HTML and copy the result out of the right-hand pane. Clear empties both panes afterwards.
Step 3
Scan the output for leftovers. A stray quote mark, a fragment of an attribute or a closing comment marker means the source had a greater-than sign somewhere a pattern match could not see past.

The detail

Which entities come back as characters

Strippers disagree sharply here. One decodes twenty or more entities including numeric ones. One deletes them outright and points you at a separate decoder. One leaves every entity untouched. This tool decodes four and passes the rest through unchanged.

The four are the non-breaking space, which becomes an ordinary space, the ampersand, and the less-than and greater-than entities, which become real angle brackets. That last pair has a consequence: markup that was safely escaped in your source arrives un-escaped in the output as literal text.

Everything else is untouched and we tested it. The quote entity, the numeric apostrophe and the copyright entity all survive exactly as typed. If your text needs those resolved, that is a second step this tool does not perform.

The straight answer

Can the strip HTML tool sanitize untrusted markup?

No. Treat that as a hard no rather than a caution. The most technically candid stripper in this category says the same of itself, and the reasoning applies identically here.

The specific hazard is the entity step. Escaped markup arriving as text comes out of this tool with genuine angle brackets around it, which is the reverse of what a sanitizer does. Safe input becomes markup-shaped output.

Use this when the destination is a text file, a word counter, a spreadsheet cell or a draft. Use a real sanitizer when the destination renders HTML and the input is not yours.

The failure mode

The cases pattern matching cannot handle

This tool matches tags by pattern rather than building a document tree, which is what every tool in this category does. Each competitor that publishes its mechanism concedes the same limit, one of them using a comparison expression as the example that gets misread as a tag.

We tested ours rather than describing the idea. An attribute value containing a greater-than sign ends the match early, so part of the attribute survives into the output. An HTML comment containing a greater-than sign leaves its closing marker behind.

Hand-written markup rarely trips this. Generated markup, minified templates and anything with inline comparison operators trips it more often, which is why step three exists and why the page does not promise robustness it cannot deliver.

The choice

When a tag strip is the wrong operation

If you need the structure kept, this is not it. Converting headings and lists into Markdown preserves what a strip discards, and that is a separate route on this site rather than a mode on this one.

If you need only the entities resolved and the markup left alone, this is also not it, because tags are removed unconditionally and there is no way to keep them.

If you need whitespace tidied after the strip, that is another route again. This tool leaves spacing exactly as it found it, which is deliberate: a strip that also reflows text makes two changes when you asked for one.

The users

Who uses the Grok strip HTML tool, and when

Content people recovering copy from a system that gave it back wrapped in markup. The words are correct and everything around them is noise.

Developers run it on a field that stored HTML it should not have, or on a fixture they need as plain text. Editors run it before a word count, because a counter fed raw markup counts tag names as words. Support teams run it on email source to read what a customer actually received.

The pattern that disappoints is expecting a document back. What returns is the text that was in the document, in the order it appeared, with nothing to indicate which part was a heading and which was a caption.

FAQ

Everything answered. Running the strip HTML tool

How do I convert HTML to plain text?

Paste the markup, press Strip HTML, and copy the result. Tags are removed and the text between them is kept.

Is it free?

Yes, with no account, no sign-up and no usage cap of any kind.

Does my markup get sent anywhere?

No. The work happens in your browser, so nothing is uploaded and nothing is stored.

Does it strip the JavaScript too?

Yes. Script blocks are removed with their contents rather than just their tags, which not every stripper does.

What about CSS in style blocks?

Removed with its contents in the same way, so no selectors or colour values survive into the output.

Which HTML entities are decoded?

Four: the non-breaking space, the ampersand, and the less-than and greater-than entities. All others pass through unchanged.

Why is a numeric entity still in my text?

Because numeric entities are outside the four this tool decodes. Nothing here resolves them.

Are my paragraph breaks preserved?

The line breaks already in your source are. New ones are not created, so paragraph and break tags disappear without leaving a newline.

Why is my output all on one line?

Because the source was on one line. This tool preserves existing whitespace and does not insert breaks where block tags were.

Is there a character limit?

No. The input field sets none, so a full page source can go in at once.

Can I use this to make untrusted HTML safe?

No. It is a text cleaning step, not a security control, and escaped markup comes back with real angle brackets.

Are comments removed?

Ordinary comments are. A comment containing a greater-than sign leaves a fragment, which pattern matching cannot avoid.

Why did a piece of an attribute survive?

The attribute value contained a greater-than sign, which ends the match early. That case needs a manual fix.

Does it keep link addresses?

No. The anchor tag goes and only the link text remains, so URLs are lost.

Are there modes or settings?

None. One action with one behaviour, unlike strippers built around a list of modes.

Can it output Markdown instead?

No. Headings, bold and lists become plain text here. Markdown conversion is a separate route.

Can I upload a file?

No file input and no download. Paste markup in and copy text out.

Does it tidy the whitespace afterwards?

No, deliberately. Spacing is left exactly as it was found, and reflowing text is a different route.

Does it work on a phone?

Yes. It is a paste-and-press field on a web page with nothing to install.

What does the reported number mean?

The count of characters removed or changed, which is a length difference rather than a count of tags.

Does the source of the HTML matter?

No. The rules match markup rather than authorship, so it behaves the same whatever produced the page.