Remove Inline Styles

Please log in or register to do it.

This tool cleans your HTML by removing inline styles, allowing you to simplify or sanitize your markup. You can choose to completely strip out all style attributes from your elements, remove only specific CSS properties while preserving others, or selectively retain only a whitelist of allowed style declarations.

Processing Modes:


Completely strips out the entire style attribute from all elements.

Removes only the specified CSS properties from inline styles, preserving the rest.

Removes all inline style declarations except for the ones you explicitly allow.

Examples:

Remove All Inline Styles

Completely removes the style attribute from every element.

Before:
<p style="color:red; font-size:16px;">Hello <strong style="font-weight:bold;">World</strong></p>
After:
<p>Hello <strong>World</strong></p>

Remove Only Specific CSS Properties

Removes only the specified properties (e.g., "color") from inline styles.

Before:
<p style="color:red; font-size:16px;">Hello <strong style="color:blue; font-weight:bold;">World</strong></p>
After (removing "color"):
<p style="font-size:16px;">Hello <strong style="font-weight:bold;">World</strong></p>

Remove Inline Styles Except Allowed Properties

Retains only the allowed CSS properties (e.g., "font-weight") in inline styles.

Before:
<p style="color:red; font-size:16px;">Hello <strong style="color:blue; font-weight:bold;">World</strong></p>
After (allowing "font-weight"):
<p>Hello <strong style="font-weight:bold;">World</strong></p>
Remove JavaScript from HTML
Remove HTML Comments

Your email address will not be published. Required fields are marked *