Headless CMS Compared: Six Options, One Blog
A headless CMS stores content and serves it through an API, leaving the website's design to your own code. Sanity and Contentful are hosted services, Strapi and Payload are open source and run on your own database, Storyblok adds a visual page editor, and Decap edits Markdown files in Git. The table below compares them side by side.
| Need | Pick |
|---|---|
| Flexible content modelling | Sanity |
| Own your data, free to self-host | Strapi or Payload |
| Visual editing for marketers | Storyblok |
| Zero cost, content in Git | Decap CMS |
Updated
We are not affiliated with any of these vendors. Each section below fetches the same list of blog posts, so you can compare how each feels to code against, and the table shows listed prices as we read them on the day this page was updated.
Picking the site generator too? See static site generators compared.
The six at a glance
| CMS | Type | Where content lives | Free option | Paid from |
|---|---|---|---|---|
| Sanity | Hosted content platform, open-source editor (Studio) | Sanity's cloud | Free plan | $15 per seat a month (Growth) |
| Contentful | Hosted, closed source | Contentful's cloud | See vendor | See vendor (page did not load for us) |
| Strapi | Open source (MIT), self-host or cloud | Your database | Self-hosting is free | $35 a month (Cloud Starter) |
| Payload | Open source (MIT), runs inside Next.js | Your database | Self-hosting is free | Your hosting costs |
| Storyblok | Hosted, visual editor | Storyblok's cloud | Starter plan | $99 a month (Growth) |
| Decap CMS | Open source (MIT), Git-based | Markdown files in your repository | Free | None |
Which fits your project
| Situation | Good fit |
|---|---|
| Developers want to model content in code and query it flexibly | Sanity |
| Large team, many locales, strict roles, budget for a vendor | Contentful |
| Want to own the database and the server | Strapi or Payload |
| Already on Next.js and want the CMS in the same app | Payload |
| Marketers want to edit pages visually | Storyblok |
| A small static site where content can live in Git | Decap CMS |
The same blog list from each CMS
Sanity: list posts with GROQ
GROQ selects and shapes documents in one query, so the slug arrives as a plain string.
import { createClient } from "next-sanity";
const client = createClient({ projectId: "your-id", dataset: "production", apiVersion: "2025-01-01", useCdn: true });
export async function getPosts() {
return client.fetch(`*[_type == "post"] | order(publishedAt desc){ title, "slug": slug.current, publishedAt }`);
}Contentful: list posts with the Delivery API
getEntries filters by content type; fields come back under fields.
import { createClient } from "contentful";
const client = createClient({ space: process.env.CONTENTFUL_SPACE_ID!, accessToken: process.env.CONTENTFUL_DELIVERY_TOKEN! });
export async function getPosts() {
const res = await client.getEntries({ content_type: "blogPost", order: ["-fields.publishDate"] });
return res.items.map((i) => ({ title: i.fields.title, slug: i.fields.slug }));
}Strapi 5: list posts over REST
Strapi generates a REST API per content type. Version 5 returns fields directly on each item, without the attributes wrapper of version 4.
export async function getPosts() {
const url = `${process.env.STRAPI_URL}/api/posts?sort=publishedAt:desc&fields[0]=title&fields[1]=slug`;
const res = await fetch(url, { headers: { Authorization: `Bearer ${process.env.STRAPI_TOKEN}` } });
if (!res.ok) throw new Error(`Strapi ${res.status}`);
const { data } = await res.json();
return data; // [{ id, documentId, title, slug }, ...]
}Payload 3: query from a Server Component
Payload runs inside your Next.js app, so a Server Component can read the database through the Local API with no HTTP request.
// app/blog/page.tsx
import { getPayload } from "payload";
import config from "@payload-config";
export default async function Blog() {
const payload = await getPayload({ config });
const { docs } = await payload.find({ collection: "posts", sort: "-publishedAt", limit: 20 });
return <ul>{docs.map((p) => <li key={p.id}><a href={`/blog/${p.slug}`}>{p.title}</a></li>)}</ul>;
}Storyblok: list stories from the CDN API
Stories in a folder are fetched with starts_with. The public token is read-only and safe to use in a static build.
export async function getPosts() {
const qs = new URLSearchParams({ starts_with: "blog/", version: "published", sort_by: "first_published_at:desc", token: process.env.STORYBLOK_TOKEN! });
const res = await fetch(`https://api.storyblok.com/v2/cdn/stories?${qs}`);
const { stories } = await res.json();
return stories.map((s) => ({ title: s.name, slug: s.slug }));
}Decap CMS: edit Markdown in your repository
Decap is an admin page that commits Markdown files to your Git repository. Your site generator builds them like any other file.
# public/admin/config.yml
backend:
name: github
repo: your-org/your-site
branch: main
media_folder: public/images
collections:
- name: posts
label: Blog posts
folder: content/posts
create: true
fields:
- { label: Title, name: title, widget: string }
- { label: Date, name: date, widget: datetime }
- { label: Body, name: body, widget: markdown }
When you do not need a CMS
A headless CMS adds an account, an API, previews and a build hook to look after. For a five-page business site that changes a few times a year, that is overhead. Markdown in Git, or a builder where owners edit the page they see, often serves them better.
How it works
- Decide where content should live: a vendor's cloud, your database, or Git.
- Check whether editors need visual page editing or just forms.
- Compare the free option and the first paid tier against your team size.
- Model one content type, such as a blog post, and fetch it into your site before committing.
Tips
- Model content by meaning (author, summary, body), not by page layout, so it can be reused.
- Use the CMS's webhook to rebuild or revalidate pages when content is published.
- Keep preview working for editors; it is the feature they notice most.
- Export your content early to check you can leave if you need to.
Frequently asked questions
What is the difference between a headless CMS and WordPress?
Traditional WordPress stores content and renders the pages with its themes. A headless CMS only stores and serves content; your own front end, such as a Next.js or Astro site, renders it.
Which headless CMS is best for Next.js?
Payload runs inside a Next.js app, which makes it the tightest fit. Sanity, Contentful and Storyblok also have official Next.js guides and work well with server rendering and revalidation.
Is there a free headless CMS?
Yes. Strapi, Payload and Decap CMS are open source and free to self-host. Sanity and Storyblok have free plans with limits on users and usage.
Do I need a headless CMS at all?
Not always. If developers edit the site, Markdown files in the repository are simpler. If non-technical people edit a small business site, a website builder with a built-in editor is usually quicker than wiring a CMS to custom code.
Related: Static site generators, Frontend framework comparison, React Server Components, Best blogging platforms, 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
- High Contrast Color Palettes, With Ratios Checked
- Build a Home Care Website: Pages, Costs and a Working Example | How-to Guide
- Hosts File Location: Find and Edit It on Any System
- How Accountants Get More Clients from Google and ChatGPT | How-to Guide
- How Acupuncturists Get More Patients from Google and ChatGPT | How-to Guide
- How Architects Get More Clients from Google and ChatGPT | How-to Guide
- How Auto Repair Shops Get More Customers from Google and ChatGPT | How-to Guide
- How Bakeries Get More Orders from Google and ChatGPT | How-to Guide
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