Decode Supabase JWT Tokens
Decode Supabase JWT tokens online. Inspect role, app_metadata, user_metadata, aal, and session_id claims with no data leaving your browser.
Encoded Token
{
"alg": "HS256",
"typ": "JWT"
}{
"aud": "authenticated",
"exp": 1761465600,
"iat": 1761379200,
"iss": "https://demoproject.supabase.co/auth/v1",
"sub": "a8b1c2d3-e4f5-6789-abcd-ef0123456789",
"email": "user@example.com",
"phone": "",
"app_metadata": {
"provider": "email",
"providers": [
"email"
]
},
"user_metadata": {
"full_name": "Demo User"
},
"role": "authenticated",
"aal": "aal1",
"amr": [
{
"method": "password",
"timestamp": 1761379200
}
],
"session_id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"is_anonymous": false
}HMACSHA256( base64UrlEncode(header) + "." + base64UrlEncode(payload), secret )
This tool decodes JWT tokens for inspection only. No signature verification is performed. Never trust unverified tokens in production.
Why Supabase Tokens Are Different
Supabase issues HMAC-SHA256 signed JWTs (HS256) by default — not the asymmetric RS256 most other identity providers use. The signing secret is your project's SUPABASE_JWT_SECRET, which is shared between your Postgres database and your application. Your Postgres Row Level Security (RLS) policies decode the token directly inside SQL using auth.jwt(), which makes Supabase JWTs uniquely intertwined with your database schema.
This pre-loaded sample token is a typical Supabase access token for an authenticated user. Replace it with your own to debug RLS failures, role mismatches, or session inconsistencies.
Supabase-Specific Claims and What They Mean
role— Eitherauthenticated(logged-in user),anon(anonymous public access), orservice_role(full admin, never exposed to clients). Postgres RLS policies branch on this.aud— Alwaysauthenticatedfor user tokens. RLS uses this implicitly.iss— Formathttps://<project-ref>.supabase.co/auth/v1. Verify this matches your project before trusting the token.sub— The user's UUID. This is the same value asauth.users.idin your database. RLS policies typically checkauth.uid() = user_id.app_metadata— Server-controlled metadata. Users cannot modify this. Use it for plan tier, internal flags, etc.user_metadata— User-controlled metadata. Users can modify this viaupdateUser(). Never trust it for authorization.aal— Authenticator Assurance Level.aal1= single-factor,aal2= MFA verified. Critical for sensitive operations.session_id— Allows server-side session revocation. Storing this lets you invalidate a specific session without rotating the JWT secret.amr— Array of authentication methods used. Includespassword,oauth,otp,totp, etc.is_anonymous—truefor guest sessions created viasignInAnonymously(). Always check this before granting privileged actions.
Debugging Row Level Security with the Token
"My RLS policy denies a user that should have access." Decode the token, then run SELECT auth.jwt() in the SQL editor as that user. The decoded values must match what your policy expects. The most common bug: a policy checks app_metadata->>'plan' = 'pro' but the field is actually in user_metadata (which users can fake) — or vice versa.
"Anonymous user is being treated as authenticated." Check is_anonymous. RLS policies should explicitly handle this — anonymous tokens still have role=authenticated, which is intentional but easy to miss.
"MFA isn't enforced." Sensitive policies should check aal = 'aal2', not just role = 'authenticated'. Otherwise a single-factor login bypasses MFA.
Related Tools
- Generic JWT Decoder
- Auth0 JWT Decoder
- Unix Timestamp Converter
- UUID Generator — generate new sub UUIDs for testing
Common Use Cases
Decode Auth0 JWT Access Tokens
Inspect Auth0 access tokens — view scopes, audience, expiration, and custom permissions instantly.
Decode Google OAuth ID Tokens
Decode Google Sign-In ID tokens — verify email, picture, audience, and at_hash claims in your browser.
Decode Supabase JWT Tokens
Inspect Supabase auth tokens — verify role, session_id, app_metadata, and aal claims for RLS debugging.
Decode AWS Cognito JWT Tokens
Inspect AWS Cognito access and ID tokens — view cognito:groups, token_use, scope, and client_id claims.
Related Articles
How to Debug JWT Authentication Issues
Decode JWTs, read claims, and fix the 5 most common auth errors — expired tokens, wrong audience, algorithm mismatch, and more.
What is JWT? JSON Web Tokens Explained
Learn what JSON Web Tokens are, how they work, their structure (header, payload, signature), and when to use them for authentication and authorization.