什麼是 JWT 解碼器?

免費線上 JWT 解碼器。貼上任意 JWT 即時檢視解碼後的標頭與負載。檢查過期狀態、簽發人與宣告。

JSON Web Token(JWT)是緊湊且適合用於 URL 的權杖格式,廣泛應用於現代驗證系統、API 授權與單一登入實作中。JWT 解碼器讓您貼上任何 JWT,即可立即檢視其解碼後的標頭與承載,方便您除錯驗證流程並了解權杖內容。

當您貼上 JWT 時,工具會立即將其拆分為三個組成部分——標頭、承載與簽章——並將以 base64url 編碼的標頭與承載解碼為格式化的 JSON。標頭顯示簽章演算法(例如 HS256 或 RS256)與權杖類型。承載則揭露所有宣告,包括 iss(發行者)、sub(主體)、aud(對象)、exp(到期時間)、nbf(生效時間)、iat(簽發時間)等標準宣告,以及發行者加入的任何自訂宣告。

到期狀態會以清楚的指示器標示:有效(權杖尚未到期)、已到期(已超過到期時間),或尚未生效(在 nbf 時間之前)。這在開發過程中特別實用,讓您能快速確認測試權杖是否已到期,或時間相關的宣告是否設定正確。

一個關鍵的區別:此工具僅解碼,不會驗證簽章。解碼 JWT 非常容易——標頭與承載只是任何人皆可讀取的 base64url 編碼 JSON。簽章才是確保權杖未被竄改的關鍵。若未經驗證,您絕不應信任來自不受信任來源的解碼宣告。如需驗證簽章,您需要簽章金鑰與適當的伺服器端邏輯。

JWT 解碼器的實際應用案例

除錯驗證權杖

您的 API 回傳 401 錯誤,您懷疑 JWT 已到期。將權杖貼進解碼器並檢視 exp 宣告。若時間戳已過,工具會顯示「已到期」,確認問題所在。接著檢查 iat 宣告,看看權杖是何時簽發的,並除錯您的權杖更新邏輯。

檢查 OAuth ID 權杖

OAuth 提供者在登入時回傳 id_token。將它貼進解碼器,即可檢查 iss(發行者 URL)、sub(使用者識別碼)、aud(用戶端 ID),以及 email 或 name 等任何自訂宣告。這有助於確認權杖確實來自預期的發行者,且包含預期的對象。

檢查開發權杖中的宣告

在本地端開發時,您會為功能測試產生帶有自訂宣告的測試 JWT。貼上權杖以確認所有宣告都正確設定——在測試授權中介軟體之前,檢查 sub、roles 與 permissions 宣告是否具有預期的值。

為什麼要使用 JWT 解碼器?

  • Instant base64url decoding of header and payload
  • Syntax-highlighted JSON output
  • Expiration status: valid, expired, or not yet valid
  • Displays iat, exp, nbf, iss, sub claims

如何使用 JWT 解碼器 — 逐步教學

1

Paste your JWT token into the input field.

2

The header and payload are decoded instantly.

3

Review claims, expiration status, and issuer.

4

Copy any decoded section as needed.

JWT 解碼器適合誰?

  • API 除錯
  • 驗證問題排除
  • Token 檢查
  • OAuth 開發

JWT 解碼器專業技巧

  • 1JWT 的標頭與承載是 base64url 編碼,而非加密。任何取得權杖的人都能讀取內容。切勿在 JWT 宣告中放入敏感資訊(密碼、機密、個人識別資料)。
  • 2務必檢查「typ」(類型)標頭。JWT 的 typ 應為「JWT」。這有助於您區分 JWT 與其他 JOSE 物件(如 JWE 或 JWS)。
  • 3「exp」宣告是最常被檢查的驗證項目。請確保您的伺服器至少檢查 exp、nbf 與 iss。跳過這些檢查是 JWT 實作中常見的安全漏洞。
  • 4使用 https://jwt.io 或此解碼器進行本地端除錯,但在伺服器端請透過您的驗證函式庫實作正確的簽章驗證。切勿在未驗證簽章的情況下信任解碼後的宣告。

JWT 解碼器 — 常見問題

Does this tool verify JWT signatures?

No. This tool only decodes the header and payload. It does not verify the cryptographic signature. Never trust decoded JWT claims without proper server-side signature verification.

What claims does the decoder show?

It highlights standard claims: iss (issuer), sub (subject), aud (audience), exp (expiration), nbf (not before), and iat (issued at), along with any custom claims in the payload.

Can I use these tools with sensitive/proprietary data?

Absolutely. All processing runs locally in your browser with zero server uploads. This makes these tools safe for proprietary code, internal API keys, and confidential data.

Do these tools work offline?

Yes, once the page has loaded, most developer tools continue functioning without an internet connection. This makes them ideal for air-gapped environments or travel.

What browsers are supported?

All modern browsers are supported: Chrome, Firefox, Safari, and Edge. Internet Explorer is not supported. The tools leverage modern JavaScript APIs like Web Crypto, TextEncoder, and BigInt.

準備好使用 JWT 解碼器 了嗎?

免費線上工具 — 在瀏覽器中運作,無需註冊。立即開始使用。

立即試用
Free Forever · No Sign-up

182 Free Tools at Your Fingertips

All free online tools for developers, designers, students, and creators. Every tool works in your browser — no sign-up, no data collection.