HTML, CSS & JavaScript Playground
About this tool
About HTML, CSS & JS Playground
Try out an idea, reproduce a bug or teach a concept without setting up a project. Type HTML, CSS and JavaScript into their own tabs, or start from one of 25 starter templates, such as a landing page, pricing table, login form, tabs, modal, to-do app, quiz or table-based email signature, and the preview rebuilds a moment after you stop typing. Everything your script sends to console.log, console.warn, console.error or console.table shows up in the console panel under the preview, along with uncaught errors and rejected promises and the line they came from, so you don't need DevTools open. Switch the layout between side by side, stacked and preview only. The preview runs in a sandboxed iframe with its own isolated origin, so the code you write can't read this site's cookies or storage. Your work is saved in this browser between visits, and Download .html bundles all three parts into one file you can open anywhere. Nothing is uploaded, shared or stored on a server. Optional AI help writes or changes the HTML, CSS and JavaScript from a description, using your own AI key.
Built and maintained by Abhi JainUpdated
How to Use the Playground
- 1
Write your code
Use the HTML, CSS and JS tabs, or click Templates to start from a working example.
- 2
Watch the preview
With Auto-run on, the preview updates as you type. Otherwise press Run or Ctrl/Cmd + Enter.
- 3
Check the console
Logs, warnings and uncaught errors appear in the Console panel. Click Clear to empty it.
- 4
Save your work
Pick a layout that suits your screen, then click .html to download a single self-contained file.
HTML, CSS & JS Playground: questions and answers
Is it safe to run JavaScript here?
Yes. The preview is a sandboxed iframe that allows scripts, forms and alert dialogs but not allow-same-origin, so your code runs in an isolated origin. It cannot read this site's cookies, local storage or page, and nothing is sent to a server.
Can I use npm packages or external libraries?
You can add a <script src> or <link> tag pointing to a CDN in the HTML tab and the preview will load it like any web page would. There is no npm install or bundler; for build steps use a local project.
Why doesn't my console.log show up?
Make sure the Console panel is shown and that the code actually runs: with Auto-run off, press Run. Syntax errors stop the whole script, and they appear in the console as an uncaught error with a line number.
Is my code saved?
Your latest code is saved in this browser's local storage so it is still there when you come back. It never leaves your device. Use the .html download to keep a copy or share it.
Are there starter templates?
Yes. Click Templates to browse 25 working examples grouped as pages, components, forms, apps, effects and email, each with a live thumbnail. Picking one fills all three tabs; Undo restores your previous code. They use plain HTML, CSS and JavaScript with no libraries or external files, and you can also paste a complete HTML document of your own.
Can AI write the code for me?
Yes, optionally. Connect your own AI key in AI settings, click AI and describe what to build or change. Your current code and the description are sent from your browser to your provider, and the answer goes into the three editors when you click Put in the editors.
Ready-made HTML, CSS & JS Playground presets
Related Tools
- HTML FormatterBeautify messy HTML with clean indentation, or minify it for production.
- CSS FormatterBeautify minified CSS into readable rules, or minify it safely.
- JavaScript FormatterBeautify minified JavaScript, or minify it safely by removing comments and whitespace.
- HTML to PDFTurn HTML into a PDF with your browser's print engine: page size, margins, no upload.
- JSON FormatterBeautify, minify and validate JSON with exact error locations, without changing a single value.