JWT Wrong Segment Count – Fix Tokens with 2 or 4 Parts

Local only

Check a malformed JWT whose compact form contains the wrong number of dot-separated segments.

39 chars · 1 line

Needs attention

Enter a JWT with three non-empty dot-separated segments

JWT structure error

How to fix a JWT with the wrong number of segments

A compact JWT is expected to contain header.payload.signature. If a token has only two parts or includes an extra separator, the decoder stops before Base64URL or JSON parsing because the outer token structure is incomplete. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • Browser-local JWT decoding
  • Strict three-segment validation
  • Canonical Base64URL checks
  • Header and payload JSON validation
  • Expiration status details
  • No signature verification claims

Steps

  1. Split the token visually at each dot.
  2. Confirm there are exactly three non-empty segments.
  3. Recover the complete token from its issuer rather than inventing a missing signature or claim segment.

JWT compact serialization has three positions

For the JWTs handled by this decoder, the first segment is the protected header JSON, the second is the payload JSON, and the third is the signature bytes represented as text. The decoder requires all three positions before inspecting the first two.

Two-part JWT example

The sample stops after the payload and therefore cannot be treated as a complete JWT.

Invalid token

header.payload

Expected structure

header.payload.signature

Common questions

Frequently asked questions

Can a normal JWT contain only two segments?

Not in the compact three-part JWT format decoded by this page. Obtain the complete token from the system that issued it.

Does adding an arbitrary third segment make the token trustworthy?

No. A complete shape only makes decoding possible; signature verification still requires the correct key and validation rules.

Are dots allowed inside an encoded segment?

JWT compact segments use Base64URL, whose alphabet does not include the dot separator.

Debugging a specific JWT issue? Browse JWT troubleshooting.