Render a user-provided HTML fragment in an isolated, sandboxed preview while exposing the source and safety boundaries.
Loading tool
About HTML Preview
Paste an HTML fragment or full document and render it in a sandboxed iframe that has no access to this page, its cookies or storage. Scripts and form submission are blocked by default and can be enabled with switches; you can preview at mobile (375px), tablet (768px) or full width. The source is also parsed locally to count elements, scripts, inline event handlers, stylesheets, external resources, links, images and forms.
Common uses
- Preview an HTML email or snippet without saving it to a file
- Inspect untrusted HTML safely with scripts disabled
- Check how a component looks at phone and tablet widths
- Count inline event handlers and external resources in a pasted page before using it
FAQ
- Is it safe to preview untrusted HTML here?
- The HTML is rendered in an iframe with the sandbox attribute, which gives it a unique origin so it cannot read this site's cookies, storage or DOM. Scripts only run if you turn on 'Allow scripts', and even then they stay inside the sandbox.
- Why don't my scripts or onclick handlers work?
- Script execution is off by default. Enable 'Allow scripts' to add allow-scripts (and allow-modals) to the iframe's sandbox attribute.
- Can I load external CSS or images?
- Yes, absolute URLs to stylesheets, images and fonts load normally inside the preview; the stats panel counts how many external resources the document references.