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?
What the reader shows
Paste or open a file: Type HTML in the source box, or open an .html or .htm file up to 500,000 characters.
Rendered preview: The frame draws the document, including a style element in the file. External images load only if the HTML asks for them.
Scripts stay off: The preview uses an empty sandbox, which applies every iframe restriction. Script, forms, and top navigation do not run.
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 HTML or open a file
The box starts with a short sample. Replace it with your document, or use Open HTML file.
Read the preview
The frame under the source shows the page. Edit the source and the preview updates.
Keep a copy
Copy the HTML or download page.html if you want the file on your computer.
What this preview will not do
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.
Entities are not decoded: If the text is full of < and &, decode it on HTML Decoder first, then paste the markup here.
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.
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
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
No account: There is no sign-in step. The HTML stays in this browser.
Source and preview together: The code stays in the box while the frame shows the page.
A locked-down frame: The sandbox is empty, so the preview cannot run script or take over this tab.
Technical details
- 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
“HTML (HyperText Markup Language) is the most basic building block of the Web. It defines the meaning and structure of web content.”
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>.”
<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