Code Preview

A live HTML/CSS/JavaScript editor. Type and the preview updates; console.log and errors show up in the console below.

✨ Features

  • Switch between HTML, CSS and JavaScript tabs; the preview refreshes 0.4s after you stop typing (or on demand)
  • console.log, console.error and runtime errors are shown in a console pane, with errors in red
  • Check responsive layouts at phone 375px, tablet 768px or full width
  • Download everything as one HTML file; code is auto-saved locally and shareable by URL when under 4KB

🪄 Use cases

Trying something out

Check how a CSS property or a snippet of JavaScript behaves without setting anything up.

Teaching and learning

No sign-up, just a URL – ideal for a first look at HTML where the result appears instantly.

Checking phone widths

Flip between 375px, 768px and full width to spot layouts that break.

Sharing a snippet

Export a working single-file HTML page, or share a short one straight from the URL.

🔒 Privacy

Your code is stored only in this browser's localStorage and is never sent to a server. The preview runs in a sandboxed iframe without same-origin privileges, so it cannot read this page's cookies or storage. Only when you press the share button is the URL (which contains your code) sent to the shortening service.

❓ FAQ

Where is my code stored?

Only in your browser's localStorage. Nothing is uploaded, so you will not see it from another device or browser – and clearing your browser data clears the code too. To keep something, use "Download HTML" to save it as a single file, or create a share URL if it is under 4KB.

Can I load external libraries such as jQuery?

Scripts from cdnjs.cloudflare.com and cdn.jsdelivr.net load fine. This page's Content Security Policy is inherited by the preview, so scripts from other domains are blocked. Images, web fonts and stylesheets can be loaded from any https source.

Is the preview safe to run?

The preview is an iframe sandboxed with allow-scripts only. Because it is not given allow-same-origin, scripts inside it cannot read this page's cookies or localStorage. The console pane simply displays messages the iframe sends out with postMessage.

Can I turn off the automatic refresh?

Untick "Auto update" and nothing re-renders while you type; press "Run" when you are ready. That is the safe way to experiment with heavy loops – and if a preview does hang, only the iframe is affected, so turning auto update off and fixing the code recovers it.

🔗 Related tools

Code

Your code is saved in this browser only – nothing is uploaded.

Preview

Preview width

Console

The preview runs in a sandboxed iframe, separate from this page. External images and web fonts load, but external scripts are limited to cdnjs.cloudflare.com and cdn.jsdelivr.net.