HTML viewer
Paste HTML or open an .html file and see it as a working page, with its styles and scripts running. The viewer works in your browser, so the file is not uploaded and there is no account. Check it at desktop, tablet or phone width, then get a private link if you want to send it to someone.
It runs in your browser. Nothing is uploaded.
Your page shows here
Paste HTML above or open a file.
Send this page to someone
Get a private link they can open on any device. No account, a passcode by default, and it lasts 24 hours unless you keep it.
How to view an HTML file online
- Give it the page. Paste the HTML into the box, or press Open a file and choose an .html file. You can also drag the file onto the box.
- Look at it. The page is drawn underneath, with its CSS applied and its JavaScript running. Edits you make in the box show after a moment.
- Check the width. Desktop, Tablet and Phone draw the page at 1280 pixels or wider, at 768 and at 390, and scale it to fit. Expand gives it the whole window.
- Send it, if you want to. Get a private link turns the page into a link another person can open. This is the only step that uploads anything.
What runs in the viewer, and what does not
| In the page | In the viewer |
|---|---|
| CSS and JavaScript written into the file | Runs |
| Scripts, fonts and images loaded from a web address | Load, as they would if you opened the file from your disk |
| Buttons, tabs, charts and forms | Work |
| A stylesheet, script or image in a separate file beside the HTML | Missing. Only the one file is read. |
| Cookies and browser storage | Not available. A page that saves to storage may show an error. |
| Sending the whole tab to another address | Blocked |
The last two rows are the sandbox at work. The page is drawn in a frame that has no access to this site, to its cookies or to anything else open in your browser, which is what makes it reasonable to open a file you did not write.
Is it private?
Yes. Your browser reads the file and draws it on this page. The HTML is not sent to Stacktree, it is not stored, and it does not go into the address bar, so there is no link to this page that carries it. Close or reload the tab and it is gone.
One thing to know: the page you open can still fetch what it references from the web, such as a font or a chart library, exactly as it would if you opened it from your disk.
Sending the page to someone
An HTML file is awkward to send. As an email attachment it arrives as a download, and mail filters distrust it. Get a private link uploads the page to Stacktree and gives you an unguessable link, with a passcode unless you turn it off. The other person opens it in any browser, on a phone or a computer, with no account.
The link lasts 24 hours. Keep it in a free account and it stays at the same address for 7 more days, using one of the account's 3 pages. See how to share an HTML file as a link for passcodes, expiry and what a client sees.
A published page runs under a stricter policy than this preview. Fonts and common library CDNs load, scripts and images from other sites do not, and the page cannot call other servers. The result lists anything on your page that will not load for visitors.
A folder or a zipped site
The viewer opens one .html file. If the page depends on files beside it, such as style.css or an images folder, zip the folder that holds index.html and publish the zip: the files travel together to one link.
On an iPhone
The viewer is a web page, so there is nothing to install on a phone. Save the file to the Files app, tap Open a file and choose it. How to open an HTML file on iPhone has the steps.
Frequent questions
What is an HTML viewer? +
How do I open an HTML file online? +
Is my HTML uploaded anywhere? +
Does JavaScript run in the viewer? +
Why are my images or styles missing? +
Is it safe to open an HTML file someone sent me? +
Can I view an HTML file on a phone? +
How do I send the page to someone after viewing it? +
Is the HTML viewer free? +
Related
- Open an HTML file on iPhone Save it to Files, open it here, and see the page instead of a preview.
- Share an HTML file as a link Send a link instead of an attachment, with a passcode if you want one.
- Password-protect an HTML page Gate a page with a passcode the reader types, no account for them.
- Private HTML hosting What private by default means on Stacktree, and how the link works.
Sources and further reading
- MDN: the iframe sandbox attribute ↗ What a sandboxed frame may and may not do, and why leaving out allow-same-origin keeps the page apart from the site around it.
- HTML Standard: sandboxing ↗ The rules browsers follow: a sandboxed page gets an origin of its own, with no cookies or storage.
- MDN: FileReader ↗ How a web page reads a file you choose without sending it to a server.
- Microsoft Security: HTML smuggling ↗ Why an .html attachment from a stranger deserves care, and why mail filters distrust them.