The preview is a sandboxed frame. Scripts do not run, and the markup stays in this browser.

Help Us Improve

—

(—)

HTML viewer and online reader

Paste HTML and see the page rendered under the source. Scripts in the preview do not run. Free, no sign-in.

What is an HTML viewer?

An HTML viewer shows markup as a page: you paste the source, or open an .html file, and the reader draws headings, lists, images, and CSS underneath. The source box is the code view. The frame is the rendered page. The frame is sandboxed with every restriction on, so scripts in that HTML do not run and the preview cannot navigate this site. Nothing is uploaded. To turn entities such as < back into characters, use HTML Decoder. To save a picture of a page, use HTML to PNG Converter.

What the reader shows

Source and a rendered page, in the browser.
  1. Paste or open a file: Type HTML in the source box, or open an .html or .htm file up to 500,000 characters.

  2. Rendered preview: The frame draws the document, including a style element in the file. External images load only if the HTML asks for them.

  3. Scripts stay off: The preview uses an empty sandbox, which applies every iframe restriction. Script, forms, and top navigation do not run.

  4. Copy or download the source: Copy the HTML, or save it as page.html. Opening that file later is outside this preview.

How to view HTML online

Paste the markup, then read the rendered page.
  1. Paste HTML or open a file

    The box starts with a short sample. Replace it with your document, or use Open HTML file.

  2. Read the preview

    The frame under the source shows the page. Edit the source and the preview updates.

  3. Keep a copy

    Copy the HTML or download page.html if you want the file on your computer.

What this preview will not do

Limits that keep the reader a viewer.
  1. JavaScript does not run: A page that only appears after a script runs will look empty here. The source is still visible above the frame.

  2. Entities are not decoded: If the text is full of < and &, decode it on HTML Decoder first, then paste the markup here.

  3. A full website address is not fetched: This page does not download someone else’s site. Paste the HTML you already have, or open a file from your computer.

  4. Pictures of the page are a different tool: Use HTML to PNG Converter when you need a PNG of the rendered HTML instead of a live preview.

When to use it

Jobs a local HTML reader is built for.
  • A snippet from an email or doc

    See how a fragment looks before you drop it into a page.

  • An .html file on your computer

    Open the file and read it without installing an editor.

  • Checking CSS in the file

    Styles written in the document apply in the preview. Scripts still do not.

What you get

A source view and a rendered page, with scripts off.
  1. No account: There is no sign-in step. The HTML stays in this browser.

  2. Source and preview together: The code stays in the box while the frame shows the page.

  3. A locked-down frame: The sandbox is empty, so the preview cannot run script or take over this tab.

Technical details

How the HTML is shown.
srcdoc frame
The preview is an iframe whose srcdoc is the text in the source box. It is not inserted into this page’s document.
Sandbox
The sandbox attribute is present and empty, which applies all iframe restrictions. Scripts, form submission, and top-level navigation stay off.
Size
Preview stops above 500,000 characters. Larger files are refused before they are drawn.

Sources & References

Where the HTML description and the iframe sandbox come from.
  • “HTML (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content.”
    — MDN Web Docs — HTML: HyperText Markup Language

    HTML: HyperText Markup Language: The viewer renders that markup, including structure and CSS written in the document. developer.mozilla.org/en-US/docs/Web/HTML

  • “Controls the restrictions applied to the content embedded in the <iframe>.”
    — MDN Web Docs — <iframe>, the sandbox attribute

    <iframe>: The Inline Frame element: The preview sets sandbox to an empty value, which applies every restriction, including blocking scripts. developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox

Frequently Asked Questions

Quick answers about this tool—open a question to read more.