HTML Viewer

Paste HTML and see the rendered page live, safely sandboxed.

0 characters · 0 words · 0 lines

HTML Viewer – Preview HTML Code Online

The HTML viewer renders any HTML snippet or full document right next to the code, so you can see what a piece of markup looks like without creating a file, starting a local server, or opening a new browser tab. Paste HTML on the left and the rendered page appears on the right as you type.

How to use the HTML viewer

  1. Paste your HTML, type it directly, or click Open file to load an .html file from your computer.
  2. The preview updates live. Click Sample to see a small article with headings, a list, a table, and a code block.
  3. Turn on Run scripts (sandboxed) if your snippet needs JavaScript, for example a small interactive demo.
  4. Use Copy or Download .html to save your edited version.

What it is good for

  • Checking an email template or newsletter fragment before sending it.
  • Previewing HTML that came out of an API, a CMS export, or a database field.
  • Debugging a broken layout by deleting parts of the markup until the problem disappears.
  • Showing a colleague what a snippet renders to, without a full project setup.

Sandboxed by design

The preview is an isolated iframe built with the sandbox attribute and srcdoc. It never gets same-origin rights, so code inside it cannot touch FowTools, your cookies, or other tabs. Scripts are off by default; when you switch them on they still run inside the sandbox. This makes the viewer a safe place to look at HTML you received from someone else.

Full documents and fragments

You can paste a complete document with a doctype, head, and body, or a fragment such as a single div. Browsers wrap fragments in an implicit document automatically. Inline style blocks are applied; external files need absolute URLs because the preview has no base address.

Edit HTML together with CSS and JavaScript in the HTML Editor, tidy indentation with the HTML Beautifier, or remove messy inline styles with the HTML Cleaner.

Frequently Asked Questions

The preview is rendered in a sandboxed iframe without same-origin access, so the HTML cannot read your cookies, local storage, or this page. Scripts are disabled unless you switch on "Run scripts", and even then they stay inside the sandbox.

Relative links to stylesheets, images, and scripts cannot be resolved because the preview has no base URL. Use absolute URLs (https://...) or inline the CSS in a style block.

Yes. Click "Open file" and pick an .html, .htm, or .svg file. It is read in your browser and never uploaded.

No. The code is rendered exactly as typed; nothing is reformatted or sanitized in the editor. Use the HTML Beautifier or HTML Cleaner if you want to change it.