These two are not really competing for the same job, and most comparisons blur that. Clerk gives a React or Next.js team the best drop-in authentication UI in the category and runs the whole thing for you, in the United States, as a closed-source service. Keycloak is Apache 2.0 software you run where you like that is a full OpenID Connect provider and a SAML identity provider, with no per-connection or per-organization meter attached. Checked against Keycloak 26.8.2 on a running server and against Clerk's published documentation, pricing and security pages on 16 November 2026.
| Clerk | You Keycloak | |
|---|---|---|
| Drop-in UI components for your app | ||
| Issues SAML assertions to other apps | ||
| Choose the cloud and region you run in | ||
| Per-connection charge for enterprise SSO | $75/mo | none |
| LDAP / Active Directory federation | ||
| PAR, CIBA, DPoP and mTLS-bound tokens |
| Dimension | Clerk | Keycloak (with Phase Two) |
|---|---|---|
| What you get | A hosted authentication service plus prebuilt UI components you render inside your own app | An identity server you deploy, with its own hosted login, account and admin consoles |
| Licence and source | The service is proprietary and cloud-only. The client SDKs are MIT on GitHub; the server is not published | ✓Apache 2.0, source and binaries, nothing gated behind a tier |
| Self-hosting | Not offered | ✓Any cloud, any region, on-premise, or a managed cluster at a fixed monthly price |
| Data residency | "Clerk does not offer regional data residency or region selection." Data is hosted on US infrastructure, with EU, UK and Swiss personal data transferred to the US under the Data Privacy Framework | ✓You choose. Our EU clusters run in Frankfurt with Ireland as the standing backup |
| Pricing model | Free to 50,000 monthly retained users; Pro $25/mo, Business $300/mo, then $0.02 per MRU above 50,000, plus per-connection, per-organization and per-domain add-ons | ✓The software is free at any scale. Managed clusters are a fixed monthly price with unlimited users |
| Enterprise SSO for your customers | SAML and OIDC as the service provider. One connection included per app; additional connections $75/mo each from the second to the fifteenth | ✓Unlimited identity provider connections, per realm or per organization, at no incremental cost |
| Acting as an identity provider for third parties | OAuth 2.0 and OIDC only, through OAuth Applications. No SAML assertion issuing | ✓OIDC and SAML 2.0, with an IdP metadata descriptor published per realm |
| B2B organizations | Mature, with prebuilt org switcher and profile components. 100 monthly retained organizations and 20 members per org included; beyond that a $100/mo add-on and per-organization pricing | Organizations is a default-on feature in 26.8, with per-organization identity providers and no member or organization cap |
| Existing LDAP or Active Directory | Not supported | ✓User storage federation with READ_ONLY, WRITABLE and UNSYNCED edit modes, plus a Kerberos bridge |
| Login UI customization | CSS on the prebuilt components, or build the flow yourself against the low-level API. Clerk's docs: you may not change "the HTML structure or the logic/ordering of how the authentication flow works" | ✓Themes override any login, account, admin, welcome or email template, and flows are composed from 42 authenticators |
| Framework coverage | 17 first-party SDKs, including Next.js, Expo, iOS, Android, Electron and Chrome extensions | Standards-based. Any OIDC library in any language, plus our own framework tutorials |
| Certifications | SOC 2 Type 2 since 6 May 2022 and HIPAA. Clerk's security page states it is not ISO 27001 certified | ✓Phase Two holds SOC 2 Type II and ISO/IEC 27001 |
Plenty of the things a comparison page would normally make a fuss about are true of both. Neither choice is wrong because of any of these.
oidc, oauth2 and saml brokers for everything else. Clerk's catalogue is longer; Keycloak's generic brokers cover the gap with configuration.PASSKEYS and WEB_AUTHN are default-on features. On Clerk, MFA is included on Pro and Business and absent from the free Hobby plan.GET /v1/users paginates the same data programmatically. That is not a given in this category.So the decision is not about feature counts. It is about who writes the login UI, who holds the data, what protocols you need to speak rather than consume, and what the bill does as you sell to larger customers.
If you are building a Next.js application and you want a working sign-in, sign-up, user profile and organization switcher this afternoon, Clerk wins and it is not close. Nothing in the Keycloak ecosystem is an equivalent.
The difference is architectural, not cosmetic. Clerk's components render inside your application — <SignIn />, <UserProfile />, <OrganizationSwitcher /> — against a per-application Frontend API, so the user never leaves your domain and you never build a settings page. Keycloak redirects the browser to the identity server, which hosts its own login pages and a separate account console at its own URL. Our account console documentation describes what that console does; what it does not do is live inside your React tree.
Clerk also has far more first-party platform coverage: 17 SDKs, including Expo, iOS, Android, Electron and Chrome extensions. Keycloak's answer is that it is a standards server and you bring your own OIDC library, which is true and is genuinely less work per platform you have never used before and more work on day one. We write that work down — see the Keycloak tutorials and the native login guide for iOS and Android — but writing it down is not the same as shipping a component.
The ceiling is where it gets interesting. Clerk's own documentation is explicit about the trade: you can "modify the CSS for any part of the prebuilt components, but not the HTML structure or the logic/ordering of how the authentication flow works." To change the flow, you drop to custom flows built directly on the low-level API, and Clerk's docs say plainly that this "requires significant development effort to implement and maintain."
Keycloak's equivalent ceiling is much higher and its floor is much lower. A Keycloak theme can override any template, message bundle or asset across the login, account, admin, welcome and email flows, and the flow itself is composed in the admin console from the 42 authenticators a stock 26.8.2 server reports — with 139 provider interfaces underneath if none of them do what you need. You will spend a day on FreeMarker that you would not have spent on a Clerk component. You will also never be told that the ordering of your login steps is not yours to change.
This is the single most common misreading of what Clerk does, and it decides the choice outright for some teams. Clerk's SAML support is enterprise connections: your customer's Okta, Entra ID or Google Workspace issues an assertion and Clerk consumes it so their employees can sign into your app. Every SAML page in Clerk's documentation sits under that heading, and its provider role for third parties — OAuth Applications — is OAuth 2.0 and OIDC only.
Keycloak does both directions. The same realm that brokers an inbound connection also publishes an IdP metadata descriptor that any SAML service provider can consume:
# Keycloak 26.8.2, stock container, no configuration
curl -s http://localhost:8080/realms/master/protocol/saml/descriptor
<md:EntityDescriptor entityID="http://localhost:8080/realms/master">
<md:IDPSSODescriptor WantAuthnRequestsSigned="true" ...>
<md:SingleSignOnService Binding="...bindings:HTTP-POST" .../>
<md:SingleSignOnService Binding="...bindings:HTTP-Redirect" .../>
<md:SingleSignOnService Binding="...bindings:SOAP" .../>
<md:SingleSignOnService Binding="...bindings:HTTP-Artifact" .../>If anything in your estate needs to be signed into by your identity provider over SAML — an internal tool, a SaaS seat you administer, a vendor portal — Clerk cannot be that identity provider and Keycloak can, out of the box.
The same gap shows up across the later OAuth work. The Keycloak column below is the discovery document of a stock 26.8.2 realm; "not documented" means the term returns no hits anywhere in Clerk's published documentation index.
| Clerk | Keycloak 26.8.2 at defaults | |
|---|---|---|
| SAML identity provider | No | Yes — POST, Redirect, SOAP and Artifact bindings for SSO and SLO |
| Pushed Authorization Requests (PAR) | Not documented | Advertised in the discovery document |
| CIBA (decoupled authentication) | Not documented | Advertised in the discovery document |
| DPoP and mTLS-bound access tokens | Not documented | dpop_signing_alg_values_supported and tls_client_certificate_bound_access_tokens: true |
| Token exchange, JWT bearer, UMA ticket grants | No | All three in grant_types_supported |
| Device authorization grant | Yes | Yes |
| Dynamic client registration | Yes, opt-in per instance | Yes, per realm |
| LDAP / Active Directory federation, Kerberos | No | Yes |
Be fair about what that list means. Most applications never need PAR, CIBA or a UMA ticket, and a team that does not have a security reviewer asking for them is not worse off for their absence. The list matters at exactly one moment: when a customer sends you a questionnaire. Our Keycloak identity provider documentation covers the brokering side, and the OIDC discovery explorer will print the same document for any issuer, including your own.
What you actually get for what you actually pay.
| Clerk | You Keycloak + Phase Two | |
|---|---|---|
| Prebuilt UI components inside your app | ||
| First-party mobile and desktop SDKs | ||
| Zero servers to operate | ||
| Open source | ||
| Self-host or choose your cloud and region | ||
| Regional data residency | ||
| OpenID Connect provider | ||
| SAML 2.0 identity provider | ||
| Consumes enterprise SAML / OIDC connections | ||
| Unlimited enterprise connections at no extra cost | ||
| PAR, CIBA, DPoP and mTLS-bound tokens | ||
| Token exchange and JWT bearer grants | ||
| LDAP / Active Directory federation and Kerberos | ||
| B2B organizations with no member or tenant cap | ||
| Full template-level login customization | ||
| Reorder the authentication flow itself | ||
| SOC 2 Type II and ISO 27001 | ||
| Export users with password hashes |
Clerk's headline is generous and it is real: 50,000 monthly retained users free, on every plan including the free one, and an MRU only counts if the user comes back at least 24 hours after signing up. A consumer application with a large but quiet user table can run on Clerk for $25 a month for a long time. Say that plainly, because a comparison that pretends otherwise is not worth reading.
The cost arrives somewhere else. It arrives when you start selling to companies. Clerk's published rate card, as of 16 November 2026:
| Line | Included | Then |
|---|---|---|
| Plan | Hobby free; Pro $25/mo; Business $300/mo | Enterprise is custom and annual only |
| Monthly retained users | 50,000 per app | $0.02 each to 100,000, then $0.018, $0.015, $0.012 |
| Enterprise SSO connections | 1 per app on Pro and Business | $75/mo each for 2–15, $60 for 16–100, $48 for 101–250 |
| Directory Sync (SCIM) connections | 1 per app on Pro and Business | $75/mo each, billed from 1 January 2027 |
| B2B organizations | 100 monthly retained orgs, 20 members each | $100/mo for unlimited members, plus $1 per org above 100 |
| Satellite domains | — | $10/mo each |
Work one example. A B2B SaaS with 20,000 monthly retained users — comfortably inside the free user allowance — 400 organizations, customers whose teams run past twenty seats, and ten enterprise customers who each want their own SAML connection:
Pro plan $ 25
20,000 MRUs (50,000 included) $ 0
10 SSO connections (1 included, 9 x $75) $ 675
B2B Authentication, unlimited members $ 100
400 orgs (100 included, 300 x $1) $ 300
-------
$1,100 / monthNot one dollar of that is users. It is ten SAML connections and a few hundred tenants — which is to say, it is the thing that happens when the product succeeds. The same ten connections and the same four hundred organizations cost nothing incremental on Keycloak, because an identity provider instance and an organization are rows in a database you own rather than billable objects.
Keycloak's own cost is honesty about operations: a JVM, a database, a cache, an upgrade cadence, and someone whose job it is to care. That is the trade, and it is why managed Keycloak exists at a fixed monthly price with unlimited users on every tier. If you would rather run it yourself, we support teams who do, and the self-host versus managed page argues both sides.
Clerk's security page is unambiguous, and we would rather quote it than characterise it: "Clerk does not offer regional data residency or region selection." Data is hosted on US infrastructure — Google Cloud and Cloudflare, with all subprocessors in the USA — and "EU, UK, and Swiss personal data is transferred to the US under the Data Privacy Framework," under which Clerk has been self-certified since 22 February 2024.
For a great many applications that is a non-issue. For a European procurement team, or any buyer with a sectoral residency requirement, it is the end of the evaluation — not because the arrangement is unlawful, but because "we cannot choose a region" is an answer a questionnaire has no box for.
Keycloak has no opinion about where it runs, which is the point: it runs where you put it. On our side of that, stated with the unflattering parts included — EU data residency clusters run in Frankfurt with Ireland as the standing backup, identity data is never replicated outside the EU, realm signing keys for EU clusters are held in our KMS in the Frankfurt region, and we are not certified under the EU–US Data Privacy Framework and do not rely on it. The contracting party for EU and UK customers is Phase Two UK, Ltd, registered in England and Wales, company number 16815578. Phase Two, Inc. of Seattle is the parent company. Our control plane runs in the United States and our engineers are distributed globally, so administrative access to an EU cluster can come from outside the EU; that is a restricted transfer and we disclose it rather than hide it. The data processing agreement and our record of government requests are both published.
On certifications the comparison is narrow and checkable. Clerk's security page reports SOC 2 Type 2 since 6 May 2022 and HIPAA, and states that Clerk "is not ISO 27001 certified," noting that its infrastructure providers hold the certification and it does not. Phase Two holds both SOC 2 Type II and ISO/IEC 27001. If you want the longer argument about what residency does and does not buy you, we wrote data residency versus data sovereignty and where your Keycloak data lives.
Both products model a tenant as a first-class object. Clerk's version is the more finished product: organization profiles, invitations, verified domains, just-in-time provisioning from an enterprise connection, roles and permissions defined once at application level, and prebuilt components for all of it. If your application is a B2B SaaS and you have not built any of that yet, Clerk hands you months of work.
Keycloak's Organizations feature is younger and has no UI for your users at all — but it is a default-on feature in 26.8, and it is uncapped. Creating a tenant and binding its own SAML identity provider to it is three calls:
# Keycloak 26.8.2. ORGANIZATION is enabled by default; the realm opts in.
kcadm.sh create realms -s realm=b2b -s enabled=true -s organizationsEnabled=true
kcadm.sh create organizations -r b2b -s name=acme -s alias=acme \
-s 'domains=[{"name":"acme.example","verified":false}]'
# -> Created new organization with id '686b2f25-...'
kcadm.sh create identity-provider/instances -r b2b -s alias=acme-okta \
-s providerId=saml -s enabled=true \
-s 'config.singleSignOnServiceUrl=https://acme.okta.example/sso/saml'
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '"acme-okta"' \
"$KC/admin/realms/b2b/organizations/$ORG_ID/identity-providers" # 204
# The connection now belongs to the organization:
{"alias": "acme-okta", "providerId": "saml", "enabled": true,
"organizationLinks": [{"organizationId": "686b2f25-...",
"autoMembership": true,
"membershipType": "UNMANAGED"}]}Run that loop four hundred times and the bill does not move. The honest counterweight is that you have just inherited the tenant-management UI that Clerk would have given you. Our open-source organizations extension exists because core Keycloak's version is deliberately minimal — it adds the administrative surface, outbound SCIM provisioning to downstream applications, and an admin portal your customers' own administrators can use. It is still not a React component you drop into your dashboard, and we are not going to pretend it is.
One more asymmetry worth naming, because it catches B2B teams late: Clerk's free B2B allowance caps an organization at 20 members. The first customer who buys thirty seats moves you onto the $100/mo add-on. Keycloak has no member cap, and no notion of a billable organization.
Clerk is the better answer when:
Keycloak earns it when:
private_key_jwt — all advertised in the discovery document on a stock server.The closing note that applies either way: moving off Clerk is unusually civilised — the CSV export carries hashed passwords, so a migration can preserve logins instead of emailing everybody a reset link. We have written that pattern up for other sources in lazy user migration and migrating from Auth0. Whether it is worth doing is a different question from whether it is possible, and for a happy Next.js team on 50,000 free users the answer is usually no. Compare the rest of the field on our Keycloak alternatives index before deciding.
Clerk exports your users with their password hashes, so the credential half of a move is tractable. The expensive half is the UI you no longer get for free, plus sessions, organizations and anything wired to Clerk's components. We will tell you plainly which of the two fits — including when the answer is to stay where you are.
See how we migrate teams to KeycloakMulti-region, high-availability Keycloak with 100+ extensions. Simple, cost-conscious, and customizable.
Run your own Keycloak? Get expert escalation, security patches, and architecture guidance — at any level of complexity.
It depends entirely on which half of Clerk you are buying. If you are buying the prebuilt React components and the absence of a server to run, Keycloak is not a like-for-like replacement and switching will cost you a login UI you did not have to write. If you are buying an identity provider — enterprise SSO for your customers, organizations, a token your backend can verify — then Keycloak does all of that, adds SAML assertion issuing, LDAP and Active Directory federation and the later OAuth profiles that Clerk does not document, runs in whatever region you choose, and has no per-connection or per-organization meter. The honest split: Clerk wins on time to first login, Keycloak wins on what the bill and the questionnaire look like two years in.
No. Clerk is a hosted service and the server is not published; there is no self-hosted edition and no on-premise option. Clerk's client SDKs are MIT-licensed on GitHub, which is a different thing from the product being open source — the SDKs talk to Clerk's Frontend and Backend APIs and do nothing without them. Clerk's security page also states that it "does not offer regional data residency or region selection," so the hosting question and the residency question have the same answer. Keycloak is Apache 2.0 end to end: run it on your laptop, in your own datacentre, in any cloud region, or hand it to a managed host.
No. Clerk's SAML support is enterprise connections, where Clerk is the service provider: your customer's Okta, Entra ID or Google Workspace issues the assertion and Clerk consumes it. Clerk can act as an OAuth 2.0 authorization server and OIDC provider for third-party clients through OAuth Applications, including dynamic client registration and the device authorization grant, but it does not issue SAML assertions to downstream applications. Keycloak does both: every realm publishes a SAML IdP metadata descriptor at /realms/{realm}/protocol/saml/descriptor with HTTP-POST, HTTP-Redirect, SOAP and HTTP-Artifact bindings for sign-on and single logout, on a stock server with no configuration.
Clerk is free to 50,000 monthly retained users, then $25/mo on Pro or $300/mo on Business plus $0.02 per additional user, which is cheap for a consumer application. The cost that surprises B2B teams is elsewhere: one enterprise SSO connection is included per app and additional connections are $75/mo each from the second to the fifteenth, Directory Sync connections are priced the same from 1 January 2027, and B2B organizations are free to 100 with a 20-member cap, after which there is a $100/mo add-on and $1 per organization. Ten SAML customers and four hundred tenants is roughly $1,100 a month before you have billed a single user. Keycloak charges nothing for connections, organizations or users at any scale; what it costs is operations, which is why managed clusters exist at a fixed monthly price.
No. Clerk's security page states that "Clerk does not offer regional data residency or region selection", that data is hosted on US infrastructure with all subprocessors in the USA, and that "EU, UK, and Swiss personal data is transferred to the US under the Data Privacy Framework", under which Clerk self-certified effective 22 February 2024. The same page states Clerk holds SOC 2 Type 2 and HIPAA but "is not ISO 27001 certified". Keycloak runs wherever you deploy it; our EU clusters run in Frankfurt with Ireland as the standing backup, identity data is never replicated outside the EU, and we publish the parts that are less flattering too — the control plane runs in the US and our engineers are distributed globally, so administrative access can come from outside the EU.
Usually yes, and Clerk makes this easier than most. The Clerk dashboard exports a CSV of your users that includes their hashed passwords, and GET /v1/users paginates the same records programmatically. Keycloak will verify those hashes once you give it a password hash provider that understands the algorithm Clerk stored them under — the same pattern we use for other sources. What does not come across is the session: Clerk manages sessions itself, so everyone signed in at cutover will be signed out, and anything you built on Clerk's prebuilt components has to be rebuilt against Keycloak's hosted pages or your own UI. Plan for that work rather than discovering it.