Copy text from a web page, an email template or a CMS export and you usually get the scaffolding along with the words — tags, attributes, class names, sometimes whole navigation menus. Before you can count the words, check the frequency or feed it to a translation tool, you need the plain text that was inside the markup.
That cleaning step is what stripping HTML does: remove the tags, keep the words.
What stripping actually removes
A proper strip does more than delete anything between < and >:
- Tags and attributes — the markup itself, including link destinations and class names.
- Script and style blocks — the code inside them is removed entirely, not just its tags.
- Character references —
&becomes&, becomes a space. Plain text with&scattered through it is not plain text at all.
What it deliberately does not do is preserve presentation. Bold, colours and layout are properties of the markup — and the markup is what you asked to remove. Paragraph and heading breaks become newlines, so the text stays readable.
A worked example
Input:
<p>Hello <strong>world</strong>, the sale ends <a href="/offer">on Friday</a>.</p> Output:
Hello world, the sale ends on Friday. Notice the link text survives — "on Friday" — but the address it pointed to does not. Text is content; a URL is an attribute, and attributes are stripped with the tags. If a page's value is in its links, save them before you strip.
Three mistakes that ruin a strip
- Stripping a whole page and drowning. Paste an entire page's source and the text of menus, footers and cookie banners comes along with the article. Strip the relevant fragment — or expect a cleanup pass afterwards.
- Losing structure in lists and tables. Tags carry the structure of lists and tables; remove them and the items can run together. Add your own line breaks back where the meaning depended on the layout.
- Assuming scripts vanish politely. Text inside a script or style block is technically "text content" in a page's code. If you paste raw page source rather than copied content, expect some code-flavoured leftovers to delete by hand.
The free tool I built
I make BulkTextKit — 15 free text tools that run 100% in your browser, nothing uploaded. The Strip HTML Tags tool is the one I open for this job: paste your HTML, click Strip HTML, copy the clean plain text. Scripts, styles, tags and entities are removed while paragraph breaks are preserved.
Two places it pays off immediately: chain it first, then Word Counter gives you the true length of a web article and Word Frequency shows what the page is really about under its design — and stripping an email template produces the plain-text version every good email also needs for accessibility and spam filters.
One line on Pro: BulkTextKit Pro ($19 one-time, no subscription) adds Bulk mode — strip HTML from up to 50 pages at once instead of doing them one by one.
What is the messiest HTML you have ever had to clean by hand — and what was hiding in it?
