· auth / better-auth / clerk
Better Auth vs Clerk 2026: Open Source vs Hosted Auth
Clerk ships auth in 30 minutes at $1,025/mo for 100K MAU. Better Auth takes 2–3 hours at ~$50/mo at the same scale. Spare an afternoon, save $11,700/year.
By Ethan
1,967 words · 10 min read
Pick Clerk if you need auth running today and you’re not past 50K monthly active users. Pick Better Auth if you’ve done the math and you’re giving up vendor lock-in, a larger social provider set, and pre-built UI components in exchange for ~$11,700/year at 100K MAU, full data ownership, and no GDPR conversation with a US-only provider.
That’s the whole article. Read on if you want the numbers behind that.
Who this is for
Developers and technical founders choosing auth for a new Next.js App Router project in 2026. If you’re already deep into Clerk and it’s working, the migration cost section will tell you whether switching is worth it. If you need SOC 2 compliance out of the box, skip straight to the verdict — that constraint decides for you.
What we compared
Better Auth: v1.6.11 stable (2026-05-12), MIT license
Clerk: Hosted SaaS, pricing verified from clerk.com/pricing on 2026-05-25
We didn’t run synthetic benchmarks — auth isn’t a hot path you optimize with a stopwatch. What we compared: setup time, pricing at realistic scale points, feature parity on the things teams actually use, and the switching cost if you change your mind later.
Version note: Better Auth v1.7.0-beta.3 was in active development at time of writing. Feature list reflects v1.6.11 stable only.
Pricing: where the math gets uncomfortable
Clerk’s free tier is better than most articles suggest. As of 2026, it’s 50,000 monthly active users (MRUs), not the 10K you’ll still see cited in older posts. That covers the vast majority of indie projects indefinitely.
The break-even math:
| Scale | Clerk (Pro) | Better Auth (self-hosted) |
|---|---|---|
| 0 → 50K MAU | $0 (Hobby) | ~$5–$15/mo (Postgres hosting) |
| 50K → 100K MAU | $25 + (50K × $0.02) = $1,025/mo | ~$20–$50/mo (Postgres at scale) |
| 100K MAU ongoing | ~$1,025/mo | ~$50/mo |
At 100K MAU, you’re paying $12,300/year for Clerk (Pro plan + overage) versus roughly $600/year for Better Auth (Postgres on Railway or Render). That’s an $11,700/year gap.
If you never cross 50K MAU, the comparison is essentially free tier vs. “small Postgres bill.” At that point, Clerk wins on pure convenience.
One thing to watch: Clerk’s per-organization pricing. Basic multi-tenancy is free — you get 100 monthly retained organizations (MROs) on all plans. But the B2B Authentication add-on, which unlocks unlimited organization members and full custom RBAC, costs $85/mo billed annually. If your product is B2B with teams, factor that in.
Side-by-side feature comparison
| Feature | Better Auth v1.6.11 | Clerk |
|---|---|---|
| Hosting | Self-hosted | Clerk’s infrastructure (US) |
| Data ownership | Your database, your region | Clerk’s servers, US-only |
| EU data residency | Any region | Not available |
| License | MIT | Proprietary SaaS |
| Next.js App Router | toNextJsHandler() | clerkMiddleware() + <ClerkProvider> |
| Pre-built UI components | None — build your own | <SignIn>, <UserButton>, <Show> |
| Social OAuth providers | 8 built-in + generic OAuth plugin | 20+ built-in |
| Email/password | Yes | Yes |
| Passwordless / passkeys | Plugin | Pro+ |
| TOTP 2FA | Plugin | Pro+ |
| SMS 2FA | Custom sendOTP integration | Pro+ (built-in) |
| Organizations / multi-tenancy | Free (plugin) | Basic free; B2B add-on $85/mo |
| Custom RBAC | createAccessControl | Pro+ |
| SAML / Enterprise SSO | Plugin | $75/mo per enterprise connection |
| Session management | Fully configurable | Custom duration on Pro+ |
| Database adapters | Prisma, Drizzle, MongoDB, raw SQL | Not applicable |
| Vendor lock-in | None | High (user data in Clerk’s infra) |
| SOC 2 compliance | DIY | SOC 2 Type II certified |
| Setup time | 2–3 hours | 10–30 minutes |
| Free tier MAU | Unlimited (self-hosted) | 50,000 |
Setting up in Next.js App Router
Better Auth — minimal setup
Better Auth requires a database and an ORM adapter — if you’re still deciding between Prisma and Drizzle for that adapter, Prisma vs Drizzle covers the tradeoffs. Budget 2–3 hours including migrations.
Install:
npm install better-auth
.env:
BETTER_AUTH_SECRET=<openssl rand -base64 32>
BETTER_AUTH_URL=http://localhost:3000
lib/auth.ts:
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { db } from "@/db";
export const auth = betterAuth({
database: drizzleAdapter(db, { provider: "pg" }),
emailAndPassword: { enabled: true },
socialProviders: {
github: {
clientId: process.env.GITHUB_CLIENT_ID!,
clientSecret: process.env.GITHUB_CLIENT_SECRET!,
},
},
});
app/api/auth/[...all]/route.ts:
import { auth } from "@/lib/auth";
import { toNextJsHandler } from "better-auth/next-js";
export const { POST, GET } = toNextJsHandler(auth);
Client setup:
import { createAuthClient } from "better-auth/react";
export const authClient = createAuthClient({ baseURL: "http://localhost:3000" });
Generate and run migrations:
npx auth@latest generate
npx auth@latest migrate
That’s the happy path. Where it gets longer: configuring your ORM schema, provisioning a database in your hosting environment, and wiring up social providers in their respective developer consoles. None of those steps are hard, but each takes time.
Clerk — minimal setup
No database required. Clerk hosts everything.
Install:
npm install @clerk/nextjs
.env.local:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_...
CLERK_SECRET_KEY=sk_...
middleware.ts:
import { clerkMiddleware } from '@clerk/nextjs/server';
export default clerkMiddleware();
export const config = {
matcher: [
'/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)',
'/(api|trpc)(.*)',
'/__clerk/(.*)',
],
};
app/layout.tsx:
import { ClerkProvider, SignInButton, SignUpButton, Show, UserButton } from "@clerk/nextjs";
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<ClerkProvider>
<header>
<Show when="signed-out">
<SignInButton />
<SignUpButton />
</Show>
<Show when="signed-in">
<UserButton />
</Show>
</header>
{children}
</ClerkProvider>
</body>
</html>
);
}
Auth is functional. No migration step, no database provisioning.
The trade-off is invisible at setup time and shows up in your infrastructure bill 18 months later.
Where Better Auth wins
Cost at scale. The math in the pricing section is the entire argument. At 100K MAU, Better Auth saves ~$11,700/year. At 500K MAU, that gap becomes structurally significant.
Data ownership and EU compliance. Clerk runs on US infrastructure only. If your users are in the EU and GDPR data residency is a hard requirement, Clerk creates a problem that money can’t fix. With Better Auth, you pick any Postgres host in any region.
Organizations are free. Clerk’s B2B add-on ($85/mo) covers functionality that Better Auth ships as a free MIT plugin — unlimited org members, custom RBAC, team nesting. If you’re building a multi-tenant B2B product, this is a real line item.
No vendor lock-in. Your users, sessions, and auth data live in your own Postgres from day one. If Better Auth disappeared tomorrow, you’d still have your data. With Clerk, migration is a project (see below).
TypeScript-first ecosystem. Better Auth is built from the ground up for TypeScript. The plugin architecture (2FA, passkeys, SSO, impersonation, RBAC) is composable and typed. Better Auth absorbing the Auth.js project in September 2025 — after Auth.js stalled in perpetual beta following its maintainer’s departure — is a strong signal that the TypeScript community is consolidating here rather than fragmenting further.
Where Clerk wins
Time to working auth. Thirty minutes is real. The Clerk quickstart is genuinely fast — no database, no migrations, no ORM configuration. If you’re building a prototype or need auth working before a demo, Clerk is the right answer.
Pre-built UI components. <SignIn>, <UserButton>, and <Show> are polished and handle edge cases you’d spend days on with a custom form — password reset flows, OAuth error handling, MFA prompts. With Better Auth, you build all of this yourself or pull in a component library that you then have to maintain.
Social provider breadth. Clerk supports 20+ social providers out of the box. Better Auth has 8 built-in providers plus a generic OAuth plugin for OIDC-compatible providers. For most projects the 8 are sufficient (Google, GitHub, Discord, Apple, Microsoft, Facebook, LinkedIn, TikTok), but if you need something more exotic, you’re writing a plugin.
SOC 2 Type II compliance. Clerk is certified. If your customers’ security reviews require it, the conversation is easy. With Better Auth, you pursue certification yourself — or explain to enterprise procurement why you can’t produce the certificate.
Ops-free. Clerk runs backups, monitors uptime, patches vulnerabilities in the auth layer, and handles session storage scaling. With Better Auth, that’s your job. If your team doesn’t have infrastructure muscle, that’s not a small concern.
The Auth.js lineage
Better Auth is the spiritual successor to NextAuth (Auth.js). In September 2025, Better Auth absorbed the Auth.js project — the original maintainer had departed earlier in the year, leaving v5 stuck in perpetual beta since 2023. Better Auth took over to prevent the project from being abandoned entirely. Auth.js v5 is still technically maintained (security patches) but the ecosystem momentum has shifted. If you’re migrating off Auth.js v4 and evaluating options, Better Auth is the obvious destination — familiar concepts, familiar TypeScript patterns, much more complete feature set. If Clerk was already in that mix, NextAuth vs Clerk runs the same comparison with an Auth.js migration lens.
If you’re already on Clerk and thinking about switching
The switching cost is real. MakerKit estimates 2 engineer-weeks for a typical multi-provider setup with organizations. The pain points:
- User export: Clerk has an export API, but the schema differs from Better Auth’s. You’ll write transformation code.
- Session invalidation: Every existing session breaks. All users must re-login after migration.
- Password rehashing: Clerk uses their own hash; you can’t migrate hashes directly. Lazy rehash on first login is the standard approach.
- Webhook reconfiguration: Any Clerk webhooks (user.created, session.ended) need equivalents in your own system.
- Component refactoring: Remove every
<UserButton>,<SignIn>, and<Show>, replace with custom or headless UI.
The 2-engineer-week estimate scales with codebase size and grows if you have mobile clients, because Clerk’s session model differs enough that mobile SDKs need separate treatment.
The common pattern the community describes: teams that switch almost always started on Clerk, hit the pricing wall around month 9, then paid the migration cost. Starting on Better Auth avoids that entirely if you have 3 hours to spare at project start.
Verdict
Start with Clerk if: you need auth in production before this week ends, you don’t expect to cross 50K MAU in the next 12 months, or your enterprise customers require SOC 2 certification.
Start with Better Auth if: you have a half-day to invest upfront, you’re building for EU users, you expect multi-tenancy without paying $85/mo for it, or you’re planning for a scale where Clerk’s pricing becomes a budget conversation.
Don’t over-engineer the decision. At 0 → 50K MAU, the cost difference is noise. The meaningful question is whether you want to own your auth infrastructure — with all the upside and responsibility that comes with it — from day one. If Auth0 is also on your shortlist, Clerk vs Auth0 benchmarks both hosted options side by side.
Caveats
- Clerk’s pricing changes frequently. The 50K MAU free tier was previously 10K; verify at clerk.com/pricing before making financial projections based on this article.
- Better Auth v1.7.0 was in beta at publication (stable may have landed by the time you read this — check the GitHub releases page).
- We did not test Clerk’s enterprise tier or multi-region options, which may exist in plans not publicly listed.
- Neither Clerk nor Better Auth had active affiliate programs at time of writing. There are no affiliate links in this article.