Live HTML Preview

Write HTML and CSS and see the live preview instantly. All rendering is sandboxed in your browser.

Templates:
HTML
CSS
Preview(sandboxed iframe)

Free online HTML live preview: test HTML and CSS instantly

Sometimes you need to quickly prototype a layout, test a CSS snippet, or demonstrate a UI component without setting up a full project. This HTML live preview tool gives you a side-by-side editor and sandboxed preview that updates in real time as you type. No build step, no server, no account: just open the tool and start writing.

The preview renders inside a sandboxed iframe, keeping your code isolated from the rest of the page. Built-in templates get you started immediately with a Hello World page, a Flexbox layout demo, and a dark card component. All processing is local, so no HTML or CSS you write is transmitted anywhere.

Step-by-step guide

  1. 1
    Choose a template or start blank
    Select one of the built-in templates (Hello World, Flexbox Demo, Dark Card) or choose Blank to start from scratch.
  2. 2
    Write HTML in the left panel
    Type your HTML markup into the orange-labelled HTML panel. The preview updates automatically after a short debounce.
  3. 3
    Add CSS in the right panel
    Enter your styles in the blue-labelled CSS panel. All styles are scoped inside the sandboxed iframe.
  4. 4
    View the live preview
    The green-labelled Preview panel below shows the rendered output in a sandboxed iframe: no external resources are loaded.
  5. 5
    Iterate freely
    Keep editing both panels. The preview re-renders on every keystroke so you see changes as you type.

Related Tools

Frequently Asked Questions

Is the preview sandboxed?
Yes. The preview renders inside an iframe with the sandbox attribute set to allow-scripts. This prevents the preview from accessing the parent page, cookies, or local storage.
Can I include JavaScript in the HTML panel?
Yes. The sandbox allows scripts, so inline <script> tags in your HTML will execute inside the preview iframe.
Can I load external CSS frameworks like Bootstrap or Tailwind?
No. AlteredIdea operates entirely offline with no external network calls. You cannot load external stylesheets or scripts via CDN URLs. You can paste the CSS directly into the CSS panel instead.
Is my code saved between sessions?
No. The editor state is held in memory and is cleared when you close or refresh the tab. Copy your code before leaving if you want to keep it.
Can I preview responsive layouts?
The preview iframe fills the full width of the panel. You can use media queries in the CSS panel and resize your browser window to simulate different viewport widths.
What is the debounce delay before the preview updates?
The preview updates 300 ms after you stop typing. This prevents excessive re-renders while you are actively editing, keeping the interface smooth.
Can I embed images in the HTML panel?
You can embed images using data URLs (Base64-encoded). External image URLs will not load because the tool makes no outbound network requests.
Is there a character limit on the HTML or CSS panels?
There is no hard limit, but very large HTML documents may slow down the preview refresh. For complex pages use a local development environment.

AlteredIdea vs alternatives

vs server-side tools: Everything runs in your browser: your data never leaves your device.

vs VS Code extensions: No install needed. Works instantly in any browser.

vs paid tools: Completely free, no account required.