Better Auth or Clerk?

Better Auth is a free library you run in your own app and database; Clerk is a hosted service billed per user past 50,000. Here’s what each costs, what you build yourself, and how they handle B2B, MFA and security.

By the NestedBit team · Updated

Better Auth vs Clerk in short

Both give a TypeScript app sign-in, sessions, organizations and MFA. The difference is where the code runs and who looks after it.

  • Better Auth is an open-source library under the MIT licence. It runs inside your own app and keeps users and sessions in your own database. Organizations, SSO, SCIM, two-factor and passkeys come as plugins. There’s no per-user fee, but you send the emails, build the screens and own the security setup.
  • Clerk is a hosted service. It stores your users, sends the emails and texts, and gives you prebuilt components for sign-in, profiles and organization switching. It’s free to 50,000 retained users, then billed per user, and extra SSO connections and advanced B2B features cost more.

The prices on this page come from each vendor’s pricing page, checked on 10 Nov 2026, through the same engine as the free Auth Provider Picker. Vendors change plans often, so confirm the plan you pick on their site before you commit.

Better Auth vs Clerk pricing

Better Auth has no licence fee, no per-user price and no server of its own: it runs in your app and adds tables to your app’s database. You pay instead for database storage and queries, an email provider for verification and reset emails, an SMS provider if you text codes, and your team’s time. Those costs depend on your stack, so the picker doesn’t guess them. It shows Better Auth as “$0 licence” and adds a hosting figure only if you enter your own monthly estimate.

Clerk bills monthly retained users: people who visit in a month at least a day after signing up. Hobby is free to 50,000 of them, without MFA, passkeys or SSO. Pro is $25 a month with 50,000 included, then $0.02 a user, less in volume. The estimates treat every active user as retained, so Clerk’s figures may run high.

Monthly cost, Clerk’s cheapest plan that covers the need:

ExampleBetter AuthClerk
Consumer app, password and social sign-in
10,000 users $0 licence plus your own running costs $0 Hobby
50,000 users $0 licence plus your own running costs $0 Hobby
100,000 users $0 licence plus your own running costs $1,025 Pro
1,000,000 users $0 licence plus your own running costs $17,225 Pro
Consumer app with MFA and passkeys
1,000 users $0 licence plus your own running costs $25 Pro
50,000 users $0 licence plus your own running costs $25 Pro
250,000 users $0 licence plus your own running costs $3,725 Pro
B2B SaaS with organizations and SSO
2,000 users, 20 customers, 3 SSO connections, custom roles $0 licence plus your own running costs $275 Pro
5,000 users, 50 customers, 5 SSO connections $0 licence plus your own running costs $425 Pro
10,000 users, 150 customers, 8 SSO connections, 3 SCIM directories, custom roles $0 licence plus your own running costs $850 Pro

For B2B, Clerk includes one SSO connection on Pro, then $75 a month each, plus its Enhanced B2B add-on at $100 a month for custom roles and for linking SSO to organizations. Clerk starts billing Directory Sync (SCIM) connections beyond the first on 1 January 2027; the last row includes that.

Better Auth’s SSO and SCIM plugins cost nothing. Letting customers set up their own SSO connection from a hosted screen is part of Better Auth Infrastructure, its optional paid service: Pro is $20 a month with one connection, then $50 a month each. The table leaves that out, along with tax, support plans and SMS. Put your own numbers into the picker to see the line items and 11 other providers.

What you build and run yourself

Clerk’s Next.js quickstart is one command, npx clerk@latest init. It writes your keys, adds clerkMiddleware() and wraps your app in <ClerkProvider>. Clerk then sends verification emails and SMS codes itself, from templates you edit in its dashboard.

With Better Auth, you wire up each part:

  • Database. Connect Postgres, MySQL or SQLite, or use the Drizzle, Prisma or MongoDB adapters, then create the tables with npx auth@latest generate or migrate. Some plugins add tables, so you run it again when you add them.
  • Routes. Set BETTER_AUTH_SECRET and BETTER_AUTH_URL, mount the handler at app/api/auth/[...all]/route.ts, and check sessions in server code with auth.api.getSession().
  • Email and SMS. You write the functions that send verification, reset, invitation and one-time-code messages through your chosen provider.
  • Rate limiting. It’s on in production, but counts live in memory by default. On serverless hosting the docs recommend your database or a secondary store instead.
  • Admin tools. The admin plugin gives you endpoints to list, ban and impersonate users, but no screens. Better Auth Infrastructure adds a hosted dashboard.

Each step is ordinary backend work, but it stays yours: upgrades, backups, and the email delivery sign-in needs.

Sign-in screens and UI components

  • Clerk ships components such as <SignIn />, <UserProfile /> and <OrganizationSwitcher />, styled through its appearance prop. By default they carry a “Secured by Clerk” badge; removing it in production needs a paid plan. You can instead build a custom flow on Clerk’s API, though Clerk calls these advanced and not recommended for most apps.
  • Better Auth gives you a client, createAuthClient, with methods and hooks for your framework. We found no prebuilt screens in its own docs, so you build the forms yourself. An MIT-licensed project, Better Auth UI, offers screens for shadcn/ui and HeroUI; its site doesn’t say whether the Better Auth team maintains it.

Clerk gets you to a finished sign-in page sooner. Better Auth leaves every screen to you, which suits a team with its own design system and costs time for one without.

Organizations, SSO and SCIM

Clerk builds these in and prices them. Better Auth ships them as plugins you add and configure.

  • Organizations. Better Auth’s organization plugin has owner, admin and member roles, invitations, optional teams, and custom roles defined in code or created per organization at runtime. Clerk’s organizations come with Admin and Member roles, custom permissions and invitations. Without its Enhanced B2B add-on, each organization holds up to 20 members, and custom roles and verified domains need the add-on.
  • Single sign-on. Better Auth’s SSO plugin handles OIDC and SAML 2.0, verifies each customer’s domain over DNS and can link a connection to an organization. Clerk supports SAML, OIDC and EASIE connections.
  • SCIM. Better Auth’s SCIM plugin serves an inbound SCIM 2.0 endpoint for a customer’s directory to create and remove users and groups. It needs a database with interactive transactions, so not Cloudflare D1. Clerk’s Directory Sync works over SCIM or with Google Workspace.

With Better Auth, the plugins handle the protocols and the onboarding is yours. Before choosing either, lay out the roles your product needs in the RBAC Matrix Builder.

MFA and passkeys

  • Better Auth’s two-factor plugin supports authenticator apps (TOTP), codes sent by email or phone through your own sendOTP function, backup codes and trusted devices. Its passkey plugin is built on SimpleWebAuthn and supports browser autofill. Neither has a fee.
  • Clerk offers SMS codes, authenticator apps, backup codes and passkeys, but all need a paid plan in production, so MFA moves you from Hobby to Pro at $25 a month. SMS costs $0.01 a message in the US and Canada.

Who is responsible for security

With Clerk, most protections run on its side and are on by default for new apps. An account locks for an hour after 10 failed attempts, passwords are checked against Have I Been Pwned’s breach data, and suspicious sign-ups get a Cloudflare Turnstile challenge. Session tokens last 60 seconds. Clerk shares a SOC 2 report on Business and Enterprise.

Better Auth starts from sound defaults, listed in its security reference: scrypt password hashing, origin checks against CSRF, encrypted httpOnly cookies, PKCE on OAuth and rate limiting in production. Breached-password checks are a plugin you add. The rest is yours:

  • Keep the trusted origins list tight, with no localhost in production.
  • Set trusted proxies, since rate limits read the client IP from a header clients can set.
  • Check origins and redirects in your own routes: a direct auth.api call skips Better Auth’s checks.
  • Validate the session on the server; the Next.js docs warn a cookie check alone isn’t enough.
  • Upgrade when security fixes ship, and secure and back up the database.

No vendor report covers a library you host, so SOC 2 or HIPAA depend on your own hosting and controls.

Data ownership and lock-in

With Better Auth, users and sessions are rows in your database. You can join them to your own tables, back them up with everything else and keep them in whatever region you host in. The lock-in is to its API and table layout: leaving means rewriting your auth code, not asking anyone for your data.

With Clerk, users live in Clerk. If you need them in your own database, for example to show other users’ names, Clerk suggests syncing with webhooks, which are retried but not guaranteed. Its dashboard exports your users, with hashed passwords, as a CSV. We found no option to choose the region Clerk stores them in; Clerk vs Auth0 covers what its terms say.

Moving between them

From Clerk, Better Auth’s migration guide reads Clerk’s CSV export and API, and writes users, social accounts and TOTP secrets into your database. Clerk uses bcrypt, so you set Better Auth to verify bcrypt and passwords keep working. Every session ends, and the guide doesn’t cover organizations yet.

To Clerk, its open-source migration script imports JSON or CSV, or you can move users gradually as they sign in. Better Auth hashes with scrypt by default, and Clerk’s accepted hashers name only the Firebase and Werkzeug forms of scrypt. Unless you set Better Auth to one on Clerk’s list, such as bcrypt, plan for password resets or that gradual move.

Either way, keep your own user ID as the key in your database, and treat the auth system’s ID as a field you can replace. Then a move changes one column, not every table that refers to a user.

Which one to choose

  • Choose Better Auth when you want users in your own database, no per-user bill, or SSO and SCIM without per-connection fees, and your team is ready to own the setup and its security.
  • Choose Clerk when finished screens matter more than control, you’d rather not run email, SMS and attack protection, and its price fits your size.
  • Look at both again as you grow: past 50,000 retained users Clerk bills each one, while running Better Auth stays your team’s job at any size.

And look beyond the two: Keycloak and SuperTokens can also run on your own servers, and hosted services such as Auth0 and WorkOS price differently, as Clerk vs Auth0 shows. The Auth Provider Picker compares 13 providers on the features you tick and your own user numbers, in your browser.

Free tool · No sign-up

Auth0 Alternatives: Auth Provider Picker

Compare Auth0 alternatives on the features you need and see what each would cost a month at your number of users.

Starts with a free 30-minute intro call, or email hello@nestedbit.com.