A tiny code playground in your browser
Sometimes you just want to try an idea: check how a CSS rule behaves, test a snippet from a tutorial or show a student how a button event works. This page gives you three boxes, one each for HTML, CSS and JavaScript, and a live preview underneath. As you type, the three parts are assembled into a complete web page and shown in the frame. Press Ctrl+Enter (Cmd+Enter on a Mac) or the Run button to refresh it immediately. When you are happy, download the result as a single HTML file that opens in any browser.
Sandboxed for safety
The preview frame uses the HTML sandbox attribute with scripts allowed but without same-origin access. In practice that means code in the preview runs as if it came from a unique, empty website. It cannot read this site's storage, cookies or page, cannot navigate the top window and cannot submit forms. That is important if you paste code you found online: it can only affect the preview box. The frame also sends no referrer. Your code is never uploaded, and nothing is saved between visits, so copy anything you want to keep or use the download button.
Things to know
- Your JavaScript runs after the HTML, so you can use document.getElementById straight away.
- Pop-up alerts and confirms work in the preview. Opening new windows does not.
- Link tags and script tags that point to other websites will load those resources, as they would on any page, so external libraries can be included if you need them. The playground itself loads nothing from other sites.
- An error in your script appears in the browser's developer console, which you can open with F12 on most desktop browsers.
- Auto-update waits half a second after you stop typing, so the preview does not flicker on every key.
Who it is for
The tool is aimed at learners, teachers and developers who need a quick scratchpad. It is deliberately simple: no accounts, no projects and no build tools. For larger work, a full editor and local development server are a better fit. For formatting or checking data, see the JSON formatter and Markdown to HTML converter.