JWT Decoder

Invalid JWT Token.

Paste a JWT token to decode its Header and Payload. Signature verification is not performed.

{...}
{...}
...

Code Examples (Create & Sign JWT)

How to create, sign and verify a JWT token (HS256) in various languages.

Snippet Copied!
// Requires: npm install jsonwebtoken
const jwt = require('jsonwebtoken');

const secret = 'your-super-secret-256-bit-key';
const payload = { 
  sub: '1234567890',
  name: 'Test User',
  iat: Math.floor(Date.now() / 1000) // issued at
};

// Create and Sign
const token = jwt.sign(payload, secret, { expiresIn: '1h' });

console.log(token);

// Verify
try {
  const decoded = jwt.verify(token, secret);
  console.log(decoded);
} catch(err) {
  // err
}