Strip HTML Tags

Paste HTML and get the plain text back. Scripts, styles and comments are removed entirely; you can whitelist tags that should stay.

  • Runs in your browser
  • Free, no sign-up

Comma-separated tag names to keep, e.g. b, i, a

Ctrl + Enter also runs the tool

What this tool gives you

Thorough

Tags, attributes, comments, PHP blocks and the contents of script and style elements are removed.

Allow list

Keep formatting tags such as <b> or <a> while removing everything else.

Safe

Nothing is rendered or executed; the text is processed as a string.

Frequently asked questions

Does it remove the text inside tags?

Only for script, style and comments, where the content is code rather than prose. For every other element the inner text is kept.

How do I specify allowed tags?

Type the names separated by commas or spaces, with or without angle brackets: b, i, a and <b><i><a> both work the same way.

Why are there extra blank lines?

Block elements such as <p> and <div> were separated by newlines in the source. Tick Collapse whitespace to tidy the result.

Is this safe for sanitising user input?

It is good for extracting text, but for HTML you will display again use a proper sanitiser library on the server side.

From APIVoid

Need security checks inside your own product?

APIVoid turns the lookups you run here into developer-friendly JSON APIs: IP reputation, URL status and redirects, DNS lookups, SSL info, domain age, screenshots and much more. Simple pricing, 30-day free trial.