Skip to content
Toolspire

Text Tools

Strip HTML

Strip HTML is part of Toolspire and is ready as soon as this page loads. Tags are replaced by spaces, then the spaces collapse. Script text that was between the tags is still text. This is not a sanitiser for putting HTML back on a page.

Runs in this tabFreeNo account

On this page

What you can do here

A space where the tag was

Adjacent words survive.

Four entities

amp, lt, gt and nbsp. Other entities are left as the characters you pasted.

Not a browser

Nothing is rendered and nothing is fetched.

The sequence

How to use the Strip HTML

  1. 1

    Paste a fragment

    The sample paragraph should read Hi there.

  2. 2

    Check an ampersand

    & should become &.

  3. 3

    Delete script text you do not want

    The tags go. The words between them stay.

Worth knowing

  • Strip HTML on Toolspire: <p>Hi <b>there</b></p> becomes Hi there.
  • &amp; becomes &, and &lt; becomes <.
  • Tags are replaced with a space, so words do not glue together.
  • A <script> body is not executed, but its text remains if it was in the paste. Delete that text yourself if you do not want it.

Tags out, the words between them stay

Each tag, from < to the next >, is replaced by a space. Entities for amp, lt, gt and a non-breaking space are then turned into the characters they name. The spaces collapse, so a bold word in a sentence does not fuse to its neighbours. This is a text extract. It is not a guarantee that the result is safe to drop back into innerHTML, because a broken tag can leave a < behind.

FAQ

Questions about Strip HTML

Where does Strip HTML run?

Strip HTML runs in this tab on Toolspire. What you type or drop in is not sent to us and is not stored on a server.

What does <p>Hi <b>there</b></p> become?

Hi there.

What happens to &amp;?

It becomes &.

Is script code removed?

The script tags are removed. The text between them stays. Do not treat that as a security filter.

Will it fetch images in the HTML?

No. It only edits the string.

Keep going

Open the full directory

Last updated Report a problem or suggest a feature