
JWT Encode/Decode: Build and Inspect a Token Online
Decode a JWT header and payload, or sign a test token, right in your browser: HS256, RS256, ES256, with no secret sent to a third-party server.
A JWT is readable by anyone: decode to inspect, sign to test, verify to trust
A JSON Web Token looks opaque, but its first two segments are plain JSON encoded in Base64URL: anyone who holds the token can read it. That is exactly what you want when an API answers 401 and you need to know what the token claims. FastMinify's online JWT decoder decodes the header and payload as soon as you paste the token, and the JWT encoder signs a token from editable header and payload JSON, live, with no submit button. Both run in your browser: the token, the claims and the secret are not sent anywhere. Decoding is not verifying, though. Anyone can write "role": "admin" into a payload, so what a decoded token says proves nothing about who issued it. Checking a signature against an issuer's public keys, the audience, the issuer and the expiry is the job of jwt-verify, which takes a pasted JWKS, and inspect-jwks shows what such a key set contains. This guide covers how a JWT is built, how to debug a 401 or a 403 with a decoded token, the mistakes that turn a test helper into a security hole, and the same operations in Node with the jose library. The tools sit in the security tools hub.
Encode, decode or verify: which tool answers which question
The decoder and the encoder cover everything that does not need to establish trust in an issuer.
Trusting a token takes keys, claims and a policy, not just a readable payload. Hand over to jwt-verify, inspect-jwks or your own code.
Debugging a 401 or a 403 with a decoded token
Paste the token into the decoder and read the time claims before touching the API. exp, nbf and iat are NumericDate values: seconds since 1970-01-01 UTC (RFC 7519).
When the claims are right and the API still refuses, the problem is in the header or the signature.
A 403 means the token was accepted and the authorization step said no. The payload usually tells why.
Four mistakes that turn a test helper into a security hole
A decoder shows what a token claims, not who wrote it. The payload is not protected: whoever has the token, or can build one, can put any claim in it. The encoder can even produce an unsecured token with alg=none, whose signature segment is empty: the tools label it "Unsecured JWT (alg=none)", and no verifier should ever accept it. RFC 8725 (JWT best current practices) asks servers to accept only the algorithms they expect and never to let the token choose. Algorithm confusion is the classic failure: a token that declares HS256 and is signed with the public key of an RS256 service passes a verifier that reads alg from the header and uses the public key as the HMAC secret.
Base64URL is an encoding, not encryption: the Base64 guide explains the difference. A signed JWT (JWS) only guarantees integrity, so everything in the payload is readable. Encrypted tokens exist (JWE, RFC 7516, five parts instead of three), but the decoder here handles signed tokens only. A token is also a credential: whoever holds it can use it until exp. This tool keeps it in your tab, but a screen share, a shared screenshot or a ticket pasted with the token still leaks it.
HS256 signs with a shared secret, and RFC 7518 asks for a key at least as long as the hash output: 256 bits for HS256, 384 for HS384, 512 for HS512. When your secret is shorter, the encoder shows how many bits it has against the recommended minimum. That figure is the key length, not its randomness: a 32-character English phrase is 256 bits long and still guessable. An attacker who holds one token can test candidate secrets offline against its signature without ever touching your API. Draw the secret randomly, for example with the password generator (see the password guide): about 41 characters from its default 82-character set carry 256 bits of entropy. The Base64URL option changes the bytes used: ticked, the secret string is decoded as Base64URL and its bytes are the key; unticked, the characters themselves are the key. The same text with the wrong setting yields a different signature.
The encoder is built for fixtures and debugging. It rewrites iat to now, can drop the signature entirely, and the examples it loads use throwaway secrets. A token signed here with a demo secret must never be accepted by a real environment, and a real signing secret must never be pasted in a file you then commit. If one already was, rotate it, and scan your diff before committing with the secrets scanner.
Anatomy of a JWT: three Base64URL segments and what each one says
The compact form is three Base64URL segments joined by dots. It is what travels in an Authorization: Bearer header.
Seven registered claims (RFC 7519) cover most debugging sessions. All are optional in the specification, so an API may require more than the standard does.
The alg value decides who can mint a token and who can only check one.
Decode and encode in the tools: the walkthrough
The JWT decoder has no button: decoding runs as you paste or edit, after a short pause. The editor starts empty; "Load sample" or picking an algorithm loads a demo token.
Paste the compact token
Only the three segments, without the Bearer prefix. Leading and trailing whitespace is ignored.
Read the header and the payload
Both appear as formatted JSON in their own panel, next to the raw signature. Check alg, kid, exp, aud and iss first.
Optionally check the signature
Paste the HMAC secret, or a public key as PEM or JWK for the asymmetric algorithms. The result is "Signature verified" or "Signature invalid", and it covers the signature only.
Read the error if there is one
The decoder reports a wrong number of parts, an empty segment, a missing signature (allowed only for alg=none) or a segment that is not Base64URL JSON.
The JWT encoder signs as you type. The token appears as soon as the header, the payload and the key are valid.
Choose the algorithm
Use the toolbar or edit alg in the header JSON. A missing or unsupported alg is reported as an invalid header.
Write the claims
A JSON object. iat is overwritten with the current time on every encode, so you cannot pin an old iat.
Set an expiry if you need one
The Expiration menu (15 minutes, 1 hour, 24 hours) overwrites any exp in the JSON. None keeps your payload as it is.
Provide the key
A secret for HMAC, or a PEM (PKCS#8) or JWK private key for RSA, ECDSA and EdDSA. A secret under the recommended length shows a warning with its size in bits.
Copy the token and check it
Paste it into the decoder to see what you produced, then into jwt-verify to test a real verification policy.
A few limits to know before relying on them for a specific use.
The same operations in your own code
Decoding needs no library: split on the dots and read each segment as Base64URL. This is what the decoder does, and it has the same limit: nothing is checked.
Basic example
The jose library signs a compact JWT and sets the registered claims for you. Unlike the encoder here, setIssuedAt() uses the real clock, as it should in production.
Basic example
Verification is where trust is established: pin the algorithm, the issuer and the audience, and allow a small clock tolerance.
Basic example
Nothing to install and nothing sent: the decoder and the encoder cover reading claims, building fixtures and checking a signature you hold the key for. The trade-offs: no claim validation, no timestamp conversion, no JWE, EdDSA limited to Ed25519. For a real trust decision, use a verification library on the server, or paste a JWKS into jwt-verify to test your policy first.
Conclusion
A JWT is a signed envelope, not a sealed one: its payload is readable by anyone, and only the signature tells you it was not changed. The JWT decoder makes the claims visible in seconds, which is most of what a 401 or a 403 needs, and the JWT encoder builds a token to reproduce a case. Neither of them establishes trust. That takes the issuer's keys, a pinned algorithm and checks on aud, iss and exp, which is what jwt-verify and your own server code do. Keep test secrets out of production, draw HMAC secrets randomly, and refuse alg=none. The security tools hub gathers the neighbouring tools for keys, certificates and secrets.
Related Articles

Length, entropy, symbols: generate a strong password in your browser with Web Crypto, no network transit, and know what the tool does not guarantee.

Test a JavaScript regex, inspect capture groups, and preview a $1 replace in the browser before the pattern lands in production code.

Random UUID v4, sortable UUID v7 and ULID, or compact customizable Nanoid: a comparison and online generators for primary keys, public IDs and tokens.