HTML, CSS & JS Playground

Write HTML, CSS and JavaScript and see the result live, with a console for logs and errors. Runs privately in your browser.

Runs in your browser. Nothing is uploaded.

Result

Console

    Your code runs in an isolated frame on this page. It can’t read this site’s data, and requests to other websites are blocked, so load libraries by pasting them in rather than from a CDN.

    How to use the HTML, CSS & JS Playground

    1. Type HTML, CSS and JavaScript in the three tabs, or press Load example.
    2. The result appears on the right as you type. Untick Run as I type to run only when you press Run or Ctrl + Enter.
    3. Read console.log output, warnings and errors in the Console under the preview.
    4. Drag the bottom edge of the preview to make it taller.
    5. Press Download .html to save everything as one file you can open anywhere.

    A scratchpad for the web

    Sometimes you just want to try something: check how a CSS property behaves, test a bit of JavaScript, build a small demo for a colleague, or learn by changing code and watching what happens. Setting up a project with files, a server and a browser tab for that is overkill. This playground gives you three editors and a live preview on one page, ready the moment it loads.

    How it works

    Write HTML in the first tab, styles in the second and scripts in the third. The page combines them into a complete document and shows it in the preview frame, updating a moment after you stop typing. Each editor has syntax colouring and line numbers, and your work is remembered in this browser.

    The Console shows what your script logs with console.log, console.warn and console.error, including objects and arrays, plus uncaught errors with their line numbers and rejected promises. It is a quick way to debug without opening the browser’s developer tools, and it works on phones and tablets too.

    Private and isolated

    Your code never leaves your device. The preview runs inside a sandboxed frame: it has its own isolated origin, can’t read this site’s data, and can’t send requests to other websites. That also means scripts and stylesheets from CDNs won’t load. For small libraries, paste the code into the JavaScript tab.

    Take it with you

    Download .html saves your HTML, CSS and JavaScript as a single file. Open it in any browser, attach it to an email, or use it as the starting point for a real project.

    Good for learning

    Because the preview reacts as you type, the playground is a friendly way to learn web basics: change a colour, add an element, move a box with flexbox, and see the effect straight away. Pair it with the Flexbox Playground and CSS Grid Generator for layout, or the CSS Gradient Generator for backgrounds.

    Frequently asked questions

    Is my code saved?

    Your latest code is kept in this browser on this device, so it is still there when you come back. It is never uploaded. Use Download .html to keep a copy or move it to another device.

    Why can’t I load a library from a CDN?

    The preview is not allowed to contact other websites, which keeps the page private and safe. To use a small library, paste its code at the top of the JavaScript tab, or download the result and add the script tag there.

    Is it safe to run code from the internet here?

    The preview runs in a sandboxed frame with its own isolated origin. It can’t read this site’s storage or cookies, and it can’t make network requests. As always, only run code you understand.

    Can I write a full HTML document?

    Yes. If the HTML tab starts with <!doctype html> or <html>, your document is used as it is, and the CSS and JavaScript tabs are added to its head and body.

    Why don’t alert() and prompt() work?

    Pop-up dialogs are blocked inside the sandbox so a script can’t freeze the page. Use console.log instead; the output appears in the Console panel.

    Tutorials