HTML/CSS/JS Sandboxed Live Runner

Testing an email template or a button style? Paste your HTML (CSS + JS included), watch it render live — nothing is uploaded, the preview runs in a sandboxed iframe.

Embed this tool on your website / blog No code required · Copy and paste
HTML Embed Code (iframe):
<iframe src="https://lucentool.com/html-preview" width="100%" height="650" style="border:1px solid #e5e0d8;border-radius:12px;max-width:850px;width:100%;" frameborder="0"></iframe>
<div style="font-size:12px;color:#78716c;margin-top:6px;font-family:sans-serif;">Powered by <a href="https://lucentool.com/html-preview" target="_blank" style="color:#c85a32;text-decoration:none;">Lucentool - HTML/CSS/JS Sandboxed Live Runner</a></div>

What this is for

Sandbox notes

For full-page previews with responsive widths, resize your browser window — the iframe scales with it. Pair with the Markdown Editor when you're drafting content rather than markup.

What happens in the page

render() takes the markup from the editor and writes it into an iframe through srcdoc, with a sandbox attribute attached. That combination is the whole design: the preview runs in its own document context, so scripts inside it cannot reach this page, cannot read its storage and cannot navigate the parent. Re-rendering only replaces the srcdoc, so nothing outside the frame is rebuilt.

Where it breaks down

Sandboxing cuts both ways: popups, top-level navigation, same-origin storage and some autoplay behaviour are blocked, which is why code that works locally can fail here. External images, fonts and stylesheets need a network connection. Invalid markup is not rejected — the browser repairs it and you see the repaired result. Nothing is saved, so a refresh loses the draft.

Privacy: no data leaves this tab

The preview runs in a sandboxed iframe with its own document context; your markup is never uploaded, and the frame cannot read this page’s data either.

Frequently asked questions

Can I run JavaScript in the preview?

Yes, but inside the sandbox: no popups, no top-level navigation, no access to the parent page or its storage.

Why are my images missing?

Either the URL is relative (the frame has its own document, so there is no matching file) or the host blocks hotlinking. Use absolute URLs.

Is my code saved?

No. There is no storage call; copy the markup out before closing the tab.