Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions docs/guides/development/troubleshooting/jwt-decoder.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Decode Clerk JWTs
description: Decode JWTs and inspect claims.
template: wide
---

<ClerkJWTDecoder>
Visit your frontend that is using Clerk and sign in. Once you have signed in, open the browser [Dev Tools](https://developer.mozilla.org/en-US/docs/Learn_web_development/Howto/Tools_and_setup/What_are_browser_developer_tools) and go to the **Console** tab. Enter the following command:

```js
await window.Clerk.session.getToken()
```

Copy the console output and paste it into the JWT input to decode the token.

Alternatively, you can use the [`getToken()`](/docs/reference/javascript/session#get-token) method from a Clerk SDK.
</ClerkJWTDecoder>

## How this tool works

The JWT Decoder lets you decode and verify JWTs. Currently only the RS256 algorithm is supported. Paste a JWT or select a Clerk session cookie to decode and verify the token. Click 'Create Example' to generate a random key set and JWT. You can add data to the payload and click 'Resign' to generate a new JWT from the payload.

> [!WARNING]
>
> The JWTs generated by this tool are for demonstration and educational purposes only. Do not use them for authentication, authorization, or any production use. Keys are generated client-side in your browser. This tool is intended for learning and debugging JWT structure, not for creating valid, production-ready tokens. All verification and decoding occurs in your browser and is not sent to the server.

## More resources

<Cards>
- [Customize your session tokens](/docs/guides/sessions/customize-session-tokens)
- Learn more about how to customize your session tokens.

---

- [Session tokens](/docs/guides/sessions/session-tokens)
- Learn more about Clerk's session tokens.

---

- [Tokens and signatures](/docs/guides/how-clerk-works/tokens-and-signatures)
- Learn more about JWT signatures.

---

- [Clerk cookies & tokens](/docs/guides/how-clerk-works/overview#clerks-cookies-and-tokens-in-detail)
- Learn more about how Clerk uses cookies and JWTs.
</Cards>
4 changes: 4 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1210,6 +1210,10 @@
"title": "Script loading",
"href": "/docs/guides/development/troubleshooting/script-loading"
},
{
"title": "JWT decoder",
"href": "/docs/guides/development/troubleshooting/jwt-decoder"
},
{
"title": "Help & support",
"items": [
Expand Down