HTML, CSS & JS Playground

Free online HTML editor and viewer. Write HTML, CSS and JavaScript with a live preview and console, autosaved in your browser. No sign-up needed.

A small CodePen-style playground that runs in your browser. Write HTML, CSS and JavaScript in three tabs and the preview on the right updates as you type, inside a sandboxed frame that cannot touch this site or your data. console.log output and JavaScript errors appear in the console panel, your work is autosaved on this device, and you can download everything as a single .html file.

Runs entirely in your browser and works offline. Nothing you enter or upload leaves your device. Free, no sign-up.

Features

How to use HTML, CSS & JS Playground

  1. Write or paste markup in the HTML tab, styles in CSS and scripts in JS.
  2. Watch the preview update automatically, or turn off Auto-run and press Run (Ctrl/Cmd + Enter).
  3. Check console.log output and errors in the console under the preview.
  4. Download the page as one .html file; your code is also saved in this browser automatically.

Frequently asked questions

Is my code saved?

Yes, on this device only. The playground stores your HTML, CSS and JavaScript in your browser's local storage a moment after you stop typing, so it is still there when you come back. Clearing site data or using a private window removes it, so download a copy of anything important.

Is it safe to run JavaScript here?

The preview runs in an iframe with the sandbox attribute and only allow-scripts, so the code runs in an isolated, opaque origin: it cannot read this site's storage or cookies, open pop-ups or navigate the page. Still, only run code you trust.

Can I use external libraries such as jQuery or Bootstrap?

Yes. Add a <script src="…"> or <link rel="stylesheet" href="…"> tag from a CDN in the HTML tab. Those files are fetched by the preview when you are online.

Why does fetch or localStorage fail inside the preview?

Because the sandbox gives the preview an opaque origin, APIs tied to an origin such as localStorage, cookies and some requests are blocked or behave differently. Test those features on a real local server.

How do I view an HTML file I already have?

Open the file in a text editor, copy everything and paste it into the HTML tab. A full document with <html>, <head> and <body> works; the CSS and JS tabs are added into it automatically.

Related tools

All free tools · This tool as Markdown