Google Drive and HTML files

Host an HTML file on Google Drive? Not since 2016.

If you uploaded an .html file to Google Drive and got a wall of code, or a download prompt, instead of your page, nothing is wrong with your file. Drive stores HTML; it refuses to serve it. Here is what changed, what still half-works, and the two-minute fix.

Updated July 2026

Host my HTML page →

01 Why Google Drive won't render your HTML

Two things are going on, and neither has a setting you can change:

  • The hosting feature is gone. Drive really did host websites once: publish a folder, get a googledrive.com/host address. Google deprecated that feature and switched it off on August 31, 2016. Every guide describing that flow is a decade out of date.
  • The preview shows code on purpose. Today Drive's viewer treats .html as a text document: you see the markup, scripts never run, and "Open with" offers no browser-render option. Serving user HTML from drive.google.com would let arbitrary scripts run on a Google domain, so Drive deliberately does not do it.

Changing the share setting to "Anyone with the link" does not help. The link opens the Drive viewer, not your page.

02 The fix: host the page, keep Drive for storage

Put the HTML on a service whose job is serving it. Drive stays your backup and working copy; the live link comes from the host.

1

Download the file from Drive

Right-click the .html file, choose Download. If the page has CSS, images or scripts alongside it, download the whole folder; Drive hands you a ZIP, which is exactly what you need.

2

Drop it on yapp.page

Drag the file, folder or ZIP onto yapp.page. About two seconds later the page is live at an https URL like yourname.yapp.page, styles and scripts intact. No account needed to try it.

3

Share the live link, not the Drive link

Send the yapp.page URL, or put it behind the QR code the page generates for you. When the page changes, update it on yapp.page and the URL stays the same, so nothing you shared goes stale.

i
Working in ChatGPT or Claude anyway? Connect yapp.page once and the assistant can publish the HTML for you and hand back the live link in the same chat. Set it up →

03 What about staying inside Google's tools?

People usually try one of three routes inside Google's own tools. What each actually gets you:

  • Google Sites embed block accepts a snippet of HTML and runs it in a sandboxed frame. Fine for a widget or a small block; it is not a way to serve your own full page with its own URL, layout and assets.
  • Apps Script (HtmlService) can genuinely serve HTML, but it means creating a script project, pasting your markup into code files, deploying a "web app", and living with a long script.googleusercontent.com address. A developer route, overkill for hosting a page.
  • Third-party "Drive hosting" proxies read your public Drive files and serve them from their own domain. They work until they are rate-limited or shut down, and you are trusting an unknown middleman with your content and your visitors.

If the goal is simply "this HTML file, live at a link, today", hosting the file properly is faster than all three.

04 Frequently asked questions

Can Google Drive host an HTML file as a website?

No, not anymore. Drive stores the file, but opening it shows a source-code preview or a download prompt; scripts never run. The web-hosting feature was removed on August 31, 2016. Host the HTML elsewhere and keep Drive for storage.

Why does my HTML file show code instead of a page?

Drive's preview treats .html as plain text and displays the markup rather than rendering it. That is deliberate; serving user HTML from drive.google.com would run arbitrary scripts on a Google domain. No sharing setting changes it.

Didn't Google Drive use to host websites?

Yes. Until August 31, 2016, a published folder was served at a googledrive.com/host address. Google deprecated the feature and those links all went dark at once.

How do I share an HTML file from Drive so it opens in the browser?

The Drive link itself will never render the page. Publish the file to a host like yapp.page, then share that live URL. Keep the source in Drive and re-publish when it changes.

What is the easiest alternative?

Drop the file on yapp.page: a live https URL at its own subdomain in about two seconds, no account needed to try. If the page belongs inside a Google Site, paste that URL into the Sites embed block.

Related

Host an HTML file online, free →
Host an HTML file on SharePoint →
How to publish an HTML website →
Free static website hosting →
HTML viewer: test before you publish →
Set up yapp.page with your AI client →