Skip to content
OnlineToolStudio

Strip HTML Tags

runs in your browserno sign-upfree

Remove HTML tags like PHP strip_tags() — all of them, all except the tags you allow, or only certain tags. Also removes attributes, comments and scripts.

HTML523 chars

About this tool

Strip HTML Tags removes tags from HTML and leaves everything else exactly as it was — your text, spacing and entities. Remove every tag (just like PHP’s strip_tags()), keep only the tags you allow such as paragraphs, bold and links, or remove only certain tags like span and font. It can also drop attributes, comments, empty tags and scripts with their content. For readable plain text with bullets and paragraph spacing, use HTML to Text instead.

How to use

  1. Paste your HTML.
  2. Choose a mode: remove all tags, keep only some, or remove only some — and type the tag names or pick a preset.
  3. Adjust the options: attributes, scripts, comments, empty tags,   and blank lines.
  4. Copy the result or download it.

FAQ

What do the three modes do?

"Remove all tags" leaves only the text, like PHP strip_tags(). "Keep only these tags" removes every tag except the ones you list — for example p, br, b, a. "Remove only these tags" does the opposite: it removes just the tags you list, such as span and font, and keeps the rest. In every mode the text inside the tags stays.

Is this the same as PHP strip_tags()?

With "Tidy blank lines" unticked, "Remove all tags" gives the same result as strip_tags($html) (tidying only trims the leftover indentation and blank lines), and "Keep only these tags" works like strip_tags($html, '<p><a>'). Unlike strip_tags, scripts and styles can be removed together with their content, and attributes can be cleaned on the tags you keep.

How is this different from HTML to Text?

This tool only removes tags and leaves the rest untouched, so the output can still be HTML. HTML to Text reads the page like a browser and produces tidy plain text: line breaks for paragraphs, bullets for lists and decoded entities.

What happens to attributes like style and class?

Choose under Attributes: keep them all, remove style, class, id, data-* and event handlers (onclick…), or keep only href, src and alt so links and images still work.

Is my HTML uploaded or run?

No. Everything happens in your browser, and the HTML is only read as text — scripts never run and images are never loaded.

Related tools

All tools