A browser-based HTML live editor with separate HTML, CSS and JavaScript panes and a sandboxed preview that re-renders the instant you stop typing. It is built for the moments when you want to test a snippet, prototype a layout, debug a tricky bit of CSS, or teach a concept without spinning up a project, a build tool, or an account. Everything runs locally in your browser, so it is fast, private, and works offline once the page has loaded.
How it works
The editor keeps three text buffers — one each for markup, styles and script. When auto-run
is enabled, a short debounce waits until you pause typing and then assembles the three buffers
into one document. That document is injected into an <iframe> through its srcdoc attribute
with a sandbox allowing scripts, forms, modals and popups, but isolating it from the
surrounding page. Because the preview is a real, isolated document, your JavaScript executes
exactly as it would on a live site — event listeners fire, timers run, the DOM updates.
A tiny bridge injected into the frame wraps console.log, console.warn and console.error
and listens for uncaught errors and rejected promises. Each message is forwarded to the parent
window with postMessage, and the Console panel renders them with colour-coding so you can
debug without leaving the tool. The whole pen autosaves to localStorage, and Save snapshot
stores up to 30 named versions you can reload later. Export .html writes a single
self-contained file with your CSS and JS inlined, and Import does the reverse — splitting a
pasted document back into the three panes. None of this touches a server.
Example
Suppose you want to test a hover animation. Drop a button into the HTML pane, add a
transition and :hover rule in the CSS pane, and a console.log in the JS pane to confirm a
click handler fires. With auto-run on, the preview shows the styled button immediately; click it
and the Console panel prints your log line. Happy with it? Press Export .html and you have a
shareable page. The table below shows what each pane contributes to the final document:
| Pane | Goes into | Typical use |
|---|---|---|
| HTML | the page body | structure, content, elements |
| CSS | an inline style block | layout, colours, animation |
| JS | an inline script block | interactivity, DOM logic |
Every keystroke stays on your machine — nothing is uploaded, logged, or stored anywhere but your own browser.