HTML Playground
A three-pane editor for HTML, CSS and JavaScript with a live preview that re-renders as you type. The preview runs in a sandboxed iframe without same-origin access, so your code can never touch this site — and the Download button stitches the three parts into a single, self-contained .html file. Everything happens in this tab.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
HTML / CSS / JS
StableType in the three panes and the preview updates as you go. The preview runs in a sandboxed iframe without same-origin access, so your code can never touch this site — and Download stitches the three parts into one self-contained .html file.
Options
Leave empty to use playground.html.
How it works
What it does
The playground gives you three panes — HTML, CSS and JavaScript — and a live preview beside them. Every keystroke schedules a re-render (debounced, so a burst of typing triggers one refresh), and the three parts are stitched into a single document that the preview loads. There is no build step: your CSS lands in a style element and your script in a script element exactly as written.
How the preview is sandboxed
The iframe is declared with sandbox="allow-scripts" and deliberately without allow-same-origin. That puts the running code in a unique, opaque origin: it can execute and style its own document, but it cannot read this site’s storage, cookies or DOM, and it cannot reach back into the parent page. The preview also sends no referrer.
Downloading and reusing the result
Download .html assembles the same document you see in the preview into one self-contained file. Your markup goes in the body, your styles in a style block and your behaviour in a script block, with nothing pointing off-page, so the file opens and works on its own — offline, from a USB stick, or in any browser.
What it does not do
There is no bundler, no transpiler and no framework support: the preview runs the plain HTML, CSS and JavaScript you type. Scripts run after the body has been parsed, so DOM lookups work without a load listener. A closing tag inside a JavaScript string is neutralised so it cannot break out of the template; otherwise CSS and JS are never escaped — the sandbox, not escaping, is the security boundary.
Questions
Can the preview reach this site?
No. The preview runs in an iframe that deliberately omits allow-same-origin, so it sits in a unique, opaque origin. It cannot read this page’s storage, cookies or DOM, and it cannot fetch anything from this domain.
Does anything leave my device?
No. Your HTML, CSS and JS are only ever rendered in the iframe inside this tab. The Download button assembles them into a file on your device; nothing is uploaded or stored.
What is in the downloaded file?
One self-contained .html document. Your HTML goes in the body, your CSS in a <style> tag and your JavaScript in a <script> tag, so the file works on its own with no other assets or references.
My script has </script> in a string — does it break?
No. The template neutralises a closing </script> inside your JavaScript so it cannot break out of the <script> tag and execute outside the document. The document is stitched safely either way.
Related tools
See categoryHTML to JSX
Convert an HTML snippet to JSX: class→className, for→htmlFor, void tags self-close, indented.
HTML Prettifier
Beautify HTML output — indented tags, one attribute per line for long tags, preserved text.
Code Beautifier
Beautify JS, TS, CSS, SCSS, Less, HTML, Vue, JSON, Markdown and YAML with Prettier, in your browser.
.dockerignore Generator
Build a .dockerignore for a lean Docker build context — pick a stack preset and add custom lines.