curly{bits}

curlybits / HTML Viewer

HTML Viewer & Editor

Paste HTML to see it rendered instantly, or write your own and watch the preview update as you type. CSS and JavaScript work too, console messages and errors appear below, and you can check how the page looks at phone and tablet widths.

HTML, CSS & JS
Preview
Console
Your code runs in a sandbox, on your device. Nothing is uploaded.

How to use the HTML Viewer & Editor

  1. Paste or type HTML in the left box, or open an .html file. <style> and <script> tags work as usual.
  2. The preview on the right updates as you type. Untick Live and press Run (or Ctrl+Enter) to update only when you choose.
  3. Switch between Full, Tablet and Phone to test responsive layouts, or open the preview full screen.
  4. Check Console for console.log output and JavaScript errors, then download your page as an .html file.

Safe by design

Your code runs in a sandboxed frame that's cut off from this website, your cookies and your other tabs. Scripts can run and show alerts, but they can't read or change anything outside the preview. Nothing is uploaded: your code stays in your browser, and the last thing you typed is kept there for your next visit.

What you can do with it

  • Preview an HTML email or a snippet from a tutorial before you use it.
  • Open an .html file someone sent you to see what it does, safely.
  • Try out CSS layouts and see how they behave at phone and tablet widths.
  • Test small JavaScript experiments, with console.log output shown under the preview.

Tips

  • Press Tab to indent. To move on with the keyboard, press Esc first, then Tab.
  • Images and stylesheets from other websites load as long as you use full https:// links.
  • To tidy up messy code, try the CSS formatter and minifier.
  • To save your page as a PDF, paste the HTML into HTML to PDF on our sister site, curlytab.

Frequently asked questions

Is it safe to open HTML I don't trust?

Much safer than opening the file directly: the preview runs in a sandbox without access to this site, your cookies or other tabs. Even so, don't type passwords into forms in pages you don't trust.

Is my code saved?

Your latest code is kept in this browser only, so it's there next time. Click Download .html to keep a copy.

Can I use JavaScript libraries?

Yes. Add a <script src="https://…"> tag that points to a CDN such as cdnjs or jsDelivr.

Why doesn't my relative image link work?

The preview has no folder to look in, so links like images/logo.png can't load. Use a full https:// address, or turn the image into a data URI with Image to Base64.

Updated

Add this HTML viewer to your website

Free for blogs, schools and businesses. Copy the code below and paste it into your page's HTML. The tool works exactly like this one and runs in your visitors' browsers, so nothing is uploaded. Please keep the credit line so others can find it too.

Preview embed ↗