ZapKit

Strip HTML Tags

Paste HTML from a web page, email template or CMS and get the readable text back, with paragraphs and lists still laid out.

What does stripping HTML tags mean?

Stripping HTML removes the markup, the angle-bracket tags like <p>, <strong> and <a href>, and leaves only the human-readable words. You need it when moving content from a website or CMS into a plain-text field, writing the text version of an email newsletter, counting the words in a web article, or feeding page text into another tool.

This tool goes further than deleting tags. It drops the contents of scripts and styles, which aren't text at all, decodes entities, and keeps the structure readable by putting each paragraph, heading and list item on its own line.

How to use the Strip HTML Tags

  1. 1.Paste the HTML

    A snippet or a whole page's source.

  2. 2.Choose the layout

    Keep block elements on separate lines, or collapse everything into one line.

  3. 3.Copy the text

    Entities such as &amp; and &nbsp; are already turned into normal characters.

Example: a sale announcement

An h1, a paragraph with bold text, a link and &amp;, a two-item list and a script tag:

Line 1
Spring sale
Line 2
Save 30% on all shoes & bags.
Lines 3–4
• Free delivery / • Easy returns
Removed
the script and every tag

The text reads exactly as it would on the page, with the &amp; shown as &.

Parsed like a browser, not cut with a regex

Tag-stripping with a regular expression breaks on attributes containing >, comments and scripts. This tool hands the HTML to your browser's parser, removes script, style and template blocks entirely, then reads only the text a visitor would see.

Headings, paragraphs, divs, table rows and list items start new lines, list items get a bullet, and table cells are separated by tabs so a table pastes into a spreadsheet. Keeping link addresses adds each link's URL in brackets after its text, useful for plain-text emails.

Frequently asked questions

Does it run the scripts in my HTML?

No. The HTML is parsed into an inert document; scripts are removed before any text is read and nothing executes.

Are HTML entities decoded?

Yes. &amp; becomes &, &lt; becomes <, &nbsp; becomes a space and numeric entities become their characters.

Can I keep links?

Tick Keep link addresses and each link's URL is added in brackets after its text.

How is this different from copying the page?

Copying rendered text can drag in hidden menus or lose line breaks. Here you control the source and the layout.

More Developer tools