HTML Playground

HTML, CSS and JavaScript playground

Write HTML, CSS and JavaScript and see the result as you type, with a console for logs and errors. The preview runs in a locked-down sandbox, and nothing is uploaded.

Console
    Preview is sandboxed. Network: off

    How to use it

    1. Type HTML, CSS and JavaScript in the three tabs, or open an .html file.
    2. Watch the preview update. console.log output and errors appear in the console underneath.
    3. Download the result as one .html file, or copy a share link.

    Questions

    Is my code uploaded or saved anywhere?

    No. Everything runs in your browser. Your code is never sent to a server. A draft is kept in this browser only. Share links carry the code inside the link itself, after the # sign, which browsers never send to a server.

    Is it safe to open a playground link someone sent me?

    Yes. The preview runs in a locked-down sandbox with its own separate origin: the code in it cannot read this page, your drafts or cookies, cannot redirect the page, open pop-ups or submit forms, and by default cannot connect to the internet. Shared code also does not run until you press Run.

    Why can't my code load a library from a CDN or call an API?

    For safety, the preview blocks all network requests by default. Tick "Allow network" to let it load scripts, styles, images and data from other https sites. It is still sandboxed and still cannot touch this page.

    My code froze the preview. What now?

    Press Stop. It throws the preview away completely. If the whole tab froze (some browsers run the preview in the same process), reload the page: your draft is saved.

    Also free and private: Markdown Preview and Private PDF tools.