pipr.tools
Pipes
Clean Email Strip formatting from pasted email for clean plain text Clean AI Output Clean plain text from ChatGPT or AI output Decode & Format JWT Decode a JWT and pretty-print header and payload Word Frequency Count word frequency in text

jwt-decode Decode a JWT token (no verification)

{ } Encode
Input0 chars
Output0 chars

Examples

Decode a JWT to inspect header and payload

Usage
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODk..." | jwt-decode

Debug an expired token from a customer support ticket

Usage
"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoLmV4YW1..." | jwt-decode

Verify user claims in a JWT from a staging environment

Usage
"eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiYm9iIiwidGVhbSI6ImVuZ2luZWV..." | jwt-decode
View source
(input)=>{
                try {
                    const parts = input.trim().split(".");
                    if (parts.length < 2) return "Error: not a valid JWT";
                    const header = JSON.parse(atob(parts[0].replace(/-/g, "+").replace(/_/g, "/")));
                    const payload = JSON.parse(atob(parts[1].replace(/-/g, "+").replace(/_/g, "/")));
                    return JSON.stringify({
                        header,
                        payload
                    }, null, 2);
                } catch (e) {
                    return `Error: ${e.message}`;
                }
            }

Also useful for