How do I open an HTML file on iPhone in Safari, and send one that opens?
Quick answer
To open an HTML file on iPhone in Safari, save it to Files, open Convika's free HTML viewer in Safari, and tap Choose an .html file: the page runs with its scripts. Tapped in Files, it opens a Quick Look preview that ran no JavaScript in our iOS 26.3 test. To send a page that opens, send a link, not the 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 it | Extra app needed | Scripts run | Who sees the page |
|---|---|---|---|
| Tap it in Files (Quick Look preview) | No | No, in our iOS 26.3 test | Only you |
| Choose it in Convika's HTML viewer in Safari | No, it's a web page | Yes, unless you turn off Run scripts | Only you, on that phone |
| Paste the code into the HTML viewer | No | Yes, unless you turn off Run scripts | Only you, on that phone |
| Tap a link from the sender | No | Yes, if the host runs them; a published Convika page does | Everyone 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
.htmlfile. 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 likephoto.png, and code in a.jsfile beside the.htmlfile. 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.htmlpoints 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.
Send a link instead
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:
- 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.
- Click Keep this page — free, no card and sign up. The page moves into your account, and its scripts run in the dashboard preview.
- Click Publish page. Under Who can open this page?, choose Public and click Next. The first time you publish, Convika shows Publish free, and under it Publish without the Convika bar, which opens an order for Pro monthly (1 day free with a card, then $12 a month). To publish on Free, click Publish free.
- Copy the address, such as
yourpage.convika.page, and paste it into the chat or the email instead of the file. To keep the page as an icon on your own phone, see how to add an HTML file to your home screen.
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) under Who can open this page? 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
- Find and view files and folders in Files on iPhone (Apple) (checked October 21, 2026)
- Download email attachments in Mail on iPhone (Apple) (checked October 21, 2026)
- How to send media, contacts, or location (WhatsApp Help Center, iPhone) (checked October 21, 2026)
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
- ChatGPT, Claude, or Gemini gave me HTML code: how do I run it and see the page?To run HTML code from ChatGPT, Claude, or Gemini, paste the whole code block into a free HTML viewer and it runs in your browser. Or save it as an .html file.
- Why does my HTML file show code or a blank white page?An HTML file shows code in a text editor or under a .txt name, and goes blank when its script can't run. Each fix, and what file://error_page_loaded.html is.
- How to open an HTML file in Safari on iPhone, iPad, and MacOpen an .html file in Safari on a Mac with File > Open File, Open With, or Terminal. On iPhone and iPad, Files shows a preview that runs no scripts.
- How to play an HTML game on your iPhone or Android phoneTapping game.html often opens a preview that doesn't run the game. Play it once in Safari or Chrome with a free viewer, or from a link that keeps high scores.
- How do I open an HTML file in Chrome mobile on Android, and send one that opens?Open an HTML file in Chrome mobile on Android: tap it in Files, choose Chrome, and tap Just once. HTML Viewer ran no scripts in our test. Or use a free viewer.
- How to make an HTML file on your iPhone or Android phoneNotes and Messages keep HTML code as text, not a page. Run the code in a free viewer, get a link, or save a real .html file on iPhone or Android.
AI Skill Pod
Share AI skills with your team, the easy way
Everyone uses your team's skills in their own ChatGPT, Claude or Gemini, on any plan. Send one invite link. Free to start.
Start free on AI Skill Pod