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.

Pick in one line
If youUse
Want the fastest builds for thousands of pagesHugo
Want plain JavaScript and few opinionsEleventy
Need some interactive componentsAstro
Already have a React or Next.js codebaseNext.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.

Measured: 1,000 Markdown posts to HTML (seconds)
GeneratorFirst runRepeat runs
Hugo 0.1670.400.28
Eleventy 3.11.340.51
Astro 7.33.330.97 to 1.01

How they compare

Side by side
AstroHugoEleventyNext.js exportJekyll
LanguageJavaScript / TypeScriptGo (single binary)JavaScriptJavaScript / TypeScriptRuby
Templates.astro, plus React, Vue, SvelteGo templatesNunjucks, Liquid, WebC, JS and moreReactLiquid
JavaScript shipped by defaultNoneNoneNoneReact runtimeNone
Interactive partsIslands with client directivesAdd your own scriptsAdd your own scripts or WebCAny React componentAdd your own scripts
LicenceMITApache-2.0MITMITMIT
Best forContent sites that need a few interactive partsVery large sites, fast buildsFlexible, minimal sitesReact teams wanting static outputGitHub 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/eleventy

Hugo: 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
hugo

Next.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

  1. Write content as Markdown files with front matter.
  2. Write a template that wraps each post in your page layout.
  3. Run the build; each file becomes an HTML page.
  4. Upload the output folder to any static host or CDN.

Tips

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

We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.

Product

Who It's For

Features

Resources

Company

View Sitemap