HTML to link · Free
Host an HTML file online free and get a shareable link
You have an .html file, or some HTML code in a chat window, and you want a link you can send to someone. Here is how, and how to fix the usual reasons it looks broken once it is online.
To host an HTML file online for free, open our upload tool, drop your .html file (or a ZIP of the folder with its images and CSS), or paste the HTML code, and press publish. You get a live link in seconds, with no account. The link lasts 4 hours, or 24 hours once you confirm your email; a hosting plan keeps it online permanently.
An HTML file on your laptop opens fine when you double-click it, but nobody else can see it. To share it you need it on a web server, which gives it an address starting with https://. This page covers the quickest way to get that address, what to upload when your page has images or separate CSS files, and the small mistakes that make a page look perfect on your computer and broken online.
Key takeaways
- A single HTML file, a folder or a ZIP can all be turned into a link in seconds on our upload page.
- If your page uses images or separate CSS and JavaScript files, upload them together, keeping the same folder structure.
- Most "broken" pages are caused by file paths that point at your own computer, or by capital letters in file names.
- A preview link is temporary. For a permanent address, put the same files on a hosting plan.
Turn an HTML file into a link in under a minute
Drop the file on our upload page and you will have a working link straight away. No account, no card and no software to install.
- Open the upload page in any browser, on a laptop or a phone.
- Drag your
.htmlfile onto the drop area, choose a folder or ZIP, or switch to the paste box and paste the code. - Press publish. The page checks your files and gives you a link within a few seconds.
- Open the link yourself first, then share it. Confirm your email address, with the 6-digit code we send, if you want it kept for 24 hours instead of 4.
Uploads can be up to 20 MB and 300 files, which is plenty for an HTML page or a small multi-page site.
Single file, folder or ZIP: what to upload
Upload exactly what your page needs to display, in the same layout it has on your computer. The table below shows what to send for the common cases.
| What you have | What to upload | Watch out for |
|---|---|---|
| One .html file with the CSS inside a <style> tag | Just the file, or paste its code | Images referenced from your computer will not travel with it |
| index.html plus style.css and script.js | The folder, or a ZIP of it | Keep all three in the same place they were when it worked locally |
| Several pages with an images folder | A ZIP of the whole folder | The home page must be named index.html |
| HTML code in a chat or an online editor | Paste it into the paste box | Code split into separate HTML, CSS and JS boxes needs combining first |
| A project with a package.json file | The built output, usually the dist/ folder | Run the build first; source code is not a website yet |
If the ZIP has everything inside one top folder, that is fine. If your only page has a different name, such as portfolio.html, it will normally be used as the home page, but renaming it to index.html avoids any doubt.
Fix these before you upload
Pages break online for a handful of predictable reasons, and all of them are quick to fix. Open your HTML in a text editor and check for these.
- Paths that point at your computer. Anything like
C:\Users\Priya\Desktop\photo.jpgorfile:///only works on your laptop. Change it to a relative path such asimages/photo.jpg. - Backslashes. Windows uses
images\logo.png; the web uses forward slashes:images/logo.png. - Capital letters. Web servers usually treat
Logo.PNGandlogo.pngas different files. Windows does not, which is why it worked at home. - Spaces in file names.
my photo.jpgbecomesmy%20photo.jpgand often goes wrong. Use hyphens instead. - Huge images. A 6 MB camera photo makes a page slow on mobile data. Resize photos to around 1,600 pixels wide before uploading.
Fonts, icons and libraries loaded from a public CDN, such as Google Fonts, keep working online because they never lived on your computer in the first place.
Hosting HTML code you only have as text
You do not need to save a file at all. Paste the code into the paste box on the upload page and it is published as index.html.
This suits code from ChatGPT, Claude or Gemini, or from a tutorial. If the AI gave you HTML, CSS and JavaScript as three separate blocks, ask it for "a single index.html file with the CSS and JavaScript inline" and paste that. If the code contains import React or export default, it is a React component rather than a web page; ask the AI to convert it to plain HTML. Our guide to hosting a website made with ChatGPT or Claude goes through this in more detail.
What a preview link will not do
A preview is for showing a page, not for running one. Knowing the limits saves you a confused hour.
- Forms do not submit, so a contact form will look right but send nothing.
- Pages with password or login fields, or fields for card details, are refused.
- Previews are hidden from Google and other search engines, and show a small badge.
- The link expires after 4 hours, or 24 hours if you confirm your email.
Keeping your HTML page online permanently
For a page that stays up at your own address, put the same files on a hosting plan and connect a domain. On our cPanel plans that means uploading the files into the public_html folder with File Manager.
A single HTML page with a few images fits comfortably in our smallest cPanel plan at ₹900 a year plus GST. You also get free SSL, so the page loads over https://, and email on your domain. Our page on hosting a website using cPanel shows the upload step by step.
If the page is a personal project and you are comfortable with GitHub, GitHub Pages will also host an HTML file permanently for free, on a github.io address.