Stripping Options

Only works if "Remove HTML Tags" is enabled.

About the HTML Stripper Tool

We built the HTML Stripper to be a powerful and flexible tool for cleaning up your code. It allows you to remove unwanted HTML tags, specific attributes like classes and IDs, comments, and even entire blocks like <script> or <style> tags. The best part is the whitelist feature, which lets you strip all tags except for a specific list you want to keep. This is perfect for cleaning up rich text content while preserving basic formatting.

How to Use the Tool

  • Paste your code into the "Input HTML" editor on the left.
  • Use the toggle switches in the "Stripping Options" panel to choose exactly what you want to remove. The output on the right will update in real-time.
  • To keep certain tags (like <p>, <b>, <i>), make sure the "Remove HTML Tags" option is on, and then enter the tags you want to preserve in the "Keep these tags" input box, separated by commas.
  • Use the buttons to copy or download your cleaned-up text.

Frequently Asked Questions

What's the difference between this and a formatter?

An HTML Formatter cleans up the structure and indentation of your code to make it more readable, but it doesn't remove any content. An HTML Stripper, on the other hand, is designed to remove parts of the code. This tool is for when you need to get just the plain text from a webpage, or when you need to sanitize user input by allowing only a few basic formatting tags.

How does the "Keep these tags" whitelist work?

The whitelist feature is very powerful. When the "Remove HTML Tags" option is active, the tool will remove every single tag by default. However, if you enter a comma-separated list of tags into the whitelist input (e.g., `p, b, strong, a`), the tool will intelligently strip all tags except for the ones you listed. This is ideal for cleaning up copied content for a CMS.

Why would I remove attributes like class or id?

When you copy HTML from different sources, it often comes with a lot of `class`, `id`, and `style` attributes that are specific to that original source's stylesheet. These attributes are usually unwanted and can interfere with your own site's styling. Stripping them away leaves you with clean, semantic HTML that you can style yourself.

Is the code I enter private?

Yes, absolutely. This tool is built with JavaScript and runs entirely in your web browser. All the stripping and processing happens on your own computer. Your code is never sent to our servers, ensuring your data remains completely private.

Tools