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.

In short

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.

  1. Open the upload page in any browser, on a laptop or a phone.
  2. Drag your .html file onto the drop area, choose a folder or ZIP, or switch to the paste box and paste the code.
  3. Press publish. The page checks your files and gives you a link within a few seconds.
  4. 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 haveWhat to uploadWatch out for
One .html file with the CSS inside a <style> tagJust the file, or paste its codeImages referenced from your computer will not travel with it
index.html plus style.css and script.jsThe folder, or a ZIP of itKeep all three in the same place they were when it worked locally
Several pages with an images folderA ZIP of the whole folderThe home page must be named index.html
HTML code in a chat or an online editorPaste it into the paste boxCode split into separate HTML, CSS and JS boxes needs combining first
A project with a package.json fileThe built output, usually the dist/ folderRun 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.jpg or file:/// only works on your laptop. Change it to a relative path such as images/photo.jpg.
  • Backslashes. Windows uses images\logo.png; the web uses forward slashes: images/logo.png.
  • Capital letters. Web servers usually treat Logo.PNG and logo.png as different files. Windows does not, which is why it worked at home.
  • Spaces in file names. my photo.jpg becomes my%20photo.jpg and 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.

Frequently asked questions

How do I turn an HTML file into a link?

Upload the file to a web server. The quickest way is our free upload page: drop the .html file or paste its code, press publish and copy the link. For a permanent link at your own address, upload the same file to a hosting plan and connect a domain.

Does my file have to be called index.html?

It is safest. Web servers open index.html automatically when someone visits a folder or a domain, so your home page should use that name. Other pages can have any name, such as about.html, as long as your links match the file names exactly, including capital letters.

Why are my images missing after I upload my HTML page?

Usually the image path points at your own computer, such as C:\Users\... or file:///, or the image file was not uploaded with the page. Put images in a folder next to your HTML, use relative paths like images/photo.jpg, check the capital letters match, and upload the whole folder.

Can I host HTML code without saving a file?

Yes. Paste the code into the paste box on our upload page and it is published as index.html. If your code is split into separate HTML, CSS and JavaScript parts, combine them into one file first, with the CSS in a style tag and the JavaScript in a script tag.

Will JavaScript work on my hosted HTML page?

Yes. JavaScript runs in the visitor's browser, so it works on a preview link and on any hosting plan. What does not work on a preview is anything that needs a server, such as a form that emails you or a login. Those need a hosting plan with PHP.

WhatsApp