API Toolkit

JWT Size Analyzer

All tools

Find out whether a token is about to outgrow its cookie.

How it works

Four simple steps

1

Paste the token

A JWT or a full header value.

2

Count bytes

Characters and UTF-8 bytes are measured.

3

Compare to 4 KB

See OK or OVER against the cookie soft limit.

4

Check the parts

The segment count hints at JWS, JWE or a missing signature.

JWT Size Analyzer

About JWT Size Analyzer

Users with many group memberships start getting logged out at random while everyone else is fine. The usual cause is a session token that grew past what the browser will store in a cookie, and measuring one of the failing tokens confirms it.

Paste a token and the analyzer reports four things: its length in characters, its size in UTF-8 bytes, whether that size is within a 4,096 byte soft limit for cookies, and how many dot-separated parts it has. Three parts is a normal signed JWT, two suggests the signature is missing, and five usually means an encrypted JWE. The check runs as you type and accepts any text, so you can also measure a complete Cookie or Authorization header value.

Browsers cap each cookie at about 4 KB including its name and attributes, so a token measuring close to 4,096 bytes on its own is already too big once those are added. Servers and proxies limit total header size too, often somewhere between 8 KB and 16 KB, and every API call carries the token, which adds up on mobile connections. Typical culprits are role or group arrays and profile data that belong behind an API call. To see which claims take the space, decode the token with the JWT claims viewer, and the token security review flags oversized tokens alongside other issues.

Sizes are calculated locally with the Blob API, without transmitting the token.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

JWTs are normally pure ASCII, so both numbers match. They differ when the pasted text contains non-ASCII characters, which take two or more bytes each in UTF-8.

Probably not in a cookie. The cookie name, path, domain and other attributes count toward the same limit, so leave a margin of a few hundred bytes or move the token out of the cookie.

Header limits are larger than cookie limits, but each server and proxy sets its own, and a large token is still sent with every request. Keeping tokens small helps either way.

View more FAQs

Related tools

View all

Webhook HMAC Signer

Sign and verify GitHub, Stripe, and Slack webhook signatures locally.

Open

Webhook Replay Diff Lab

Compare webhook payload timelines, re-check HMAC digests, and spot idempotency gaps locally.

Open

JSONPath Playground

Query JSON with JSONPath and JMESPath-style paths side by side.

Open

GraphQL Studio

Format, validate, and cost-estimate GraphQL documents with cURL export.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools