Developer tools · free · no signup

HTML Viewer & Editor

Edit HTML beside a sandboxed live preview without executing pasted scripts. Your work stays on this device whenever possible.

Free to useNo accountClear results
Preparing tool…
Simple, transparent workflow

How to use HTML Viewer & Editor

  1. Type or paste markup into the "HTML" box; a starter page with a Hello heading and one paragraph is loaded.
  2. Watch the "Sandboxed preview" frame beside it, which re-renders after every keystroke without a run button.
  3. Press "Format HTML" to re-indent the source with two spaces per nesting level.
  4. Read the notice under the panes; it changes to say when script elements were stripped from the preview.
  5. Press "Reset sample" to bring back the starter page after experimenting.

Worked example

Replace the source with <h1>Sale</h1><p onclick="alert(1)">Today</p><script>alert(2)</script>. The preview shows the heading and paragraph, the script element is replaced by a comment, the notice says script elements were removed, and clicking the paragraph does nothing. Pressing "Format HTML" then puts h1, its text and its closing tag on separate indented lines.

When to use this tool

  • Testing how a newsletter snippet renders before pasting it into an email tool.
  • Cleaning up a minified block of markup so its nesting becomes readable.
  • Checking safely that pasted third-party HTML displays without executing its scripts.

Important limitations

The preview intentionally blocks scripts and does not reproduce a full production origin, build system, server, CSP, or external application state. Test final code in its real environment.

Frequently asked questions

Why will my JavaScript not run?

Two layers stop it. Script elements are swapped for a comment before rendering, and the frame has an empty sandbox attribute, which also disables popups, form submission and navigation. The editor is meant for checking markup and CSS only.

Do inline handlers such as onclick work?

The regex removes only script elements, so an onclick attribute stays in your source, but the sandbox stops it from running. Images and external stylesheets with reachable absolute addresses still load in the preview.

What does Format HTML do to inline text?

It places every tag and every run of text on its own line, indented by depth. That shows structure well but adds whitespace inside inline elements and pre blocks, which can shift rendering slightly, so avoid it on whitespace-sensitive content.

Can the preview use my site's files?

No. The frame is built from the text you typed and has no base address of your site, so relative links and image paths will not resolve. Use full URLs when you want external assets to appear.

Does it validate the HTML?

No. The browser's forgiving parser draws whatever it can, and unclosed or misnested tags produce no warning. Run a separate validator when standards conformance matters.