تخطي إلى المحتوى الرئيسي
FreeOnlineTools Go
العربية
how-to

كيفية فك تشفير رموز JWT وفحص مطالباتها بأمان

By FreeOnlineTools Team · Updated 2026-09-02

Quick Answer

JWT = ترويسة.حمولة.توقيع. فك تشفير الأجزاء الأولى والثانية (Base64Url) لرؤية JSON. لكن فك التشفير لا يتحقق من التوقيع — تحتاج المفتاح السري للتأكد من صحة الرمز. استخدم فاك تشفير JWT المجاني.

Introduction

JWT (JSON Web Token) يتكون من ثلاثة أجزاء مفصولة بنقاط: ترويسة (خوارزمية التوقيع)، حمولة (المطالبات)، وتوقيع. الأجزاء الأولى والثانية مشفرة Base64Url ويمكن فك تشفيرها لرؤية المحتوى. التوقيع يضمن عدم التلاعب لكن فك التشفير وحده لا يتحقق منه.

Step by Step

  1. Open the JWT Decoder tool

    Go to the JWT Decoder tool page. The tool accepts any JWT string (three Base64URL-encoded parts separated by dots).

  2. Paste your JWT token

    Paste the JWT into the input field. A typical JWT looks like: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1c2VyMSJ9.signature. The tool auto-detects the three parts.

  3. Review the decoded header

    The tool Base64URL-decodes the first part and displays it as JSON. The header typically contains 'alg' (algorithm, e.g., HS256) and 'typ' (type, usually 'JWT').

  4. Review the decoded payload (claims)

    The tool decodes the second part and displays the claims as formatted JSON. Common claims include 'sub' (subject/user ID), 'iat' (issued at), 'exp' (expiration), and 'role' (user role).

  5. Check the signature (third part)

    The tool shows the signature part. Note: decoding does NOT verify the signature. To verify, you need the signing key and a verification library. Never trust a JWT's claims without verifying the signature server-side.

Examples

Decode a simple JWT

Input: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyMSIsIm5hbWUiOiJBbGljZSIsImlhdCI6MTY5MzUyNjQwMH0.signature

Output: Header: {"alg":"HS256","typ":"JWT"} Payload: {"sub":"user1","name":"Alice","iat":1693526400}

JWT with expiration claim

Input: eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTY5MzYxMjgwMH0.sig

Output: Header: {"alg":"HS256"} Payload: {"sub":"admin","exp":1693612800}

Common Problems

  • Confusing decode with verify —decoding a JWT only reads its contents; it does NOT prove the token is authentic. Always verify the signature server-side with the signing key.
  • Trusting expired tokens —check the 'exp' claim and reject expired tokens. The 'exp' value is a Unix timestamp in seconds.
  • Base64 vs Base64URL —JWT uses Base64URL encoding (no padding, - and _ instead of + and /). A standard Base64 decoder will fail on JWT parts.
  • Sensitive data in payload —JWT payloads are readable by anyone who has the token. Do not store passwords, credit card numbers, or other secrets in the payload.

Tips

  • Always verify the JWT signature server-side before trusting any claims —decoding alone is not authentication.
  • Check the 'exp' (expiration) and 'nbf' (not before) claims to ensure the token is valid for the current time.
  • Use short-lived tokens (15-60 minutes) with refresh tokens for long sessions —minimizes damage if a token is leaked.
  • Use our JWT Decoder for safe, local debugging —your token never leaves your browser.

Related Tools

Related Guides

References