Static Site Generators Compared, with Measured Build Times
A static site generator turns Markdown and templates into plain HTML files at build time, which any host or CDN can serve quickly. Hugo builds fastest; in our test it turned 1,000 posts into pages in under half a second. Eleventy is the most flexible, and Astro is the best fit when some parts need interactive components.
| If you | Use |
|---|---|
| Want the fastest builds for thousands of pages | Hugo |
| Want plain JavaScript and few opinions | Eleventy |
| Need some interactive components | Astro |
| Already have a React or Next.js codebase | Next.js static export |
Updated
We gave Astro, Eleventy and Hugo the same 1,000 Markdown posts and timed three clean builds of each, so the numbers compare like with like. Below the results, the same post page in each tool shows what working with it feels like.
Writing the content first? Keep the Markdown cheat sheet.
Build times, measured
Same 1,000 posts in each tool, output deleted before every run. Repeat runs are faster because the tools and the operating system have warmed caches.
| Generator | First run | Repeat runs |
|---|---|---|
| Hugo 0.167 | 0.40 | 0.28 |
| Eleventy 3.1 | 1.34 | 0.51 |
| Astro 7.3 | 3.33 | 0.97 to 1.01 |
How they compare
| Astro | Hugo | Eleventy | Next.js export | Jekyll | |
|---|---|---|---|---|---|
| Language | JavaScript / TypeScript | Go (single binary) | JavaScript | JavaScript / TypeScript | Ruby |
| Templates | .astro, plus React, Vue, Svelte | Go templates | Nunjucks, Liquid, WebC, JS and more | React | Liquid |
| JavaScript shipped by default | None | None | None | React runtime | None |
| Interactive parts | Islands with client directives | Add your own scripts | Add your own scripts or WebC | Any React component | Add your own scripts |
| Licence | MIT | Apache-2.0 | MIT | MIT | MIT |
| Best for | Content sites that need a few interactive parts | Very large sites, fast builds | Flexible, minimal sites | React teams wanting static output | GitHub Pages blogs |
The same post page in each
Astro: a blog post page from a content collection
The collection checks each post's front matter against a schema, and getStaticPaths makes one page per post at build time.
// src/content.config.ts
import { defineCollection, z } from "astro:content";
import { glob } from "astro/loaders";
const posts = defineCollection({
loader: glob({ pattern: "*.md", base: "./src/content/posts" }),
schema: z.object({ title: z.string(), date: z.coerce.date() }),
});
export const collections = { posts };
// src/pages/posts/[id].astro
---
import { getCollection, render } from "astro:content";
export async function getStaticPaths() {
const posts = await getCollection("posts");
return posts.map((post) => ({ params: { id: post.id }, props: { post } }));
}
const { post } = Astro.props;
const { Content } = await render(post);
---
<h1>{post.data.title}</h1>
<Content />Eleventy: a layout for every post in a folder
A posts.json file in the folder applies the layout to every Markdown file inside it, through Eleventy's data cascade.
// posts/posts.json
{ "layout": "post.njk" }
// _includes/post.njk
<!doctype html>
<html>
<head><title>{{ title }}</title></head>
<body>
<h1>{{ title }}</h1>
{{ content | safe }}
</body>
</html>
// build
npx @11ty/eleventyHugo: a single-page template
Hugo picks this template for each page in content/. .Content is the rendered Markdown.
# hugo.toml
baseURL = "https://example.com/"
title = "My site"
<!-- layouts/_default/single.html -->
<!doctype html>
<html>
<head><title>{{ .Title }}</title></head>
<body>
<h1>{{ .Title }}</h1>
{{ .Content }}
</body>
</html>
# build
hugoNext.js: static export
Setting output to export writes plain HTML files to the out folder at build time. Features that need a server, such as server actions and on-demand rendering, are not available in this mode.
// next.config.js
/** @type {import('next').NextConfig} */
module.exports = {
output: "export",
images: { unoptimized: true }, // the default image optimiser needs a server
};
// build -> ./out
npx next build
When not to use a generator
If the people updating the site are not comfortable with Markdown and Git, a hosted website builder or a CMS with a visual editor will save a lot of hand-holding. Generators shine when developers own the site or when a CMS feeds them content.
How it works
- Write content as Markdown files with front matter.
- Write a template that wraps each post in your page layout.
- Run the build; each file becomes an HTML page.
- Upload the output folder to any static host or CDN.
Tips
- Build time matters most for large sites and preview deploys; under a few hundred pages, all of these are quick.
- Keep images out of Markdown folders that get copied as-is; let the tool's image pipeline resize them.
- Add a sitemap and canonical URLs from the start; most generators have a plugin for both.
- For non-technical editors, pair the generator with a headless or Git-based CMS.
Frequently asked questions
What is the Jamstack?
A way of building sites as prebuilt HTML, CSS and JavaScript served from a CDN, with dynamic features added through APIs. Static site generators produce the prebuilt part.
Is Hugo faster than Astro?
For plain Markdown pages, yes, by a wide margin in our test: about 0.3 seconds against about 1 second for 1,000 posts once warmed up. Astro does more per page, such as type-checked content and component rendering.
Can a static site have forms and search?
Yes. Forms can post to a form service or a serverless function, and search can run in the browser from a prebuilt index. Neither needs a traditional server.
Is a static site good for SEO?
Very. Every page is complete HTML on first load, fast to serve and easy for crawlers to read. You still need good titles, descriptions, internal links and a sitemap.
Related: Frontend framework comparison, Headless CMS compared, Markdown cheat sheet, XML sitemap generator, All free tools.
Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.
More in Guides
- Sticky Header: CSS position: sticky and Hide-on-Scroll
- Stripe Payment Links: Setup, Website Buttons and Thank-You Pages
- Stripe vs PayPal: Which Should Your Website Use?
- Stripe Webhooks: Set Up, Verify and Test
- Structured Data Examples: JSON-LD for Every Common Page
- Subdomain vs Subdirectory: Which to Use
- Supabase Alternatives: Which Backend Fits Your Project?
- Supabase Authentication With supabase-js v2
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App