HTML Editor

Write and test HTML, CSS and JavaScript online for free — edit three panes side by side and see a live preview as you type, with console output, phone and tablet preview widths, starter templates, autosave and a one-click download of a single index.html. Your code runs in a secure sandbox in your browser.

100% private — everything runs in your browser. Conversion happens on your device; nothing is uploaded.

100% private — runs in your browser
Preview width:
Console

Your code runs in a sandboxed preview that can’t access this page, your cookies or other sites’ data. Work is autosaved in this browser only. Download a single index.html containing your HTML, CSS and JavaScript.

How to use the online HTML editor

  1. Pick a template, or start typing in the HTML, CSS and JavaScript panes.
  2. Watch the preview update (or press Ctrl/⌘+Enter).
  3. Check console messages and try phone and tablet widths.
  4. Download your page as index.html.

What you can use it for

  • Prototype components and layouts quickly
  • Learn and teach HTML, CSS and JavaScript
  • Test snippets from tutorials and Stack Overflow
  • Build a quick single-page demo to share

More free tools

Building for the web?

Format, minify, convert and generate code with our free, private developer tools.

See all free tools →

Frequently asked questions

Is my code safe to run?

Yes — the preview runs in a sandboxed frame that can't access this page, your cookies or other sites' data.

Is my work saved?

It's autosaved in this browser. Download index.html to keep a copy.

Can I use libraries?

Yes — add a <script src> or <link> to a CDN in the HTML pane.

Can I open an existing page?

Yes — open an .html file and its HTML, inline CSS and inline JavaScript are split into the three panes.

Is the HTML editor free, and do I need an account?

Yes, it's free and there's no account or sign-up. You can write, run and download as many pages as you like. Your code is autosaved only in this browser and isn't sent to a server, so there's nothing to log in to. The code you write is your own to use in any project, including commercial ones.

What's inside the downloaded index.html?

It's one complete HTML file: a doctype, a UTF-8 charset and mobile viewport tag, your CSS inside a <style> tag in the head, your HTML in the body, and your JavaScript in a <script> tag at the end of the body. The preview's console helper is left out. Double-click it to open it in any browser, or upload it to a web host.

Why isn't the preview updating?

Check that Auto-run is ticked: it re-runs your code half a second after you stop typing. With it off, press Run or Ctrl/⌘+Enter. If the preview stays blank or half-built, look at the Console panel under it, where JavaScript errors are listed. One error can stop the rest of your script, so fix the first message and run again.

Why don't my images or local files show in the preview?

The preview can't read files from your computer, so a path such as images/photo.jpg has nothing to point to. Use full web addresses starting with https:// for images, fonts, stylesheets and scripts. When you open an .html file, its body HTML, inline CSS and inline JavaScript are loaded, but linked files and tags in the file's head, such as stylesheet links, aren't kept.

Why doesn't alert() or a form submit work in the preview?

The preview runs in a sandbox that only allows scripts, so pop-ups such as alert(), confirm() and prompt() are blocked, forms can't be submitted and localStorage isn't available. That's what keeps your code away from this page and your cookies. Use console.log() to check values instead, or download index.html and open it in your browser to test those features.