Ainda não está em português: aparece em inglês.

How to share an HTML file in SharePoint or OneDrive so it opens as a page

Quick answer

SharePoint Online doesn't run an uploaded .html file: Microsoft says files with script are \"downloaded or shown as raw content\", and a tenant can't switch that off. SharePoint's HTML pages, expected to reach every organization by late December 2026, show it as a page. Until then, publish it and share the link.

Get a link for my HTML file

Free plan: no credit card, 1 published page.

On this page

Copilot exported a sales dashboard as HTML, or ChatGPT made a project page, and you put the file in SharePoint or OneDrive. Colleagues who open it get a download or a screen of code, and the charts never draw. This guide shows what Microsoft says SharePoint and OneDrive do with an .html file, the way Microsoft now offers to show it as a page inside Microsoft 365, why the Embed web part won't help, and how to share it as a link instead.

For the full comparison of hosts and every step of making a link, see How to share an HTML file as a link. For a chat or a channel, see how to share an HTML file in Teams. Microsoft's pages here were read on November 4, 2026. No SharePoint, OneDrive, or Teams account was used, so buttons are named as Microsoft's help names them.

What happens when you upload an .html file to SharePoint or OneDrive

The upload works. Opening it as a page doesn't.

  • SharePoint takes the file. Microsoft's list of file types says: "There are currently no known types of files that cannot be added." Its page on OneDrive and SharePoint limits adds that for OneDrive for work or school, "your admin might prevent the sync app from uploading specific file types."
  • SharePoint Online doesn't run it. Microsoft Learn's page on browser file handling says that under the strict model, "all files which can potentially cause harm (e.g. a html file having embedded script) are not executed in the browser but downloaded or shown as raw content (html preview in the modern user experience)." A forced download, a screen of tags, or a preview whose buttons do nothing all fit that rule.
  • The preview list doesn't say more. Microsoft's list of file types you can preview in OneDrive, SharePoint, and Teams puts "HTM, HTML" under "Web/Hypertext", and HTML again under "Text and Code". It doesn't say whether the preview draws the page or runs its scripts.
  • OneDrive is held to the same rule on scripts. Microsoft's page on custom script says SharePoint doesn't allow script on most sites by default, and "The same restriction also applies to OneDrive". Files you post in a Teams channel land in the team's SharePoint folder, and files sent in a Teams chat land in your OneDrive for Business, Microsoft's Teams help says.

We found no Microsoft page on how a personal OneDrive, outside work or school, shows an .html file.

Why it isn't a setting you can switch

The same Microsoft Learn page says: "Today the default setting is strict, and you already cannot switch your tenant to the permissive model." So no one in your organization can turn on running HTML files from a document library.

That page, dated September 23, 2022, also gives the old fix: a site owner or admin renames each .html file to .aspx. It adds that on modern team and communication sites, "no one can perform a successful rename from html/htm to aspx" until custom script is allowed on the site. Microsoft's current page on custom script says that "Changes to allow custom scripts are overridden to Not allowed within 24 hours" and "You can't allow custom scripts on an individual user's OneDrive." It's a job for a SharePoint admin, and not one that lasts.

Show it as a SharePoint HTML page

Microsoft's own way to show HTML as a page inside Microsoft 365 is SharePoint's HTML pages. Its help, dated October 12, 2026, says: "In SharePoint, you can create an HTML page with Copilot or upload an existing HTML file. Store the page in the Site Pages library". Microsoft 365 Message Center post MC1479517, published September 25, 2026, gives the schedule: "Public Preview: Rollout will begin in early October 2026" and "General Availability (Worldwide): Rollout will begin in mid-November 2026 and is expected to complete by late December 2026." It adds: "No admin action is required before rollout." Until it reaches your organization, the help warns, "you may not yet see this feature".

If your site has it, an .html file already in a document library can become a page. Microsoft's steps: "Select the ... menu, select Edit, and then select Edit in SharePoint." SharePoint moves the file to the Site Pages library and opens it as a page to edit, and the file "no longer remains in the original document library." Then select Publish. Microsoft notes that publishing "doesn't grant new permissions": only people who already have permission to view the page see it.

What the same help says such a page can and can't do:

  • Scripts in the file run. "The sandbox supports JavaScript when the code is contained in the same HTML file."
  • Few libraries from the web. "SharePoint supports Chart.js, Mermaid, React, Fluent UI, and Babylon from a Microsoft-managed CDN. Other CDN-hosted libraries aren't supported." A chart that loads its library from any other CDN won't draw.
  • No outside data. "SharePoint blocks arbitrary fetch requests and outbound API calls from HTML pages", and "The sandbox can't access the browser localStorage." Its table marks live data from SharePoint lists and Excel as supported.
  • Size. "The maximum size is 10 MB", not counting images and videos, which SharePoint copies to the Site assets folder.
  • Who decides. "HTML pages are enabled by default." A site owner can turn Allow HTML files off or on in the Site Pages library, under File types. Asked whether HTML pages can be turned off for the whole organization, the help answers "No."
  • Copilot. Editing the page yourself needs no Copilot license. Creating or changing it with the Copilot chat pane needs a Microsoft 365 Copilot license.

Why the Embed web part and a Teams Website tab won't show it

The Embed web part shows another website inside a SharePoint page. Microsoft's help for it sets the conditions:

  • "Embed code must be iframe-based (that is, start and end with <iframe> tags). Embed code that uses <script> tags is not supported." So pasting your page's own code there doesn't run it.
  • "Not all websites allow their pages to be embedded, so you may not be able to embed them, even when they are secure and use iframe-based embed code."
  • Site collection admins decide which sites can be embedded, through a setting called HTML Field Security. If they haven't allowed a site, "users who try to do so will see an error message that says, 'Embedding content from this website isn't allowed.'"

A published Convika page doesn't allow it. Every Convika page tells browsers not to show it inside another site's frame, so it can't appear in the Embed web part, whatever the allow list says.

A Teams Website tab has the same limit. Microsoft Learn's troubleshooting page says that when you select a Website tab, "the site doesn't load correctly" if "The website is prevented from being embedded in other sites." Its workaround is to "select Open in browser" and open the site outside Teams. A Convika page added as a Website tab won't load inside Teams, so post its link instead.

Ways to show the page, compared

Way to show itWhere the page runsIts scriptsWho can open itSource
Open the .html file in SharePoint or OneDriveSharePoint or OneDrive in the browser"not executed in the browser but downloaded or shown as raw content"People you share the file withMicrosoft Learn, browser file handling
Download it and open it on your computerYour own browser, from file:///Scripts inside the file ran; a module script and a data.json beside it didn'tOnly youMicrosoft's download help; our Safari and Mac tests
Move it to Site Pages as a SharePoint HTML pageSharePoint, in "a sandboxed iframe"JavaScript in the same file and 5 Microsoft-hosted libraries; no other CDN, fetch, or localStoragePeople with permission to view the pageMicrosoft's help on HTML pages in SharePoint
Paste its code into the Embed web partNot shown"Embed code that uses <script> tags is not supported"NoneMicrosoft's help on the Embed web part
A published Convika page in the Embed web part or a Teams Website tabNot shownNot shown: Convika pages refuse every frameNoneMicrosoft's Embed and Website tab pages; Convika's page headers
A link to a published Convika pageAny browser, at an https:// addressRun, including libraries from https:// CDNsAnyone with the link, or only people with the password on ProConvika

The link these steps make opens a page on Convika, on the internet, outside Microsoft 365. Check your organization's rules before you publish anything internal (when the file must stay inside the company).

1. Put the page in one file

Convika takes one .html or .htm file, up to 2 MB, or the same code pasted into the box. If your CSS or images sit in separate files, ask the AI that made the page: “Put all the CSS inside the HTML file and use https:// addresses for the images, so the page is one file.” Download the file from SharePoint or OneDrive first: select it and choose Download, as Microsoft's help describes.

2. Publish it

Drop the file into the upload box at the top of this page. Click Keep this page — free, no card and sign up. The page moves into your account, where its scripts run. Click Publish page. Under Who can open this page?, choose Public and click Next. The first time, click Publish free. A Public page can show up in search results and in Convika's gallery, so for internal numbers choose Private link or Only people with the password (Pro, $12 a month), or keep the file inside Microsoft 365.

3. Copy the address under Live URL

The page's address, such as yourpage.convika.page, stays the same until you unpublish it. Open it in your own browser once and check the charts and buttons.

  • A SharePoint document library. Microsoft's steps: "In the top-left menu, select New, and then select Link." Paste the address in the Create link to box, give it a name under File name, and select Create. The link sits among the library's files, and SharePoint adds ".url" to its name.
  • OneDrive. A OneDrive Copy link shares the file, not the page. Keep the .html file there for whoever edits it, and send the page's address in the message instead.
  • Teams, email, or Slack. Paste the address into the message. How to share an HTML file in Teams covers chats, channels, and class teams; for email, see how to send an HTML file by email; for Slack, how to share an HTML report in Slack.

To fix the page later without changing the address, upload the new file to the same page on its screen in Convika, under Update from an HTML file, and publish the new version.

Images, CSS, and several files

A SharePoint library keeps a page's files side by side, but a Convika page is one HTML file:

  • CSS and JavaScript go inside the HTML file, in <style> and <script> tags.
  • Images need full https:// addresses, or go inside the file, where they count toward the 2 MB limit. HTML file missing images or styles shows how to fold them in.
  • Data from SharePoint or an internal system doesn't load. A script's fetch and XHR requests on a Convika page reach only the page's own address (on Pro, also the analytics tools Convika supports and the hosts you list for your own ad network), so a page pulling numbers from a SharePoint list or an internal API shows none of them. Ask the AI to write the numbers into the page, and publish a new version when they change.

SharePoint's HTML pages take an HTML folder instead: Microsoft says SharePoint uploads the images, videos, and other files "to the Site assets folder when the content is embedded in the HTML or included in an HTML folder."

When the file must stay inside the company

Convika publishes the page on the internet, outside Microsoft 365. If your company's rules say a file must not leave Microsoft 365, don't publish it there: ask your IT team. Microsoft's own options, from its help:

  • A SharePoint HTML page on a site your colleagues can open, once the feature reaches your organization (worldwide by late December 2026, Microsoft says).
  • The file itself, shared inside the company. Colleagues download it and open it in their browser. Scripts in the file run; files beside it may not.
  • A link only people in your organization can use. OneDrive's sharing help offers a link that "gives anyone in your organization who has the link access to the file". It also says admins may turn off the Anyone option "to prevent usable links being forwarded to others outside your organization."

When you publish, the free choice is Public: anyone with the link can open the page, and it may show up in search results and in Convika's gallery. To keep it out of both, choose Private link (Pro) under Who can open this page? when you publish. Anyone with a private link can still open it, without a password or account, so a link forwarded outside your company opens too.

  • A password needs Pro. Choose Only people with the password when you publish. Visitors get a password screen first, and Convika sends the page only after they enter the right password. A page password comes with Pro ($12 a month); with a password, Next opens an order for Pro monthly. See How to password protect an HTML page.
  • There's no Microsoft sign-in. A Convika page has one shared password. It doesn't use Microsoft 365 sign-in or single sign-on, so anyone with the password opens it, inside your organization or not.
  • You see how many opened it, not who. On Free, the dashboard shows visits by day, country, device, and the site they came from, over the last 90 days. It records no names and no email addresses.

Frequently asked questions

Can you upload HTML files to SharePoint?

Yes. Microsoft says "There are currently no known types of files that cannot be added" to SharePoint in Microsoft 365. Opening the file is the problem: SharePoint Online's strict handling means a file with script is "not executed in the browser but downloaded or shown as raw content". Once SharePoint's HTML pages reach your organization (rolling out worldwide from mid-November to late December 2026), the Site Pages library shows an HTML file as a page.

Why does my HTML file download or show code in SharePoint?

Because SharePoint Online uses the strict model for files that can run code. Microsoft Learn says a "html file having embedded script" is "downloaded or shown as raw content", and that "you already cannot switch your tenant to the permissive model." To show the page, move it to Site Pages as a SharePoint HTML page, or publish it and share the link.

Can you host an HTML page on SharePoint?

Only as a SharePoint HTML page in the Site Pages library, which Microsoft rolls out worldwide from mid-November to late December 2026 (Message Center MC1479517). That page runs JavaScript written in the file and 5 libraries from Microsoft's own CDN, and Microsoft says it "blocks arbitrary fetch requests and outbound API calls". An .html file in an ordinary document library isn't run.

How do I open an HTML file from OneDrive in a browser?

Download it, then open it in your browser: select the file and choose Download, as Microsoft's help says, then open it in Safari or Chrome. On a phone, an HTML viewer such as Convika's free HTML viewer runs it in the browser without uploading it. If someone sent you a file you weren't expecting, ask the sender first, and turn off Run scripts before you choose it.

Can I embed an HTML file in a SharePoint page?

Not with the Embed web part: Microsoft says "Embed code that uses <script> tags is not supported", and an embedded site has to allow it. A published Convika page refuses every frame, so it won't show there either. Use a SharePoint HTML page once your organization has them, or put a link to the published page on the SharePoint page or in the library.

How do I share an HTML file from SharePoint with people outside my company?

Publish it and send the page's address. A SharePoint or OneDrive link delivers the file, and Microsoft's help says admins may turn off the Anyone option so links can't reach people outside the organization. A published Convika page opens in any browser without an account. Check first that your company's rules let the file leave Microsoft 365.

Can my IT admin let HTML files run in SharePoint?

Not by switching a setting back. Microsoft Learn says the default is strict and "you already cannot switch your tenant to the permissive model." Its older fix, renaming files to .aspx, needs custom script allowed on the site, and Microsoft now says such changes are "overridden to Not allowed within 24 hours". What an admin or site owner can control is Allow HTML files for SharePoint's HTML pages.

Can a Teams Website tab show my HTML page?

Not a page that refuses to be embedded. Microsoft Learn says a Website tab doesn't load correctly when "The website is prevented from being embedded in other sites", and suggests Open in browser. Convika pages refuse every frame, so post the link in the chat or channel instead.

Sources

Next step

How to password protect an HTML page without code, on your own domain

JavaScript passwords sit in the page code. Put an HTML page from ChatGPT or Claude behind a server-checked password on your own domain.

Related articles

More ways to send your page

Share this article

Share a link that opens as a page

Upload the HTML file and publish it. Put the address in a SharePoint library, an email, or a Teams chat, and colleagues open the page in their browser, charts and buttons working.

Get a link for my HTML file

Free plan: no credit card, 1 published page.