Websites, domains and files

What is a static site?

Definition

A static site is a website made only of ready-made files (HTML, CSS, JavaScript and images) with no server code or database. You can publish one by uploading a ZIP of the folder.

Also called: Static website, Static HTML site, Static web hosting

How does a static site work?

Every page already exists as a file, and the server just sends it. When someone opens /about, the host finds about.html or about/index.html and returns it as is. Nothing is built on the fly and there is no database to query.

That makes static sites fast, cheap to host and hard to break. A CDN can keep copies close to visitors, and there is no server code for attackers to target. JavaScript still runs in the visitor's browser, so menus, tabs, galleries and animations all work. Most hosts give the site a subdomain, and you can point a custom domain at it.

What is the difference between a static and a dynamic site?

A static site sends the same files to everyone, and a dynamic site builds each page when it is requested. Dynamic sites run code on a server, often with a database, which is how logins, shopping carts and comment threads work.

Many sites that look dynamic are static underneath. Blogs, docs, portfolios, landing pages and event pages rarely change between visits, so they can be built once and served as files. A static site generator or a front-end framework does that build and puts the result in a folder such as dist or build, which you can pack into one ZIP file to upload.

What can't a static site do?

It can't run code on the server or keep data between visits by itself. Hosts also differ in what a site may load: some let pages call outside services from the browser, and others block anything that isn't on the site's own address, for safety. Without a separate service or a host that runs server code, a static site can't offer:

  • User accounts and server-side logins.
  • A database, such as orders or saved posts.
  • Server languages like PHP, Python or Ruby.
  • Secret keys, since every file is readable by the browser.
Static and dynamic sites side by side
Static siteDynamic site
PagesFiles built in advanceBuilt for each request
Server codeNonePHP, Node, Python and similar
DatabaseNoUsually
HostingAny file host or CDNNeeds a running server

Static site: common questions

Is a static site the same as an HTML page?

A single HTML page is the smallest static site. A full site adds more pages, styles, scripts and images, linked together in one folder.

Can a static site have a contact form?

Not on its own, because it has no server to receive the message. Some hosts let a form post to an outside form service and others block outside calls, so check the host's rules first.

Do I need to know how to code to make a static site?

No. Many site builders and templates can export a ready folder of files. You only need that folder, with an index.html at the top.

Are static sites good for SEO?

They can be. They load fast and every page is plain HTML a search engine can read. Content and links still matter more than how the site is built.

Why does my static site show a blank page?

Usually a wrong path. Check that index.html is at the top of the folder and that files are linked with relative paths, then look in the browser console for files that failed to load.

Go deeper

Updated

Share a file as a link in seconds

Upload any file and get one clean link, with every setting on this page.

Try Link in Seconds

Optional cookies for analytics, ads and session replay.