How to share an HTML file on Discord so people can open it
Quick answer
To share an HTML file on Discord so people can open it, send a link, not the file. Discord takes files up to 20MB without Nitro, but its help says non-image files arrive without a preview, and pasted code over 2000 characters can go out as a text file. A link opens the page in a browser, scripts and all.
Free plan: no credit card, 1 published page, 50 form entries a month.
On this page
- What Discord does with an HTML file
- Why pasted code turns into message.txt
- Why the file doesn't play for your friends
- The file or a link, compared
- When to send the file itself
- Share an HTML game or page on Discord as a link in 4 steps
- What your friends see when you paste the link
- Keep the game to your server, or let anyone find it
- How to open an HTML file someone sent you on Discord
- Frequently asked questions
You asked ChatGPT or Claude for a game, a quiz, or a small page, and it works on your computer. Now you want the people in your Discord server or DM to play it. You drop the .html file into the chat, or paste the code, and what your friends get is a file or a wall of code, not the game.
If you haven't made the game yet, Make a game with AI for free, no coding, and send friends a link they can play covers what to ask the AI.
What Discord does with an HTML file
Discord takes the file. It doesn't turn it into a page. Here is what Discord's own help says, read on October 27, 2026:
- How to send it. Tap the plus sign in the text field of the channel or DM, tap Upload a File, and pick the file (File Attachments FAQ).
- How big it can be. “For non-Nitro subscribers, the maximum file upload is 20MB.” The same FAQ says Nitro Basic offers 50MB and Nitro up to 1GB, and that Discord is “experimenting with various file upload size limits,” so some accounts can send more.
- What your friends see. “If you attach non-image files, such as a PDF, DOC, etc. the files will display as embeds in your message and will not provide a preview of the attached file.”
- Plain text files. Discord's File Preview article says people can read a plain text file without downloading it: up to 100 lines in the chat with Expand, and up to 50kb in a popup.
Discord's help doesn't say whether it treats an .html file as a plain text file. Either way, nothing in that help describes running one: at best your friends read your code, and otherwise they get an attachment with no preview. We didn't sign in to Discord for this guide, so we haven't checked how the app shows an .html attachment on each device.
Why pasted code turns into message.txt
Pasting the code into the chat doesn't work either. Discord's File Preview article says “Copy and pasted messages larger than 2000 characters can also be sent as plain text files,” and Nitro raises that cap to 4000. A game ChatGPT writes is usually longer than that, so your message can go out as a text file. Your friends can scroll through the code. They can't play it.
Why the file doesn't play for your friends
Even when a friend downloads the file, it can miss what the game needs.
- Files the page loads by name stay on your computer. If the game keeps code in
game.js, styles instyle.css, or sprites inplayer.png, Discord sends only the file you picked. In our test on October 13, 2026, in Chromium, a page copied away from its folder lost its separate CSS, image, and script; only the CSS written inside the.htmlfile still applied. - A phone's file preview isn't a browser. On an iPhone, a saved
.htmlfile opens in a preview screen. In our test on October 6, 2026, in Apple's iPhone Simulator on iOS 26.3, that preview ran none of the page's JavaScript, so a game's Start button does nothing (How to share an HTML file as a link has the full test).
A link avoids both. The page sits at a web address, and your friend's phone opens it in a real browser that runs its scripts.
The file or a link, compared
The .html file in Discord | A link to the published page | |
|---|---|---|
| What your friends tap | An attachment, or the code as text | An address that opens the page |
| Scripts run on a phone | Not in the iPhone Files preview, in our simulator test | Yes, in the phone's browser |
| Other files the page needs | Left behind on your computer | Inside the one file, or at https:// links |
| When you fix a bug | Post a new file; the old one stays in the chat | Upload the fixed file as a new version and publish it at the same link (how) |
| Who came to play | No count | Visits by day, country, and device in your Convika dashboard |
| Size | 20MB without Nitro, per Discord's help | Up to 2 MB for the one HTML file on Convika |
When to send the file itself
Send the file when someone needs the code, not the game: a friend who will change it, or a teacher who marks your HTML. They open it on a computer. Everyone who only has to play needs the link.
Share an HTML game or page on Discord as a link in 4 steps
Convika's upload box is one way to get a link. For other hosts, such as itch.io, GitHub Pages, and Netlify Drop, see How to publish a game you made with ChatGPT, which compares 5 of them for one-file games.
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 the game is split into several files, ask the AI that made it: “Give me the whole page as one HTML file, with the CSS and JavaScript inline and full https:// links for images and sounds.”
2. Drop the file or paste the code
Drag the file into the box at the top of this page, or select Paste code and paste everything from the first line to the closing </html>. Click Get my preview link. You don't need an account or an email address. If the code still points to files on your computer, the box lists them so you can fix those first.
3. Check the layout, then keep the page so its scripts run
When you see “Your preview is ready,” click Copy link and open it on your own phone. This preview has scripts and forms turned off, so a game shows its title and buttons but doesn't start. It works for 3 minutes. When the layout looks right, click Keep this page — free, no card and sign up. The page moves into your account as you uploaded it, and your dashboard gives you a new preview link where its scripts run. Play the game there, on your phone too, before anyone else sees it. If taps or the screen size are off, Fix an AI-made HTML game that works on a computer but not a phone covers the usual fixes.
4. Publish it and paste the link in Discord
Send the published address of the page, not the preview link. Click Publish page, choose Public under Who can open this page?, and click Next. The first time, click Publish free. The page goes live at an address like yourpage.convika.page, with the small Convika bar at the bottom. Paste that address in the channel or DM. Your friends open it in their browser and play, with no Convika account.
What your friends see when you paste the link
Discord's article About Discord Link Previews and the Discordbot says that when a link is shared, Discord “automatically visits that link to grab information about the page, like its title, description, and image” to build the card under your message. A page's title is the <title> in its HTML, or its og:title if the AI added one, so ask the AI for a clear title, such as “Block Dodge — tap to start,” before you upload.
That visit comes from Discordbot, not from a person. Convika leaves Discordbot out of your visitor counts, so the card doesn't add a visitor to your dashboard. For what the numbers mean, see How to see who visits your page.
Keep the game to your server, or let anyone find it
Public is the free choice when you publish. Anyone with the link can open the page, and it may show up in search results and in Convika's gallery. To keep a game made for your friends out of both, choose Private link (Pro) instead; anyone with the link can still play it without a password, including people your friends forward it to. Only people with the password (Pro) shows a password screen first. On Free, picking either one and clicking Next brings up the order for Pro monthly (1 day free with a card, then $12 a month); its link Make it public and publish free publishes the page as Public on Free instead. See How to password protect an HTML page for what visitors see.
How to open an HTML file someone sent you on Discord
Ask the sender for a link, so the page opens in your browser. Don't open a file you weren't expecting. If you already saved a file you trust, open the free HTML viewer in Chrome or Safari and tap Choose an .html file. If what you got is a message.txt with code in it, copy the code, open Paste code in the viewer, and click Show the page. The viewer runs in your browser and doesn't upload the file. If you're unsure about the file, turn off Run scripts first, so none of its scripts run and its forms can't send anything.
Frequently asked questions
Can you send an HTML file on Discord?
Yes. Tap the plus sign in the text field, tap Upload a File, and pick it. Without Nitro, Discord's help gives 20MB as the largest upload. Your friends get an attachment, not a page that runs. To let them play or look, send a link to the published page instead.
Why does Discord turn my code into message.txt?
Discord's help says pasted messages larger than 2000 characters can be sent as plain text files (4000 with Nitro). Most HTML games are longer than that. Put the code in one file, publish it, and paste the link instead.
Can my friends play an HTML game from Discord on their phone?
Not from the file. In our test in Apple's iPhone Simulator, the iPhone's file preview ran no JavaScript, so the game doesn't start. Publish the game and send the link; it opens in the phone's browser, where taps and scripts work.
What is Discord's file size limit?
Discord's File Attachments FAQ, read on October 27, 2026, gives 20MB for non-Nitro accounts, 50MB with Nitro Basic, and up to 1GB with Nitro. It also says Discord is testing other limits, so some accounts can send more.
How do I update a game I already shared on Discord?
Upload the fixed HTML file to the same page in Convika under Update from an HTML file, check the preview, and publish it. The link you posted in Discord opens the new version. Update your AI-made page without changing its link or QR code has the steps.
Why does the Discord preview card show the wrong name?
Discord builds the card from the page's own information, such as its title and description. Change the <title> in your HTML (and the og:title, if the page has one), publish the new version, and post the link again. Discord may still show the card it made before; we haven't tested how long it keeps one.
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
- How to publish a game you made with ChatGPT so friends can play itPut a one-file HTML game from ChatGPT online for free and send friends a link. itch.io, GitHub Pages, Netlify Drop, CodePen, and Convika compared, with steps.
- Make a game with AI for free, no coding, and send friends a link they can playNo game-maker app needed: ask ChatGPT, Claude, or Gemini for a one-file HTML game, test it on your phone, and publish it free as a link friends can play.
- How to share an HTML file as a link that opens on any phoneEmail and Google Drive open HTML on a phone without scripts. Compare 5 hosts (Netlify Drop, Tiiny Host, Pagelive, GitHub Pages, Convika) and follow 4 steps.
- Fix an AI-made HTML game that works on a computer but not a phoneFix touch controls, offset taps, unwanted scrolling, and silent audio in an AI-made HTML game. Includes repair prompts, code, and a phone test checklist.
- ChatGPT, Claude, or Gemini gave me HTML code: how do I run it and see the page?Copy the whole code block, paste it into a free HTML viewer, and the page runs in your browser. What each AI's own preview does, and how to save it as .html.
- Why does my HTML file open as code (or a blank page) instead of a page?An HTML file shows code when an editor, a preview, or a .txt name opens it, and goes blank when its script can't run. Our October 2026 tests, and each fix.