# HTML viewer: open and run an HTML file online · Stacktree

Source: https://stacktr.ee/html-viewer

[Skip to content](#main) PFrom Product Hunt? Your first pages are free, no card. Code `PRODUCTHUNT` takes 50% off your first month of Studio.[Start free &rarr;](https://app.stacktr.ee/?join=1&from=producthunt)

&times;   A Stacktree customer sent you. Your first month is 50% off on any plan, taken off at checkout. [Start free &rarr;](https://app.stacktr.ee/?join=1&from=referral)

 &times;      [stacktr.ee](/)   [Examples](/#proof) [How we use it](/how-we-use-stacktree) [Pricing](/pricing) [Security](/security) [Log in](https://app.stacktr.ee) [Publish one](https://app.stacktr.ee/?join=1)          Free. Nothing is uploaded.

# 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.

    Paste HTMLorOpen a fileIt runs in your browser. Nothing is uploaded.

Load a sampleClearDesktopTabletPhoneExpandYour 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.

Get a private link

## 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](/share-html-file-with-client) 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](/share-html-file-with-client): 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](/open-html-file-on-iphone) has the steps.

FAQ

## Frequent questions

     What is an HTML viewer? +  An HTML viewer takes HTML code or an .html file and shows the page it describes, the way a browser would, instead of the raw tags. This one works in your browser: paste the code or open the file and the page appears underneath, with its CSS applied and its JavaScript running.   How do I open an HTML file online? +  Press Open a file on this page and choose the .html file, or drag it onto the box. The page is drawn under the box straight away. You can also copy the HTML and paste it in. Nothing is installed and nothing is uploaded.   Is my HTML uploaded anywhere? +  No. The viewer reads the file with your browser and draws it in a frame on this page. It is not sent to Stacktree or to anyone else, it is not saved, and it is gone when you close or reload the tab. The one exception is the optional last step, Get a private link, which uploads the page so that someone else can open it.   Does JavaScript run in the viewer? +  Yes. Scripts in the page run, including libraries it loads from the web, so charts, tabs and buttons work. They run in a sandbox: the page cannot read this site, has no cookies and no browser storage, and cannot send the tab somewhere else. A page that saves to browser storage may show an error or forget what you entered.   Why are my images or styles missing? +  Because they are separate files. The viewer reads the one .html file you chose, so a stylesheet or an image that sits beside it on your disk never reaches the browser. Images and styles written into the file, or loaded from a web address, do show. To see a whole folder as a site, zip it and [publish the zip](/share-html-file-with-client).   Is it safe to open an HTML file someone sent me? +  It is safer here than double-clicking the file, because the sandbox stops the page from reading this site or redirecting your tab. It is not a virus scan. The page can still show a form and send what you type to whoever wrote it, so do not enter a password or card number into a file from a sender you do not know.   Can I view an HTML file on a phone? +  Yes. The viewer is a web page, so it opens in the phone's browser with nothing to install. Tap Open a file, choose the file, and tap Expand to give the page the whole screen. On an iPhone, [save the file to Files first](/open-html-file-on-iphone).   How do I send the page to someone after viewing it? +  Press Get a private link under the preview. The page is uploaded and you get an unguessable link with a passcode, which the other person opens in any browser with no account. The link lasts 24 hours unless you keep it, and keeping it in a free account costs nothing.   Is the HTML viewer free? +  Yes. Viewing has no account, no limit and no cost. A private link is free too: without an account it lasts 24 hours, a page can be up to 10 MB, and one network can publish 20 pages a day.
Keep reading

## Related

   -  [ Open an HTML file on iPhone Save it to Files, open it here, and see the page instead of a preview. ](/open-html-file-on-iphone)
-  [ Share an HTML file as a link Send a link instead of an attachment, with a passcode if you want one. ](/share-html-file-with-client)
-  [ Password-protect an HTML page Gate a page with a passcode the reader types, no account for them. ](/password-protect-html-page)
-  [ Private HTML hosting What private by default means on Stacktree, and how the link works. ](/private-html-hosting)

References

## 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. ](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/iframe#sandbox)
-  [ HTML Standard: sandboxing ↗ The rules browsers follow: a sandboxed page gets an origin of its own, with no cookies or storage. ](https://html.spec.whatwg.org/multipage/browsers.html#sandboxing)
-  [ MDN: FileReader ↗ How a web page reads a file you choose without sending it to a server. ](https://developer.mozilla.org/en-US/docs/Web/API/FileReader)
-  [ Microsoft Security: HTML smuggling ↗ Why an .html attachment from a stranger deserves care, and why mail filters distrust them. ](https://www.microsoft.com/en-us/security/blog/2021/11/11/html-smuggling-surges-highly-evasive-loader-technique-increasingly-used-in-banking-malware-targeted-attacks/)
       stacktr.ee  [How we use it](/how-we-use-stacktree) [Client project tracker](/client-project-tracker) [Weekly work report](/weekly-work-report) [Tester kit](/tester-kit) [Page video](/page-video) [Ask this page](/ask-this-page) [Client feedback](/client-feedback-loop) [Client spaces](/client-spaces) [Templates](/templates) [Use cases](/use-cases) [Integrations](/agents) [Alternatives](/alternatives) [About](/about) [Blog](/blog) [Changelog](/changelog) [Pricing](/pricing) [Security](/security) [FAQ](/faq) [Made with Stacktree](/made-with)  Building with AI agents? See the [developer docs &rarr;](/developers)

---
Full markdown summary of the Stacktree marketing surface: https://stacktr.ee/llms-full.txt
