DT
DevToolKit
Clearly labeled tools
Tools
Workspaces
Resources
Browse tools
DT
DevToolKit
Practical PDF, image, developer, and everyday tools

Clearly labeled processing for everyday tasks.

Core processing runs in the browser for most tools. Server-backed and external-provider workflows are labeled separately. Basic tools are available without signup; individual limits vary by tool.

46 unique tools4 workspacesNo signup for basic tools
Browse toolsTrust Center
Tools
All toolsPDF workspaceImage studioDeveloper workbenchGeneral tools
Product
BlogSupportContact
Company
AboutTrust CenterPrivacy PolicyTerms of Use

© 2026 DevToolKit. Practical PDF, image, developer, and everyday tools with clearly labeled processing.

In-browserServer-backedExternal preview
amanhirut32@gmail.com
HomeToolsDeveloperJWT Decoder

JWT Decoder

  • In-browser
  • No signup
  • Free limit: Text input

Decode JSON Web Tokens directly in your browser.

Core processing runs in your browser and does not upload this file for the task.

Preparing the editor...

The guide and instructions on this page are available while the tool loads.

Continue your workflow

  • JSON FormatterPretty-print JSON text. This decoder already shows header/payload JSON and does not verify signatures.
  • Base64 Encoder/DecoderEncode or decode generic Base64 text. It does not split JWT segments.
  • Timestamp ConverterConvert a raw Unix iat/exp number. This decoder already formats those claims with toLocaleString().

What this decoder shows

JWT Decoder inspects a compact three-segment string: it Base64URL-decodes the first two segments, JSON.parse’s them, pretty-prints the objects, and displays the third segment as-is. It does not verify signatures, does not take a secret or public key, and does not decide whether a token should be trusted.

The Encoded JWT field starts empty. Decode token is disabled while the trimmed textarea is empty. Load example fills a three-segment sample and decodes it immediately. Clear empties the textarea, the active token, and the Copied label.

JWT structure: header, payload, and signature

decodeJwt trims the string and splits on “.”. If parts.length is not 3, it throws “A JWT must contain exactly 3 parts separated by dots.” Typical five-part encrypted tokens therefore fail this check. There is no JWE or nested-JWT path.

Header
First segment: Base64URL → UTF-8 text → JSON.parse. Shown in the Header card as JSON.stringify(header, null, 2).
Payload
Second segment: same decode and parse. Shown as Payload / Claims with the same 2-space stringify.
Signature
Third segment: not passed through atob or JSON.parse. If the segment is empty, hasSignature is false and the UI says “No signature segment found.” Otherwise the raw segment is shown and the UI says it is present.
Type label
tokenType is header.typ, or the string “JWT” if typ is missing. That default is a label, not a detected token class.

What Base64URL decoding means here

base64UrlToBase64 replaces - with + and _ with /. If the length modulo 4 is 2 it appends “==”; if 3, “=”; if 0, it leaves the string; any other remainder throws “Invalid Base64URL string.” decodeBase64Unicode then calls atob and TextDecoder().decode. Only the header and payload segments use this path.

This is not the generic Base64 tool: there is no URL-safe checkbox, no encode mode, and the signature is not decoded. Padding restore applies only inside this Base64URL helper.

How the tool handles malformed tokens

  • Empty trimmed input: decodeJwt returns no error and no objects. The error banner is shown only when decoded.error is set and activeToken is non-empty.
  • Wrong segment count: “A JWT must contain exactly 3 parts separated by dots.”
  • Bad Base64URL padding (remainder 1): “Invalid Base64URL string.”
  • atob or JSON.parse failures: error.message, or “Invalid JWT.” if message is missing. Header and payload are cleared.
  • Whitespace: only the whole token is trimmed. Spaces or line breaks inside a segment are not stripped the way Base64Tool strips decode input.

There is no implemented character ceiling in JwtDecoder.jsx. Header and payload cards stay hidden until header and payload both parse without error.

Reading common claims

Token summary appears after a successful decode. It reads specific properties; it does not validate them.

Algorithm
header.alg, or “—” if missing. Not checked against the signature.
Type
tokenType as above (typ or “JWT”).
Subject / Issuer / Audience
payload.sub, iss, and aud via formatClaimValue: empty/null/undefined → “—”; objects → JSON.stringify; otherwise String(value).
Other claims
Visible in the payload JSON card (for example nbf or custom fields). The summary does not list them and does not enforce nbf.

Time-based claims and date conversion

formatDateFromUnix treats iat and exp as Unix seconds: it requires a finite number, then new Date(value * 1000) and date.toLocaleString(). Non-numeric values show “—”.

getTokenStatus uses only exp. Missing exp → “No expiry claim.” Non-finite exp → “Invalid token.” exp < Math.floor(Date.now() / 1000) → “Expired.” Otherwise → “Active.” iat is displayed but not used for status. nbf is not read. Active/Expired is a local clock comparison of a decoded number, not proof that a real issuer accepted the token.

What decoding does not verify

The sidebar Verification details text states: this decoder shows header and payload JSON; it does not verify signatures or prove that a token is trusted. There is no key field, HMAC, RSA/ECDSA check, or JWKS lookup in JwtDecoder.jsx.

  • Authenticity and integrity: a forged header/payload can still decode.
  • Issuer and audience: iss and aud are displayed; they are not compared to an expected value.
  • Expiration as a security decision: Expired/Active does not mean the token is valid or invalid at an API.
  • Authorization or session trust: claims are text after JSON.parse, not permissions.
  • Revocation, key rotation, or algorithm confusion defenses: not implemented.
  • Server-side verification: this page is not a substitute for verifying the token with the issuer’s key in your backend.

The signature panel copy says verification is optional and requires a key. That key step is not implemented here; showing the third segment is not verification.

Handling sensitive tokens responsibly

The amber sidebar says: do not paste production secrets, private keys or sensitive tokens unless you understand the risk. A JWT often carries session or identity data. Decoding reveals whatever the header and payload contain to this browser tab.

Avoid pasting production credentials, customer tokens, or private keys into a shared, logged, or untrusted environment. Clear the fields when you finish. Copy writes JSON to the clipboard when the API allows it; that clipboard is outside this component.

Privacy and local-processing boundaries

JwtDecoder.jsx decodes in the browser. It does not call trackToolEvent and does not POST the token to a verification or decode API. That is not a confidentiality guarantee: the rest of the page can still load site assets and advertising; the privacy policy describes first-party analytics for event metadata (not designed to store tool contents); clipboard use, extensions, and shared devices remain outside this component.

Local atob and JSON.parse do not encrypt the token or isolate it from the browser environment. Decoding is not safe handling of secrets.

When to use Base64 or JSON Formatter instead

  • JSON Formatter — to pretty-print JSON text that is not wrapped as a three-segment JWT, or to re-format copied header/payload JSON with indent 2/4/8. This decoder already stringifies with indent 2 and does not parse arbitrary JSON documents.
  • Base64 Encoder/Decoder — for generic text Base64/URL-safe encode or decode. It does not split JWT segments or JSON.parse header/payload.
  • Timestamp Converter — if you copy a raw numeric iat, exp, or other Unix value from the payload JSON and need seconds/milliseconds conversion. This decoder already formats iat and exp with toLocaleString() from Unix seconds; it does not open the converter automatically.

Output-review checklist

  • Treat header and payload as readable JSON only, never as a verified token.
  • If Status is Active, remember it only means numeric exp >= now in this browser.
  • If Status is Expired or No expiry claim, that still does not prove the signature or issuer.
  • Confirm you needed three segments; two- or five-part strings fail the split check.
  • Do not paste production or customer tokens on a shared device; use Clear when done.
  • If Copy does not change to Copied, the clipboard API may have been denied; there is no download fallback.

Frequently asked questions

Does Decode token verify the JWT?

No. JwtDecoder.jsx never checks a signature, HMAC, or public key. The Verification details panel states that the decoder does not verify signatures or prove that a token is trusted.

When does decoding run?

When you select Decode token (which stores token.trim() as activeToken) or Load example. Changing the textarea alone does not update header, payload, or status.

What does Status Active or Expired mean?

getTokenStatus looks only at payload.exp as a finite number, then compares it with Math.floor(Date.now() / 1000). Active means exp >= now; Expired means exp < now. Missing exp is “No expiry claim.” This is not authenticity, authorization, or nbf handling.

Is the signature decoded?

No. A non-empty third segment is shown in a <pre> as the original encoded text. An empty third segment shows “No signature segment found.” Neither path verifies the segment.

Related guides

Longer reads that pair well with this tool.

Developer guide

Useful Developer Tools Every Browser Should Have

Fourteen In-browser developer utilities for JSON, encoding, tokens, diffs, hashes, regex, SQL, UUIDs, and timestamps — fast checks without installing anything.

Developer guide

How to Format JSON Online

Use automatic JSON.parse and JSON.stringify formatting, inspect strict-JSON parser errors, and review indented text up to 1,000,000 characters.

Developer guide

How to Redact and Review Sensitive JSON

Reduce exposure while reviewing sensitive JSON by using synthetic data, redacting credentials and identifiers, and checking browser, screen, and clipboard risks.

Related tools

Common next steps after using this tool.

JSON Formatter

Automatically format and validate JSON in your browser.

Base64 Encoder/Decoder

Encode and decode Base64 text directly in your browser.

Timestamp Converter

Convert Unix timestamps, milliseconds and readable dates in your browser.

Explore more in Developer

Browse related tools or open the full workspace.

Developer workspaceAll tools