Skip to content
86% off$349 $48.86code BF2026

Guides

Why Can I Read a JWT Without the Key? It Isn't Encrypted

Is a JWT encrypted? No. The header and payload are plain Base64URL, so anyone can read them. What the signature proves, what to keep out of claims, and JWE.

GuideUpdated 7 min read

On this page

You pasted a token into a decoder, saw every claim, and no secret was asked for. You may be wondering: "Why is my JWT readable without the key? Is a JWT encrypted?" Nothing is broken or leaked. That is how the format works, and the mistake to avoid is putting something in a token that the holder must not see.

Why a JWT is readable without a key

A JWT is three parts separated by dots: header.payload.signature. Here are the first two parts of a common sample token:

text
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ

Decode them and you get ordinary JSON:

json
{ "alg": "HS256", "typ": "JWT" }
json
{ "sub": "1234567890", "name": "John Doe", "iat": 1516239022 }

Base64URL uses a fixed, public alphabet. It turns bytes into URL-safe text so the token travels in headers and URLs. Anyone can reverse it: the user, a browser extension, someone reading a proxy log, or an attacker with a copied token.

The header names the algorithm in the open because the server needs it to know how to check the signature. So "readable without the key and the algorithm" is by design. People on developer forums raise this question often, and the usual answer is that a JWT is meant to be read by whoever holds it.

What the signature does and doesn't do

The signature is computed over the header and payload with a secret (HS256, HS384, HS512) or a private key (RS256, ES256, EdDSA and others). A server with the secret or the matching public key recomputes it and compares.

QuestionDoes the signature answer it?
Was the payload changed after issue?Yes. Changing one character breaks verification.
Was it issued by a holder of the signing key?Yes.
Can the holder read the claims?Not covered. Anyone with the token can read them.
Is the token still valid?Only if you also check exp, nbf and your own rules.
Can I trust the token because it decodes?No. Only a verified signature counts.

The last row matters most. A token that decodes and shows "role": "admin" is just text anyone could have typed. Your server must verify the signature before believing any claim. A header with alg: none means the token is unsigned, and a server should never accept it as proof of anything.

What to keep out of claims

Treat the payload as public to whoever holds the token.

Fine to include:

  • A user or subject ID (sub)
  • Issue and expiry times (iat, exp, nbf)
  • Issuer and audience
  • Coarse roles or scopes the client is allowed to know about

Keep out:

  • Passwords, API keys, client secrets and private keys
  • Personal data you wouldn't show in the user's browser (government IDs, addresses, payment details)
  • Internal flags or notes about the account that neither the user nor a third party should see

HTTPS protects a token in transit. It does not change what is inside it. Once the token reaches a browser, an app or a log file, the payload is readable there.

If you already shipped secrets in claims, treat them as exposed. Rotate them, stop including them and shorten token lifetimes. Changing the signing key invalidates old tokens, but it does not un-leak what was already read.

If the payload must be private

You have three options, from simplest to heaviest.

1. Keep the data out of the token

Put an ID in sub and look the data up on the server. This is usually the right fix.

2. Use an opaque token

A random session or reference token carries no readable data, and the server maps it to the session. You give up the stateless property that makes JWTs attractive, so choose this when privacy or easy revocation matters more.

3. Use an encrypted JWT (JWE)

JSON Web Encryption is a separate standard (RFC 7516) where the payload really is encrypted. A compact JWE has five dot-separated parts instead of three, and only a holder of the decryption key can read the contents. The header stays readable because the recipient needs it to know how to decrypt. A common pattern is to sign first and then encrypt, so the receiver gets both integrity and confidentiality. Encryption adds key management, so use it only when claims must be hidden from the client.

OptionClient can read data?Stateless?Cost
Plain signed JWTYesYesLowest
ID in sub, data on serverNo data in tokenYes, plus a lookupA server lookup
Opaque tokenNoNoServer session store
JWENoYesKey management

Read a token locally on your Mac

A token that hasn't expired is a credential, and whoever holds it can usually present it as you. If your policy is "no live tokens in a browser tab", use an offline tool.

The built-in route is thin. The base64 command in Terminal only does Base64. JWT parts use the URL-safe alphabet without padding, so you would swap characters and add padding by hand, and you would still learn nothing about expiry or signatures. Web debuggers such as jwt.io can decode, verify and generate tokens. Auth0 staff have said decoding there happens in the browser, which is enough for many people.

We make Bytepliers, so weigh our view accordingly. Its JWT Decoder runs on your Mac with no network:

  1. Open Bytepliers and press ⌘4 (Command-4) to open JWT Decoder.
  2. Paste the token into Token. A Bearer prefix is fine.
  3. Read Header and Payload. Badges show Expired, Not Yet Valid, Valid or No Expiry, plus alg and iat, nbf and exp with relative times.
  4. To check the signature, use the Signature pane. Enter a Secret (UTF-8, Base64 or Hex) or a Public key (PEM, bare Base64 DER, or a JWK or JWK Set). The result reads Signature verified, Invalid signature, Unsigned token, Unsupported alg … or Key not usable.

JWT Decoder inputs are not recorded in history unless you turn on Also record inputs that look like secrets in Settings (off by default). Anything you copy is marked concealed for clipboard managers that honor that convention. Keys stay in memory and are cleared when you leave the tool, or kept only until you quit if you turn on Remember keys.

This covers reading a signed token, seeing its expiry state and verifying a signature against a key you supply. It does not make a token private, and we don't list support for decrypting JWE, so use a JWE-capable library for those. For a faster route, see the Quick Panel, or our guide to decoding a JWT on Mac. Bytepliers is part of MacSuite and free to try for 7 days (as of November 2026): Bytepliers page.

Checklist before you trust a token

  • The signature was verified with the right key, not just decoded.
  • The algorithm is one you expect, and alg: none is rejected.
  • exp and nbf are checked against a correct clock.
  • iss and aud match what your service expects.
  • The payload holds nothing you wouldn't show the user.

If the decode doesn't work as expected

  • Garbage instead of JSON. You may have a JWE (five parts). The header still decodes, but the payload is ciphertext and needs the decryption key.
  • A truncated token. Logs and partial copies can drop the tail. Copy the full token again.
  • Stray characters. Quotes or extra text from a log break decoding. Remove everything except an optional Bearer prefix.
  • No Signature verified result. Check the key encoding (the same text as UTF-8 and as Base64 gives different results), that the algorithm matches, and that you entered the public key, not the private one, for RS, ES and EdDSA tokens.
  • Expired badge looks wrong. It compares exp with your Mac's clock, so check the clock first.

Common questions

Is a JWT encrypted?

Not by default. A standard JWT is a signed token. Only a JWE is encrypted.

Is it a problem if the user can read their own JWT?

Usually not, as long as it holds only things you're happy for them to see. The real risks are secrets in claims and servers that trust a token without verifying its signature.

Can someone edit the payload and keep using the token?

They can edit it, but the signature will no longer match, so a server that verifies correctly rejects it. Servers that skip verification or accept alg: none are the vulnerable ones.

Does HTTPS hide the payload?

From network eavesdroppers, yes. From the user, their browser tools, logs and anything else that handles the token after it arrives, no.

Every app.
One purchase.