Format Code Now
/
Web & markupReal-Time HTML Editor Next: HTML Form Builder ›

Real-Time HTML Editor

WM-123

Write HTML, CSS and JavaScript in three tabs and see the page update as you type. The preview runs in a sandboxed frame, and JavaScript stays off until you turn it on.

Runs in your browser. Nothing is uploaded.

Code

Your draft is saved in this browser only. Clear removes it.

Live page

How to use it

  1. Type in the HTML tab, or press Sample to load a small page with styles and a script.
  2. Switch to the CSS and JavaScript tabs to add styles and code.
  3. Tick Run JavaScript when you want the script to run in the preview.
  4. Press Format to tidy all three tabs, then copy or download the page as one HTML file.

How the tabs become one page

The CSS goes into a style tag just before the end of the head, and the JavaScript into a script tag just before the end of the body. If your HTML has no head or body, the style goes first and the script last. The Single file tab shows the combined page, and Download saves it as one .html file you can open anywhere. Format re-indents each tab and reports CSS and JavaScript syntax errors, naming the tab they are in.

What the sandbox blocks

The preview frame cannot reach this site, your cookies or your saved data. JavaScript is left out until you tick Run JavaScript. Images, styles and scripts hosted on other sites are blocked unless you tick Load web images and styles. Forms cannot be sent and pop-ups cannot open, even with scripts on. Code that needs those things, or a server, should be tested on a local web server instead.

Questions people ask

Why does my JavaScript not run?

Scripts are off by default so that pasted code does nothing until you choose to run it. Tick Run JavaScript and the preview reloads with your script included. Code that opens pop-ups, sends forms or loads scripts from other sites still will not work inside the sandbox.

Can I use a library from a CDN?

Only with Load web images and styles ticked, which lets the preview load files from other sites, together with Run JavaScript for scripts. Your browser then fetches the library straight from its host. Without those options, outside files are blocked.

Can I save my work as one file?

Yes. Press Download for a single HTML file with your CSS in a style tag and your JavaScript in a script tag. Save file in the editor saves just the tab you are on, such as the CSS alone.

Does the page see my cookies or this site?

No. The frame is sandboxed without same-origin access, so code in it is treated as coming from an unknown site. It cannot read this page, your cookies or this site's storage, even with Run JavaScript ticked.

Is my code uploaded?

Nothing is uploaded. The editor runs in your browser, and your draft is saved only in this browser's local storage so it is there when you come back. Clear removes it. Share link puts the text in the link itself, so only people you send the link to can see it.

About this tool

The three tabs are joined into one page: the CSS goes in a style tag before the end of the head and the JavaScript in a script tag before the end of the body. The page runs in a sandboxed frame that cannot reach this site, your cookies or your storage. JavaScript is left out until you tick Run JavaScript. Images, styles and scripts hosted on other sites are blocked unless you tick Load web images and styles. Forms and pop-ups are blocked. Format re-indents each tab and reports syntax errors in CSS and JavaScript. Your draft is kept in this browser only.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.