JSON Web Tokens (JWTs, RFC 7519) are the standard format for stateless authentication in modern web APIs. A JWT is three Base64URL-encoded segments separated by dots — header, payload, and signature. The header specifies the signing algorithm; the payload carries claims (user ID, expiration, scopes, custom data); the signature proves the token was issued by a holder of the signing key and has not been tampered with.
This decoder parses any JWT and displays the header and payload in readable JSON, converts numeric timestamps (iat, exp, nbf) to human-readable dates, shows time-to-expiry, and supports HMAC signature verification for HS256/HS384/HS512 tokens if you provide the shared secret. Asymmetric algorithms (RS256, ES256) require the public key and are typically verified by your identity provider's tooling.
All decoding and verification happens entirely in your browser — no token, payload, or secret is transmitted. That said, as a general security practice, avoid pasting production tokens with broad privileges or long expirations into any tool. For diagnostic work, prefer short-lived tokens or rotate immediately after inspection.
JSON Web Token'lar (JWT, RFC 7519), modern web API'lerinde stateless kimlik doğrulamanın standart formatıdır. Bir JWT noktayla ayrılmış üç Base64URL kodlu bölümden oluşur — header, payload ve imza. Header imzalama algoritmasını belirtir; payload claim'leri taşır (kullanıcı ID, exp, scope, custom veri); imza, token'ın imzalama anahtarı sahibi tarafından verildiğini ve değiştirilmediğini kanıtlar.
Bu decoder herhangi bir JWT'yi parse edip header ve payload'ı okunabilir JSON olarak gösterir, sayısal timestamp'leri (iat, exp, nbf) insan-okunabilir tarihlere çevirir, exp'ye kalan süreyi gösterir ve paylaşılan secret sağlarsanız HS256/HS384/HS512 token'lar için HMAC imza doğrulamasını destekler. Asimetrik algoritmalar (RS256, ES256) public anahtar gerektirir ve genelde kimlik sağlayıcınızın araçlarıyla doğrulanır.
Tüm decode ve doğrulama tamamen tarayıcınızda olur — token, payload veya secret iletilmez. Yine de genel güvenlik pratiği olarak, geniş yetkili veya uzun ömürlü üretim token'larını online araçlara yapıştırmaktan kaçının. Tanı çalışmaları için kısa ömürlü token tercih edin veya inceleme sonrası hemen rotate edin.
Real debugging scenarios
Gerçek hata ayıklama senaryoları
Expiring token issue. Users complain about getting logged out unexpectedly. Decode a fresh token: if exp is 5 minutes from issuance, you have a short access token (expected) — check that your refresh flow is working. If exp is hours and users still get logged out, the issue is elsewhere (cookie clearing, server-side revocation).
403 instead of expected 200. Decode the token and check the aud and scope claims. Common cause: token issued for a different audience or missing the scope the endpoint requires.
Algorithm confusion. If a token's header shows alg: none, your server should reject it immediately. Production tokens always have a real algorithm. A none-alg token in flight indicates either a misconfigured library or an active attack.
Süresi dolan token sorunu. Kullanıcılar beklenmedik şekilde oturumlarının kapandığından şikayet ediyor. Taze token'ı decode edin: exp verilişten 5 dakika sonra ise kısa ömürlü access token (beklenen) — refresh akışınızın çalıştığını kontrol edin. exp saatler ise ve kullanıcılar yine de çıkarılıyorsa sorun başka yerde (cookie temizleme, server tarafı iptal).
200 yerine 403. Token'ı decode edip aud ve scope claim'lerini kontrol edin. Yaygın sebep: farklı audience için verilmiş token veya endpoint'in gerektirdiği scope eksik.
Algoritma karışıklığı. Token header'ı alg: none gösteriyorsa, sunucunuz hemen reddetmeli. Üretim token'larında her zaman gerçek algoritma vardır. Trafikteki none-alg token ya hatalı yapılandırılmış kütüphaneyi ya aktif saldırıyı gösterir.
Security pitfalls to avoid
Kaçınılacak güvenlik tuzakları
Trusting payload before verification. Always verify the signature before using any claim values.
Accepting any algorithm from header. Configure the verifier with an explicit algorithm whitelist.
Long-lived access tokens. Use short access tokens + refresh tokens, not 24-hour access tokens.
Storing JWT in localStorage. Use HttpOnly cookies for browser apps unless you have a specific reason.
Putting PII in claims. The payload is not encrypted; treat it like a public string.
Doğrulamadan önce payload'a güvenmek. Herhangi bir claim değerini kullanmadan önce imzayı her zaman doğrulayın.
Header'dan gelen algoritmayı kabul etmek. Doğrulayıcıyı açık algoritma whitelist ile yapılandırın.
Uzun ömürlü access token'lar. 24 saatlik access token yerine kısa access token + refresh token kullanın.
JWT'yi localStorage'da saklamak. Tarayıcı uygulamaları için belirli bir sebep yoksa HttpOnly cookie kullanın.
Claim'lere PII koymak. Payload şifreli değildir; public string gibi davranın.
Frequently asked questions
Sık sorulan sorular
What is a JWT?
A compact, URL-safe token format (RFC 7519) consisting of header.payload.signature, Base64URL-encoded. Used for stateless authentication and information exchange.
What does the exp claim mean?
Expiration time, as a Unix timestamp. The token must be rejected after this time. Most APIs allow a small clock-skew tolerance (≤60s).
Is it safe to paste my JWT here?
Decoding happens in your browser; nothing is sent over the network. As a security practice, avoid pasting high-privilege production tokens into any online tool.
Why does signature verification only work for HMAC algorithms?
HMAC uses a shared secret known to both issuer and verifier; we can verify with the secret you provide. RS256/ES256 use asymmetric keys; verification requires the public key from your JWKS endpoint.
What's the difference between JWS and JWE?
JWS (JSON Web Signature) is what we call "a JWT" — signed but not encrypted; payload is readable. JWE (JSON Web Encryption) encrypts the payload as well. Use JWE when claims contain confidential data.
How do I know which algorithm my service uses?
Decode a sample token; the alg field in the header is the algorithm. Common production choices: RS256 (asymmetric, by far most common), ES256 (asymmetric, smaller signatures), HS256 (symmetric, used in low-stakes or internal contexts).
JWT nedir?
Kompakt, URL-güvenli token formatı (RFC 7519); header.payload.imza şeklinde Base64URL kodlu. Stateless kimlik doğrulama ve bilgi alışverişi için kullanılır.
exp claim'i ne demek?
Son geçerlilik zamanı, Unix timestamp. Bu zamandan sonra token reddedilmelidir. Çoğu API küçük saat kayması toleransı (≤60s) verir.
JWT'mi buraya yapıştırmak güvenli mi?
Decode tarayıcınızda olur; ağa hiçbir şey gönderilmez. Güvenlik pratiği olarak yüksek yetkili üretim token'larını hiçbir online araca yapıştırmayın.
İmza doğrulama neden sadece HMAC için çalışır?
HMAC, hem vericinin hem doğrulayıcının bildiği paylaşılan secret kullanır; verdiğiniz secret ile doğrulayabiliriz. RS256/ES256 asimetrik anahtar kullanır; doğrulama JWKS endpoint'inizden public anahtar gerektirir.
JWS ile JWE farkı nedir?
JWS (JSON Web Signature) "JWT" dediğimiz şeydir — imzalı ama şifresiz; payload okunabilir. JWE (JSON Web Encryption) payload'ı da şifreler. Claim'lerde gizli veri varsa JWE kullanın.
Servisimin hangi algoritmayı kullandığını nasıl anlarım?
Örnek bir token'ı decode edin; header'daki alg alanı algoritmadır. Yaygın üretim seçimleri: RS256 (asimetrik, en yaygın), ES256 (asimetrik, küçük imzalar), HS256 (simetrik, düşük riskli veya iç bağlamlarda).