What is JWT?
Understand JSON Web Tokens—header, payload, signature—and how to inspect claims locally without treating decoding as verification.
A JWT (JSON Web Token) is a compact way to carry claims between parties. You will see JWTs in Authorization headers, browser storage, and service-to-service calls. A typical token has three Base64url-encoded parts separated by dots: header, payload, and signature.
What each part means
- Header — metadata such as the algorithm (
alg) and token type. - Payload — claims like subject (
sub), expiry (exp), audience (aud), and custom fields. - Signature — integrity check over the header and payload using a secret or key pair.
Decoding the first two parts only reveals JSON. It does not prove the token is authentic. Verification requires the correct key and claim checks in your real auth stack.
Common pitfalls
- Assuming “I can read it” means “it is valid.”
- Accepting
alg: noneor unexpected algorithms. - Putting long-lived secrets inside JWT payloads.
- Pasting production tokens into shared or public tools.
Local inspection workflow
- Copy a sample token you own (never a live production secret on a shared machine).
- Inspect header and payload structure.
- Confirm expiry and audience claims look right.
- Verify signatures in your application code—not in a random website.
Practice on ToolHub
Open JWT Decoder to inspect structure locally. Use Base64 Encode/Decode when you need to understand the encoding layer, and Hash Generator when comparing digests in related security workflows. Prefer ToolHub’s privacy-first defaults: sensitive tools keep history off until you opt in.
Compare approaches
Auth design often chooses between tokens and server sessions. Read JWT vs Session Cookies for a structured comparison, and What is Base64? for the encoding underneath JWT segments.
Try related tools
Keep exploring
- learnWhat is Base64?Learn Base64 encoding—why APIs use it, how it differs from encryption, and how to encode or decode strings locally in your browser.
- learnWhat is JSON?Learn what JSON is, why APIs use it, common syntax rules, and which ToolHub utilities help you format and validate payloads locally.
- collectionDeveloper EssentialsEncoding, hashing, regex, UUIDs, JWT inspection, and other daily browser utilities for engineers.
- collectionSecurity HelpersInspect JWTs, generate hashes and passwords, and encode payloads locally before they leave your machine.
- compareJWT vs Session CookiesStateless tokens versus server sessions—how auth state travels and what to verify.
- compareSigned vs Unsigned JWTVerified tokens versus alg=none structures—compare what a signature guarantees and why unsigned tokens are a teaching tool only.