When building applications with Firebase Authentication, your frontend receives a Firebase ID Token—a specialized JSON Web Token that proves the user's identity to your backend services, Cloud Functions, and Firebase Security Rules. But when a database read fails or a Cloud Function rejects a request, you need to know exactly what is inside that token. Our Firebase JWT Token Decoder is built specifically to help developers inspect Firebase ID tokens instantly and securely.
Unlike generic decoders, this tool highlights the unique structure of Firebase tokens, specifically the nested firebase claim object that contains critical metadata like the sign-in provider and linked identities. Because Firebase tokens grant access to your production database and storage buckets, pasting them into third-party websites is a massive security risk. Our decoder runs 100% locally in your browser, ensuring your active session tokens remain completely private.
The Anatomy of a Firebase ID Token
While Firebase ID tokens follow the standard JWT structure (Header.Payload.Signature), their payload contains a very specific set of claims defined by Google's Identity Platform. Understanding these claims is the key to debugging authentication flows.
The 'firebase' Claim Object
This is the most critical part of a Firebase token. It is a nested JSON object that tells your backend exactly how the user authenticated. It includes:
- sign_in_provider: Indicates whether the user logged in via 'password', 'google.com', 'apple.com', 'custom', or 'anonymous'.
- identities: A map of the provider IDs linked to this account (e.g., the user's Google email or Apple UID).
- tenant: If you are using Firebase Authentication with Identity Platform multi-tenancy, this shows the tenant ID.
Standard Identity Claims
Alongside the Firebase object, the payload includes standard OIDC claims like sub (the Firebase UID), email, email_verified, and picture (avatar URL).
Debugging Firebase Security Rules
The most common use case for decoding a Firebase token is troubleshooting Firestore or Realtime Database Security Rules. If your frontend is getting 'Missing or insufficient permissions' errors, the issue usually lies in the token's claims.
| Security Rule Variable | Corresponding JWT Claim | What to Check in the Decoder |
|---|---|---|
| request.auth.uid | sub | Does the UID match the document owner? |
| request.auth.token.email | email | Is the email verified? (email_verified: true) |
| request.auth.token.firebase.sign_in_provider | firebase.sign_in_provider | Are you blocking anonymous logins? |
| request.auth.token.admin | Custom Claim | Did the Admin SDK successfully set the custom claim? |
Handling Firebase Custom Claims
For role-based access control (RBAC), developers use the Firebase Admin SDK to attach custom claims (like admin: true or premium: true) to a user's token. These custom claims appear at the root level of the decoded payload. If your Security Rules are checking for a custom claim but it is missing in the decoded token, it means either the Admin SDK script hasn't run yet, or the user hasn't refreshed their ID token on the client side (using user.getIdToken(true)).
Why Local Decoding is Mandatory for Firebase
A Firebase ID token is a bearer token. Anyone who possesses it can read and write to your Firestore database, upload files to your Storage buckets, and invoke your Cloud Functions—impersonating that exact user. Uploading a production Firebase token to a generic online debugger means handing over your database keys to an unknown server. Our tool processes the Base64URL string entirely within your browser's JavaScript engine. The token is parsed, displayed, and then forgotten the moment you close the tab.
Troubleshooting Common Firebase Token Errors
- "Token expired" in Cloud Functions: Firebase ID tokens expire every 60 minutes. Check the
exp(expiration) timestamp in the decoder. If it has passed, your client SDK needs to silently refresh the token. - "Invalid signature" on backend: This tool decodes but does not verify signatures. To verify, your backend must fetch Google's public JWKS (JSON Web Key Set) from
https://www.googleapis.com/robot/v1/metadata/jwk/securetoken@system.gserviceaccount.comand match thekid(Key ID) in the token header.
Final Thoughts
Whether you are writing complex Firestore Security Rules, debugging a Cloud Functions onCall handler, or verifying custom claims for premium subscriptions, our Firebase JWT Decoder gives you instant, secure visibility into your authentication tokens without compromising your application's security.