HTML Viewer

Preview HTML safely inside a sandboxed iframe.

Paste or load HTML and see it rendered right next to the editor, inside a sandboxed frame that is kept separate from the site. Scripts are off unless you switch them on. It is a quick way for developers to test snippets, email markup or layouts without creating a file.

What is a sandboxed iframe?

An iframe embeds another HTML document inside a page. The sandbox attribute puts the embedded document under strict restrictions: with an empty sandbox value it cannot run scripts, submit forms, open popups, navigate the parent page or access the parent's cookies and storage, and it is treated as coming from a unique origin. Individual permissions can be added back by listing tokens, such as allow-scripts to let JavaScript run. This tool feeds your HTML to the frame through the srcdoc attribute, so the markup is shown as its own document and is never inserted into the surrounding page. That makes it a reasonably safe way to preview markup you did not write.

How to use HTML Viewer

  1. Add HTML Type or paste into the HTML editor, or load an .html file.
  2. Choose script mode Leave Allow scripts in preview unticked for safe viewing, or tick it to let JavaScript run in the frame.
  3. Read the preview The Preview pane shows the rendered result and updates as you edit.
  4. Clear Use the clear button to empty the editor and start again.

Frequently asked questions

Is it safe to preview untrusted HTML?

Scripts are blocked by default and the page runs in a sandboxed iframe, so it cannot touch this site. Even with scripts allowed the frame stays isolated, but only run code you understand.

Why does my script do nothing?

Scripts are off by default. Tick Allow scripts in preview and the frame reloads with JavaScript permitted.

Can the previewed page load images and stylesheets?

Resources referenced by absolute URL are requested by the browser as usual. Relative paths do not resolve because the frame is a standalone document without a base location.

Can it open links or submit forms?

No. The sandbox blocks form submission and popups, and navigation is restricted, so links and forms do not behave as on a normal page.

Does it validate or format my HTML?

No. It renders whatever the browser can parse, and browsers are forgiving about errors. It does not report problems or reformat the code.