JWTデコーダー
ヘッダーとペイロードを確認するJWTデコーダー。クライアントサイド。
JWTの仕組み
一般的なデバッグ用途
JWTセキュリティのヒント
JSON Webトークンはドットで区切られた3つのBase64urlエンコードされたセクションで構成されています。ヘッダーは署名アルゴリズム(例:HS256・RS256)を指定します。ペイロードはクレームを含みます。ユーザーID・ロール・有効期限などのキーと値のペアです。署名はシークレットまたは秘密鍵でヘッダーとペイロードを署名することで作成されます。
誰でもキーなしでヘッダーとペイロードをデコードできます。単なるBase64urlエンコーディングであり、暗号化ではありません。署名のみがキーを必要とします。これはトークン全体が暗号化(JWE)されない限り、機密データをペイロードに含めるべきではないことを意味します。
- トークンの有効期限を確認する(expクレーム)
- トークンが属するユーザーまたはセッションを確認する(subクレーム)
- APIが読み取っているロールまたは権限クレームを検査する
- 開発中の認証問題をデバッグする
- 実装前にトークン構造を検証する
- ペイロードに機密データを保存しない — 暗号化されておらず、エンコードされているだけです。
- 短い有効期限を設定する — アクセストークンは15分〜1時間、リフレッシュトークンはより長く。
- マルチサービスアーキテクチャではHS256よりRS256を使用する — 各サービスはシークレットを共有せずに検証できます。
- サーバーサイドで署名を検証する — クライアントが変更したトークンを絶対に信頼しない。
よくある質問
- What is a JWT?
- JWT (JSON Web Token) is an open standard (RFC 7519) for securely transmitting information as a JSON object. It consists of three parts separated by dots: a Header (algorithm), a Payload (claims), and a Signature. JWTs are commonly used for authentication and API authorization.
- Is it safe to paste my JWT here?
- Yes. This tool runs entirely in your browser — no data is sent to any server. That said, treat JWTs like passwords: avoid pasting production tokens from sensitive systems into public tools as a general best practice. Use test tokens for debugging.
- Can this verify the JWT signature?
- No. Signature verification requires the secret key (for HMAC) or the public key (for RSA/ECDSA). Since this is a client-side tool, the secret is never available here. Decoding the payload is always possible without the key — which is why sensitive data should never be stored unencrypted in a JWT payload.
- What are common JWT claims?
- Standard claims include: sub (subject/user ID), iss (issuer), aud (audience), exp (expiry timestamp), iat (issued at), nbf (not before). Custom claims are anything else your application adds, like roles, permissions, or user metadata.
- Why is my JWT showing as expired?
- The exp claim is a Unix timestamp. If the current time is past that timestamp, the token is expired. Your server should also reject it. You need to refresh or re-authenticate to get a new token.
関連ツール
- JSON Formatter, Validator & Repair Tool
Format, minify, validate, and repair JSON instantly in your browser. Sort keys alphabetically, auto-format on paste, download as file, escape/unescape strings — free, no sign-up, 100% client-side.
- QRコード生成
URL、テキスト、Wi-FiなどのQRコードを生成。PNGでダウンロード可能。
- パスワード生成
カスタム長と文字セットで強力なランダムパスワードを生成。
- Base64 エンコーダー / デコーダー
テキストをBase64にエンコード、または逆にデコード。
- URLエンコーダー / デコーダー
パーセントエンコーディングでURLとクエリ文字列をエンコードまたはデコード。