How do I open an HTML file on an iPhone, and how do I send one that opens?

Quick answer

Tap an .html file in the iPhone Files app and it opens in a Quick Look preview. In our iOS 26.3 test, that preview showed the text and CSS but ran no JavaScript and loaded nothing from the web. To see the whole page, open the file in Safari with an HTML viewer. To send a page that opens, send a link, not the file.

Get a link for my HTML file

Free plan: no credit card, 1 published page.

On this page

A teacher emails a quiz made with ChatGPT. A friend sends a game from Claude on WhatsApp. You tap the .html file on your iPhone and get a page that looks right, but nothing happens when you press a button. This guide covers both ends: how to open a file you received so it runs, and, if you're the one sending, how to send a page that opens with one tap.

Sending a file you made? The upload box at the top of this page turns it into a preview link without an account. That preview runs no scripts, so a quiz or game won't respond there. Click Keep this page — free, no card and sign up, and the page moves into your account, where its scripts run and you can publish it.

What happens when you tap an .html file on iPhone

Apple's guide to the Files app says: "If you haven't installed the app that created a file, a preview of the file opens in Quick Look." That's what we saw with an .html file.

We tested it on October 6, 2026, on iOS 26.3 in Apple's iPhone Simulator (Xcode, iPhone 17 Pro). We saved 2 test pages in Files and tapped each one. The Quick Look preview:

  • showed the text, the layout, and the CSS written inside the file
  • ran no JavaScript: a line the script should have rewritten stayed as it was, and a click counter stayed at 0
  • loaded nothing from the web: https:// images, Google Fonts, and Tailwind from a CDN all failed, so the Tailwind page showed with no styling

A plain document with its CSS inside reads fine in that preview. A quiz, a game, a chart, or a page with tabs looks finished but does nothing when you tap it. We didn't test a physical iPhone or iOS 27.

Apple's guide also describes Open With: touch and hold the file in Files, choose Open With, then pick an app. What that list offers depends on the apps on your phone. We didn't test which apps an iPhone lists for an .html file.

Open an HTML file on iPhone in 4 steps

These steps open the file in Safari, where its scripts run. Nothing is uploaded.

1. Save the file to Files

In Mail, touch and hold the attachment and choose Save to Files, as Apple's Mail guide describes. In WhatsApp, Messages, or another chat app, open the file and use that app's share button to save it to Files. We didn't test those apps, so the button's name may differ.

2. Open Convika's HTML viewer in Safari

Go to the free HTML viewer in Safari. It needs no account. Your browser reads the file, and the file never reaches Convika's servers. Don't open a file you weren't expecting: ask the sender first. If you're unsure about a file, turn off Run scripts before you choose it. The page then shows its HTML and CSS only.

3. Tap "Choose an .html file"

Tap Choose an .html file and pick the file from the folder you saved it in. The page appears inside the viewer with its JavaScript running, in a frame walled off from convika.com. It loads images, fonts, and scripts from other sites, such as Tailwind from a CDN. The viewer opens .html and .htm files up to 2 MB.

4. Check what's missing under the page

If the page points to files saved next to it, such as photo.png or style.css, the viewer lists them under the page. They can't show, because only the .html file came to you. Ask the sender for a link, or for one file with everything inside.

If the code came to you as text in a chat or an email, choose Paste code in the viewer instead, paste it, and tap Show the page.

Ways to open it, compared

Way to open itExtra app neededScripts runWho sees the page
Tap it in Files (Quick Look preview)NoNo, in our iOS 26.3 testOnly you
Choose it in Convika's HTML viewer in SafariNo, it's a web pageYes, unless you turn off Run scriptsOnly you, on that phone
Paste the code into the HTML viewerNoYes, unless you turn off Run scriptsOnly you, on that phone
Tap a link from the senderNoYes, if the host runs them; a published Convika page doesEveryone with the link, on any phone or computer

Open a file sent by email, WhatsApp, or Messages

  • Mail. Apple's Mail guide gives 3 choices when you touch and hold an attachment: Save Image for photos, Save to Files, or Share to open it with another app. Save it to Files, then follow the steps above.
  • WhatsApp. A file sent through WhatsApp's Document option arrives as a document of up to 2 GB, not as a page. Save it to Files and open it in the viewer. How to send an HTML page on WhatsApp shows the sender's side.
  • Messages. We didn't test how Messages opens an .html file. Save it to Files and use the viewer, as with the others.

Each of these is a workaround for the person who received the file. If the sender can send a link instead, you tap it and the page opens in Safari.

Why the page looks broken

  • The preview isn't a browser. Quick Look in Files ran no JavaScript and loaded nothing from the web in our test. Buttons, tabs, timers, and charts drawn by a script need a browser.
  • Files saved next to it didn't come along. Pages often keep styles in style.css, pictures in files like photo.png, and code in a .js file beside the .html file. A chat or an email sends only the one file you pick. In our test on October 13, 2026, in Chromium, a page opened from its own folder loaded all 3 files. The same page copied alone to another folder loaded none of them: the text lost its styles, the image broke, and the script didn't run.
  • The file is a page from a bigger site. A link to about.html points to another file you don't have, so it goes nowhere in the viewer too.

The sender can fix the last 2. Ask the AI that made the page to put all the CSS and JavaScript inside one HTML file, and to use full https:// links for images.

If you're the sender, a link saves the other person every step above. They tap it in WhatsApp, Mail, or Messages, Safari opens the page, and its buttons work. You send one address, and everyone sees the same page.

With Convika:

  1. Drop your file into the upload box at the top of this page, or paste the code. You get a preview link in seconds, without an account. It works for 3 minutes, with scripts and forms off.
  2. Click Keep this page — free, no card and sign up. The page moves into your account, and its scripts run in the dashboard preview.
  3. Click Publish. The first time you publish, Convika asks you to Choose how to publish your page. Free costs $0 and adds a small Convika bar at the bottom. The other choices are the 1-year Pro pass ($29 once) and Pro monthly, which remove the bar.
  4. Copy the address, such as yourpage.convika.page, and paste it into the chat or the email instead of the file.

On Free, the page is published as Public: anyone with the link can open it, and it may show up in search results and in Convika's gallery. To keep it out of both, choose Private link (Pro or pass) when you publish. Anyone with a private link can still open it.

The Free plan includes 1 published page and 10,000 page views a month, and the dashboard shows how many people opened the page. To put the page on a classroom screen or a printed sheet, How to turn an HTML file into a QR code covers the code people scan. How to share an HTML file as a link compares other free hosts. If the file is a game you made with AI, Make a game with AI and send friends a link covers the prompt and the checks on a phone.

Frequently asked questions

How to open an html file on iPhone?

Save the file to Files, then open Convika's free HTML viewer in Safari and tap Choose an .html file. The page runs there with its JavaScript, and the file isn't uploaded. Tapping the file in Files opens a Quick Look preview instead, which ran no scripts in our iOS 26.3 test. If someone sent you a file you weren't expecting, ask them first, and turn off Run scripts before you choose a file you're unsure of.

Why does my html file show code on iPhone?

The app you opened it with showed the file as text instead of running it as a page. We didn't test which iPhone apps do that. In our test, the Files preview showed the page's text and CSS rather than its code, but ran none of its scripts. To see the page as it was built, open it in Safari through an HTML viewer, or ask the sender for a link.

Can I view html files on iPhone Safari?

Yes, through a web page that reads the file in Safari, such as Convika's HTML viewer: tap Choose an .html file and pick the file from Files. Scripts, web fonts, and web images load there. We didn't test opening a saved file directly by its file path in Safari. For a file you weren't expecting, ask the sender first and turn off Run scripts before you choose it.

How do I save an html file to iPhone?

In Mail, touch and hold the attachment and choose Save to Files, as Apple's Mail guide describes. In a chat app such as WhatsApp, open the file and use the app's share button to save it to Files. The file then stays in the Files app, where an HTML viewer in Safari can open it.

How do I send an html file so it opens on a phone?

Send a link to the page, not the file. Put the file on a host that runs its scripts, then paste the address into the chat or email. On Convika, the upload box makes a preview link without an account, with scripts off. Keep the page on the Free plan and publish it, and the link opens in the phone's browser with its buttons working.

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

Send a link that opens on any iPhone

Upload the HTML file once and publish it. The person you send it to taps the link and sees the page in Safari, buttons and all.

Get a link for my HTML file

Free plan: no credit card, 1 published page.