HTML Cleaner / Sanitizer: Clean and Sanitize HTML Online
The HTML Cleaner / Sanitizer removes Word and Office-specific markup, scripts, event-handler attributes (on*), inline styles, redundant spans, and empty elements from pasted HTML. You can optionally sanitize the result using a DOMPurify allowlist of tags and attributes. A live sandboxed preview helps you inspect the cleaned HTML before copying it for reuse.
HTML Cleaner / Sanitizer is a browser-based tool for cleaning HTML and removing common unwanted markup. Use it to clean HTML online, including content copied from Word or Office applications, and inspect the result in a live sandboxed preview before copying it for reuse.
The cleaner removes Office-specific markup such as mso- styles, o:p, v:shapes, and conditional comments. It also strips scripts, event-handler attributes (on*), inline styles, redundant spans, and empty elements. If you want to restrict the cleaned markup further, you can optionally sanitize it using a DOMPurify allowlist of tags and attributes.
HTML uses tags and attributes to describe structured content, while copied rich text can include extra formatting and application-specific markup. Cleaning this content can make it easier to reuse in another editor or in a field that rejects formatting. The tool retains HTML as its working format, and its preview gives you a way to inspect the cleaned result before copying it.
The HTML Cleaner / Sanitizer runs entirely in your browser: your input is processed on your device and is not uploaded, stored, or sent to a server. It works offline after the page has loaded, so you can clean HTML without a connection. Developers, content teams, and DevOps engineers can use it to prepare pasted HTML for reuse, review, or a workflow that requires cleaner markup.
Step 1: Paste or drop your HTML content into the tool. It accepts HTML, including content copied from Word or other Office applications.
Step 2: Run the clean-up to remove Word and Office markup, scripts, event-handler attributes, inline styles, redundant spans, and empty elements.
Step 3: Optionally sanitize the HTML with a DOMPurify allowlist of tags and attributes. This lets you apply the available tag and attribute restrictions to the result.
Step 4: Review the cleaned result in the live sandboxed preview. Check that the content looks as expected before reusing it.
Step 5: Copy the cleaned HTML for use in another field, document, or project.
Use case: Remove Word and Office markup before reusing copied content on a website. Cleaning mso- styles, o:p elements, v:shapes, and conditional comments can make the HTML less cluttered.
Use case: Turn pasted rich content into plain text or simpler HTML for reuse elsewhere. The cleaner removes inline styles, redundant spans, and empty elements.
Use case: Prepare content for a form field or editor that rejects formatting. Removing unwanted markup can help you provide cleaner HTML.
Use case: Clean up an HTML snippet that includes scripts or event-handler attributes before reviewing or reusing it. The tool strips scripts and on* attributes from the cleaned result.
Use case: Apply a DOMPurify allowlist when you want the cleaned HTML restricted to permitted tags and attributes. This is useful when preparing content for a workflow with specific markup requirements.
Use case: Inspect cleaned HTML in the live sandboxed preview before copying it into a project. This helps you review the visible result after cleanup.