Static site generation (SSG) is a way of building websites where every page is rendered to plain HTML ahead of time, during a build step, and then served as ready-made files.

Definition
Static site generation turns templates, components and content into finished HTML files before anyone visits the site. A build tool reads content from Markdown files, a headless CMS or an API, combines it with layout code and writes out one HTML file per page along with CSS, JavaScript and images. Those files are deployed to a web server or CDN and delivered as is.
Static does not mean the site cannot be interactive. A statically generated page can still load JavaScript for menus, forms, search or embedded app components. What is static is the initial HTML: it is the same for every visitor and does not have to be computed on a server when the request arrives. Tools such as Next.js, Astro, Gatsby, Hugo, Eleventy and Jekyll all support this approach.

How it works
During the build, the generator collects every route the site should have. For dynamic routes, such as one page per blog post or product, it asks the data source for the full list of items. It then renders each route, fetching the data that page needs, and writes the output to a folder of HTML and asset files. The build fails if a page cannot render, which surfaces problems before anything goes live.
The output is deployed to static hosting or a CDN, which caches files close to users around the world. Because there is no per-request rendering, pages can be served very quickly and the hosting has fewer moving parts to secure or scale. A typical workflow triggers a new build automatically when code is merged or when an editor publishes content.
For larger sites, rebuilding every page on each change becomes slow. Some frameworks offer incremental regeneration, which rebuilds individual pages in the background after a set time or when the CMS sends a webhook, while visitors continue to receive the cached version. That keeps most of the speed of static pages while letting content update without a full rebuild.
Keep learning
Put it into practice
Fast, secure and accessible web applications built with React and Next.js, designed for real users and real traffic.
Explore serviceResearch-led product design, prototypes and design systems that make complex software clear, usable and ready to build.
Explore serviceFAQ
Yes. A static page can load JavaScript that calls APIs for search, forms, comments, carts or personalized content. Many sites combine static pages for the bulk of content with a few server-rendered or client-rendered routes for things like checkout or account areas.
The output is similar, but the workflow is not. With a hand-written HTML site you edit every file directly. A static site generator lets you use templates, components and a content source, then produces the HTML for you, so a layout change updates every page on the next build.
Choose SSG when a page looks the same for every visitor and does not need to change between builds or scheduled revalidations. Choose server-side rendering when the content depends on the request, such as the logged-in user, query parameters or data that must be current to the second.
Talk to a solution architect about where it fits in your roadmap.
