Skip to main content
All articles
  • Static Sites
  • Hosting
  • Static Hosting

What Is a Static Website? Static vs Dynamic, With Examples

Published 12 min read

On this page 8 sections

A static website is a set of ready-made files (HTML, CSS, JavaScript and images) that the server sends to every visitor exactly as they are stored. No code runs on the server and no database is queried when someone opens a page. A dynamic website builds each page on the server at the moment someone asks for it.

The first pages on the web were static, hand-written HTML files that every visitor got in the same form. Content management systems arrived so nobody had to hand-code every page, and most sites went dynamic by default. Static site generators have since brought the old model back with better tooling, which is why the static vs dynamic website question is a live one again, and one you can answer from a terminal.

What is a static website?

Wikipedia defines a static web page as one "delivered to a web browser exactly as stored", in contrast to a dynamic page "generated by a web application". MDN puts it from the server's side: a static server sends its hosted files to your browser as they are. So the static website meaning has nothing to do with whether the page moves or changes on screen. "Static" describes what the server does with each request, which is to find a file and hand it over.

What qualifies as a static website comes down to three things:

  • Every visitor who requests the same URL gets the same files.
  • No server-side code runs and no database is read when a page is requested.
  • The content changes when someone uploads new files, and only then.

JavaScript in the browser doesn't make a site dynamic. Dropdown menus, animations, a carousel, even a full React app: the server still sends the same files to everyone, and the moving parts run in the visitor's browser afterward. Browser code has its limits, though; as developer Eduardo Bouças put it in a 2015 introduction to static site generators, client-side processing "must not be seen as the magic solution that turns your static site into a full dynamic one".

Static doesn't mean frozen. A static site changes as often as you like; you change it by replacing the files. A blog that publishes daily can be static, as long as each post is a file that exists before anyone asks for it.

Which answers the question beginners trip over most: is a React app a static website? Usually yes, once it's built. Running npm run build in a Vite project puts plain HTML, CSS and JavaScript in a dist/ folder, and Vite's docs file the deploy step under "Deploying a Static Site". Next.js is the one to check: a default build expects a Node.js server (next start), even for pages it renders ahead of time, and only output: 'export' writes an out/ folder of HTML files for a static host, minus cookies, rewrites, redirects, custom headers and Server Actions (per the Next.js static exports guide, checked November 2026).

How a static website works (and how a dynamic one does)

Here's the difference for one request, side by side:

text
Static:   browser asks for /about
          -> server finds about.html
          -> server sends it

Dynamic:  browser asks for /about
          -> server runs code (PHP, Node.js, Python...)
          -> code queries a database
          -> code fills an HTML template with the result
          -> server sends the finished HTML

MDN describes a dynamic web server as a static one plus "extra software, most commonly an application server and a database," and names MDN and Wikipedia as sites built from "a few HTML templates and a giant database". Wikipedia still fits: MediaWiki, a PHP application, assembles each article from templates and a database. MDN has since come full circle; run the header check later in this post on an MDN page and its headers (x-goog-storage-class, x-goog-stored-content-length) read like a file stored in Google Cloud Storage, so the page explaining dynamic servers now looks to be served the static way. WordPress works like Wikipedia, which is why its requirements page asks for PHP and a MySQL or MariaDB database.

Static site generators sit in between, and they're the reason static sites came back. Cloudflare's Learning Center describes a generator as a tool that builds "a full static HTML website based on raw data and a set of templates," doing the templating ahead of time "instead of in response to a user's request." Put plainly, it's the dynamic step done once on your machine, before upload, so the server only ever hands out files. Hugo, Jekyll, Eleventy and Astro all work this way; our post on where to host a static Astro site covers what the dist/ folder looks like in practice.

Static vs dynamic website: the differences

The difference between a static and a dynamic website is when each page gets built. A static site's pages exist as finished files before anyone asks for them, while a dynamic site builds each page on the server, per request, usually from a database. The pros and cons in the table follow from that.

Static websiteDynamic website
How a page is madeStored in advance as a fileBuilt by server code on each request
Same page for every visitor?Yes, for a given URLCan differ by visitor, login, location or time
Server code and databaseNone per requestRuns code, usually reads a database
SpeedFew steps per request; files cache easily on a CDN, though visitors may see a stale copy until caches clearMore steps; needs caching to match
Security surfaceNo server code, plugins or database to attack; the host still mattersServer code, plugins and database all need patching
Hosting and upkeepAny static host or file storage; little to updateNeeds a server runtime and database; regular updates
Forms, logins, search, comments, checkoutOnly through outside services or browser JavaScriptCan run on your own server

There's a middle ground, and most real static sites live in it. They borrow the dynamic parts from services: a form backend such as Formspree for the contact form, a hosted comments widget, search that runs in the browser (Fuse.js) or on a hosted service (Algolia), both paid-tier integrations in the Simply Static plugin, and a payment link from Stripe for the one thing you sell. Cloudflare calls this pattern Jamstack: the site stays static, with "APIs used for any backend functionality."

How can you tell if a website is static?

Read the response headers (curl -I in a terminal, or the browser's Network tab: reload, click the HTML document, read Response Headers) and look first for anything that names the software behind the page: a generator tag, storage headers such as x-goog-* or x-amz-*, an x-powered-by line or a WordPress wp-json link. last-modified, etag and accept-ranges: bytes fit a stored file, but caches and frameworks send them too, so treat every check as a clue. We ran each command below on November 12, 2026, against public sites, and trimmed the output to the lines that matter.

1. Read the response headers with curl. One command, any terminal:

bash
$ curl -sI https://jekyllrb.com/
HTTP/2 200
server: GitHub.com
content-type: text/html; charset=utf-8
last-modified: Tue, 13 Oct 2026 18:44:50 GMT
etag: "6ace7c22-2899"
cache-control: max-age=600
accept-ranges: bytes

Every line there fits a stored file: the server knows when the file last changed, has a fingerprint for it and can send part of it. The stronger clue is server: GitHub.com, since Jekyll's own site is served from GitHub Pages, which only serves static files.

Compare WordPress's news blog:

bash
$ curl -sI https://wordpress.org/news/
HTTP/2 200
server: nginx
content-type: text/html; charset=UTF-8
link: <https://wordpress.org/news/wp-json/>; rel="https://api.w.org/"
link: <https://wp.me/PZhYe-45S>; rel=shortlink

No last-modified, no etag, and a link header pointing at /wp-json/, the WordPress REST API. That's a page built by PHP. On other sites, x-powered-by: PHP/... or x-powered-by: Next.js names the server code outright; a session cookie hints at per-visitor pages, though CDNs set cookies too.

Here's the full set of sites we checked:

SiteWhat the headers and page source showedOur read
jekyllrb.comserver: GitHub.com, last-modified, etag, accept-ranges; a Jekyll generator tagStatic (Jekyll on GitHub Pages)
gohugo.ioserver: Netlify, etag, accept-ranges, a Netlify edge cache hit; no generator tagStatic, most likely
www.11ty.devserver: Vercel, last-modified, etag, a Vercel cache hit; an Eleventy generator tagStatic (Eleventy)
docusaurus.ioA Netlify edge cache hit behind Cloudflare; a Docusaurus generator tagStatic (Docusaurus)
developer.mozilla.org (a docs page)server: Google Frontend, x-goog-storage-class, x-goog-stored-content-length, last-modified, etagStatic, by its storage headers
wordpress.org/news/server: nginx, link to /wp-json/, no etag or last-modified; a WordPress generator tagDynamic (WordPress)
en.wikipedia.org (an article)last-modified, accept-ranges, cache-control: private, several set-cookie lines, a cache hit; a MediaWiki generator tagDynamic (MediaWiki), served from a cache
docs.github.comx-powered-by: Next.js, x-cache: HIT, HIT from a Varnish cacheDynamic, served from a cache

The last two rows are the caveat in action: server code builds both, yet a cache sits in front, so most visitors get a stored copy, and Wikipedia's response even carries last-modified and accept-ranges. It cuts the other way too; gohugo.io, a static site, sends cache-control: public,max-age=0,must-revalidate, telling the browser to check back on every visit. That's why the headers that name the stack count for more than the ones that describe the file.

2. Look at the URL and the page source. A .php or .aspx URL, or paths under /wp-content/, point at server code. Many generators also leave a calling card:

bash
$ curl -s https://jekyllrb.com/ | grep -o '<meta name="generator"[^>]*>'
<meta name="generator" content="Jekyll v4.4.1" />

$ curl -s https://wordpress.org/news/ | grep -o '<meta name="generator"[^>]*>'
<meta name="generator" content="WordPress 7.2-beta5-65405" />
<meta name="generator" content="Seriously Simple Podcasting 3.17.1" />

gohugo.io and MDN carry no tag at all, so a missing tag proves nothing.

3. Log in, or compare two visitors. If the page greets you by name, shows a cart, or differs between two browsers in the same moment, something is building it per visitor, either on the server or in the browser with an API behind it.

Static website examples

jekyllrb.com, gohugo.io, 11ty.dev and docusaurus.io are all static websites by the checks above, and so, these days, is MDN. By kind, with what each one borrows to stay static:

  • Portfolio. Pages and images that change when you add work; the contact form goes to a form service. See how to host a portfolio website.
  • Documentation site. Docusaurus, MkDocs and Astro Starlight build docs into a folder of HTML; search runs in the browser or comes from a hosted service.
  • A blog built with a static site generator. A generator turns Markdown posts into pages at build time; comments come from a hosted widget.
  • A résumé or a single HTML page. One file, nothing borrowed; see how to make a resume link or how to host an HTML file online.
  • An AI-built page. Claude and ChatGPT often hand you a single HTML file. With Lovable, it depends on when the project was started: older apps build into a static dist/ folder, but new projects since May 13, 2026 run on TanStack Start, which renders pages on a server. More in how to deploy a Lovable app.
  • An exported Webflow site. Plain HTML, CSS and JavaScript, with forms that don't submit until you point them at a form service; exporting code from Webflow covers what else stays behind.
  • A WordPress site exported to static files. Simply Static does the conversion, and forms, search and comments need outside services afterward; see WordPress to a static site.
  • A single-page app build. A React or Vue app built with Vite, with routing done in the browser. The catch: open or refresh a deep link such as /dashboard and the host looks for a file that doesn't exist and returns a 404, unless it serves index.html for unknown paths (a rewrite rule) or the app uses hash URLs like /#/dashboard.

For contrast, dynamic examples: Wikipedia and wordpress.org/news/ from the checks above, an online store's checkout, online banking, a social media feed and a webmail inbox.

When you need a dynamic website

Vendor explainers tend to say static is better for everything, which is how people end up bolting six services onto a site that wanted a server. Static is the wrong pick when the core job needs:

  • user accounts and logins as the main feature
  • a shopping cart and checkout with stock levels
  • content that differs per visitor, such as dashboards or recommendations
  • real-time data such as prices, chat or live scores
  • many editors publishing through a CMS every day

There are in-betweens before you commit to a server. WordPress can stay as a private editor and publish static copies through the export mentioned above. Markdown files edited through a Git-based CMS give non-developers a familiar editor without a database; our comparison of CMS options for Astro covers that route. And member-only pages don't always need a dynamic site, since many hosts can put a password or an email list in front of static files; see how to password protect a website.

Where to host a static website

Because a static site is just files, any static host can serve it, and moving between hosts is mostly an upload and a DNS change, plus any redirect or header rules you set up on the old one. GitHub Pages, Netlify and Cloudflare Pages all do it; our GitHub Pages alternatives comparison lays out their limits side by side, and how to publish a website from a folder walks through the upload routes step by step.

That portability is the long-run case for static. CERN serves a restored copy of the first website at info.cern.ch, and when we requested its first page on November 12, 2026, the server answered with last-modified: Thu, 03 Dec 1992. A database-backed site from that decade would have needed every server and runtime upgrade since to keep answering; a folder of HTML needs a web server, and any one will do.

If you'd rather skip Git and a hosted build pipeline, Hostsmith's static website hosting takes the finished files in the browser. Run your build as usual, zip the output folder (dist/, public/ or out/) or grab the single index.html, drop it there and sign in, and you'll have a link to send.

Frequently asked questions

Is WordPress a static website? Not by default. PHP builds each WordPress page from a MySQL or MariaDB database when someone requests it.

Can you host a static website for free? Yes, on several hosts. GitHub Pages hosts sites up to 1 GB with a soft bandwidth limit of 100 GB a month, though its docs say it's not for running an online business or e-commerce site; Cloudflare Pages and Netlify also have no-cost plans with their own caps (all checked November 2026). Hostsmith has a Free plan: 1 site on a your-site.us.hostsmith.link or your-site.eu.hostsmith.link address, 5 MB of storage (which is also the largest single file) and 5 GB of bandwidth a month, with Hostsmith branding, as of November 2026.

Is a React app a static website? Usually, once it's built. A Vite build is a folder of HTML, CSS and JavaScript that a static host can serve; if the app routes in the browser, the host also needs to send index.html for unknown paths, or the app needs hash URLs.

Is a static website better for SEO? It helps at the edges: pages arrive as complete HTML and tend to load quickly. Search engines still rank content and links first, so a fast static page with thin content won't beat a slower page that answers the question better.

Is an HTML file a static website? Yes. A single index.html is the smallest possible static website, and it works on any static host.