Topic guide
Hosting HTML
Everything you need to turn a file on your computer into a page anyone can open, in the order you will need it.
An HTML file is already a web page. The only thing missing is a server that hands it to other people’s browsers. Static hosts do exactly that: you give them files, they give you a link. No database, no install, and for small sites, usually no bill.
What you need before you start
- One main file called
index.html. Hosts serveindex.htmlautomatically when someone visits the root of your link. A file calledfinal-v3.htmlwill only load if people type its full name. - Every file the page uses. Stylesheets, scripts, images and fonts that your HTML points to must be uploaded too, in the same folder layout.
- Relative paths.
images/logo.pngworks anywhere.C:\Users\you\Desktop\logo.pngonly works on your computer.
Not sure what your page depends on? Paste it into the free HTML path checker. It lists every file reference and flags the ones that will break.
Step 1: Organize the folder
A tidy folder avoids most problems. A typical small site looks like this:
my-site/
index.html
about.html
css/style.css
images/logo.png
Use lowercase file names with hyphens instead of spaces. Many servers treat Logo.PNG and logo.png as different files, so a link that worked on your laptop can fail online.
Step 2: Check it locally
Open index.html in your browser by double-clicking it. Click every link and look for missing images. Then open your browser’s developer tools (right-click, then Inspect) and look at the Console tab for red “not found” errors. If you want a quick visual check of a single file, paste it into the HTML previewer.
Step 3: Pick a host
For a single page or a small folder, any static host works. The main differences are how you upload and what the free plan includes.
| Upload method | Typical hosts | Best for |
|---|---|---|
| Drag and drop in the browser | Netlify Drop, Tiiny Host, Cloudflare Pages | One-off pages, no account setup fuss |
| Git repository | GitHub Pages, Netlify, Vercel, Cloudflare Pages | Pages you will edit often |
| Command line | Most of the above | Developers who already use a terminal |
Free plans change, so check the current limits on the host’s own pricing or documentation page before you commit. Our free hosting alternatives guide compares the trade-offs in plain language, and the file size checker tells you whether your folder fits a limit before you upload.
Step 4: Upload
- Single file: rename it
index.htmland upload or drop it. - A folder: upload the folder itself, so
index.htmlsits at the top level, not inside another folder. - A zip: many drag-and-drop hosts accept a zip and unpack it. Make sure
index.htmlis at the top of the zip, not insidemy-site/my-site/.
After a few seconds the host gives you a link, usually a subdomain of the host such as your-name.example-host.app.
Step 5: Test the live link
Open the link in a private or incognito window so you see what a visitor sees. Check:
- The page loads without a sign-in
- Images, fonts and styles all appear
- Links between pages work
- It looks right on your phone
- The tab shows a sensible title
If styles are missing, a path is wrong. A leading slash (/css/style.css) is a common culprit on hosts that put your site in a subfolder.
Step 6: Add a custom domain (optional)
A custom domain such as yourname.com looks more trustworthy than a long host subdomain. The steps are similar everywhere:
- Buy the domain from any registrar.
- Add it in your host’s settings.
- Copy the DNS records the host shows you into your registrar’s DNS settings.
- Wait for the change to spread, which can take from a few minutes to a day.
- Turn on HTTPS if the host does not do it automatically.
Updating the page later
To change the page, edit the file and upload it again. Drag-and-drop hosts usually replace the old version; Git-based hosts update when you push a change. Keep a copy of the folder on your computer, because that is your real source.
Common problems and quick fixes
| Problem | Likely cause | Fix |
|---|---|---|
| 404 at the root link | No index.html at the top level |
Rename the main file or move it up a folder |
| Page loads with no styling | Wrong stylesheet path | Use a relative path like css/style.css |
| Images missing | Files not uploaded, or name case differs | Upload them and match names exactly |
| Works on desktop, tiny on phone | No viewport tag | Add <meta name="viewport" content="width=device-width, initial-scale=1"> |
If your page came from an AI assistant, read AI-made pages next. If you need to edit the HTML itself, start with HTML and CSS basics.
Tools
Free tools
Small, free tools that run right in your browser. No sign-up, nothing to install.
-
HTML previewer
Paste HTML and CSS, see it live in a safe sandbox, then download it as an index.html file.
Open tool -
File size checker
See if your files fit a host's upload limits before you try. Nothing is uploaded.
Open tool -
HTML path checker
List every link, image and script in a page and flag the paths that will break once hosted.
Open tool