HTML Code Editor

Write HTML, CSS and JavaScript with a live preview and console

A simple online code playground: edit HTML, CSS and JavaScript side by side, see the result instantly, read console output and errors, start from templates and download your page.

About HTML Code Editor

How it works

  1. Type in the HTML, CSS and JS tabs. With Auto-run on, the preview updates half a second after you stop typing (or press Ctrl/⌘+Enter).
  2. The three parts are combined into one HTML page and loaded into a sandboxed frame.
  3. console.log, warnings, errors and unhandled exceptions from your code appear in the console panel.
  4. Your code is saved in this browser automatically, and "Download" saves it as a single index.html file.

What you need

  • A modern browser. No account or installation needed.

Tips

  • Start from a template (Profile card, Flexbox layout, JavaScript counter) to learn by changing things.
  • Turn off Auto-run when writing heavy scripts and run manually.
  • Errors in the console point to the line in your JS tab, e.g. "(JS line 9)".

Limitations

  • The preview is sandboxed: it cannot access this site, your cookies, or open pop-ups. Forms and localStorage inside the preview are restricted.
  • External libraries can be loaded with <script src="https://…"> from a CDN.

Runs in your browser. Your code stays in your browser (saved in local storage on this device) and is never uploaded.

Frequently asked questions

Is my code saved?+

Yes, in your browser's local storage on this device. It is not uploaded, so it will not appear on other devices. Use Download to keep a copy.

Why doesn't alert() or localStorage work in some cases?+

The preview runs in a secure sandbox to protect you and this site. Dialogs work, but storage and pop-up windows are restricted.