HTML Tools

HTML Viewer

Preview sanitized HTML and inspect the cleaned markup in a safe view.

Best for: Reviewing CMS fragments, Inspecting imported HTML

Quick answer

Paste HTML to see the sanitized result, rendered preview, and extracted links or images without running active scripts.

Overview

HTML Viewer lets you inspect HTML after sanitization and compare the rendered output with the cleaned source. It is useful when you need to confirm what survived filtering, what was removed, and whether the remaining markup still makes sense visually and structurally. The tool is designed for client-side review of pasted markup. You can check anchors, media tags, inline attributes, and validation messages before you move content into a page, email template, CMS field, or exported file.

Use cases

  • Reviewing CMS fragmentsCheck a snippet copied from a content field before placing it into a page layout or template.
  • Inspecting imported HTMLSee which elements remain after sanitizing HTML brought in from another system or export.
  • Checking rich text outputVerify link targets, image tags, and formatting produced by an editor before saving it.
  • Auditing user submissionsExamine markup from comments, profiles, or posts and see whether unsafe parts were removed.

How it works

  1. 1

    Paste HTML into the input area.

  2. 2

    The tool sanitizes the markup locally.

  3. 3

    Review the rendered preview and cleaned source.

  4. 4

    Inspect links, images, attributes, and validation notes.

  5. 5

    Copy the cleaned HTML if it matches your needs.

Examples

Removing an inline script

Input: <p>Read more <script>alert('x')</script><a href='https://example.com/post'>here</a></p>

Output: <p>Read more <a href="https://example.com/post">here</a></p>

The script element is removed while the safe paragraph and link remain.

Stripping a dangerous attribute

Input: <img src='avatar.png' onerror='alert(1)' alt='Avatar'><span>Profile</span>

Output: <img src="avatar.png" alt="Avatar"><span>Profile</span>

Unsafe event handlers are stripped from the image tag.

Cleaning malformed nested markup

Input: <div><strong>Title<p>Body</strong></p></div>

Output: <div><strong>Title</strong><p>Body</p></div>

The viewer shows a cleaned structure so broken nesting is easier to spot.

FAQ

What does the viewer change in my HTML?

It removes unsafe or disallowed parts during sanitization and shows the resulting cleaned markup, so the preview may not match the original exactly.

Why do some attributes disappear?

Attributes that can trigger scripts, inject behavior, or break the allowed output are removed. That includes event handlers and other unsafe values.

Can I trust the preview for final rendering?

Use it as a verification step, not as a replacement for application-side validation. Different environments may allow different elements or attributes.

Why does broken HTML look different after pasting?

The browser and sanitizer both normalize malformed markup. That can change tag order, close tags automatically, or move text into a more valid structure.