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.
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
Paste a fragment
The sample paragraph should read Hi there.
- 2
Check an ampersand
& should become &.
- 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.
- & becomes &, and < 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?
What does <p>Hi <b>there</b></p> become?
What happens to &?
Is script code removed?
Will it fetch images in the HTML?
Keep going
Related tools
Last updated Report a problem or suggest a feature