Guides

Offline JWT Decoding, Base64URL & Semantic JSON Diffing

Inspect JWT headers and claims, encode Base64URL without padding, run key-order-agnostic semantic JSON diffs, and scrub Bearer tokens offline.

4 min read

Quick Answer: Inspect JWT header and payload claims locally by decoding their Base64URL segments in browser RAM, compare API JSON payloads structurally with Semantic JSON Diff regardless of key order or indentation, and sanitize Bearer tokens from debug logs before sharing.

Why pasting production JWTs into online decoders is a security leak

Live JSON Web Tokens often carry user IDs, email claims, tenant roles, and unexpired session access. Pasting an active Bearer token into a third-party website risks exposing credentials in server access logs or browser telemetry.

Because JWT headers and payloads are unencrypted Base64URL-encoded UTF-8 JSON separated by dots (header.payload.signature), inspecting their claims requires zero network calls.

  • Base64URL swaps + and / for - and _ and omits trailing = padding per RFC 4648 Section 5.
  • Decoding claims in browser RAM reveals alg, typ, sub, exp, and custom scopes instantaneously.
  • Cryptographic signature verification still belongs on your auth backend or JWKS verifier with the signing key.

Auto-decoding JWTs and Base64URL payloads offline

When Base64 Text Converter runs in decode mode with autoDetectJwt enabled, pasting any three-part Base64URL JWT automatically extracts both the JSON header and payload alongside the signature string into formatted JSON.

Switch direction to encode with urlSafe enabled to emit unpadded Base64URL strings for OAuth states or URL query parameters, or decode standard +/ Base64 text using UTF-8 or ASCII character sets.

json
{
  "header": {
    "alg": "HS256",
    "typ": "JWT"
  },
  "payload": {
    "sub": "user_123",
    "name": "Maya Lin",
    "local": "true"
  },
  "signature": "dGVzdF9zaWduYXR1cmU"
}

Decode JWT claims & Base64URL in browser RAM

Comparing API responses with Semantic JSON Diff vs. line diff

When comparing staging vs. production API responses, standard line diffs flood the screen whenever two serializers emit object keys in a different order or minify whitespace. Enabling semanticJsonDiff in Diff Checker parses both JSON panes and compares structural values instead of raw lines.

If an input comes from JSONC with // comments or trailing commas, run it through JSON Formatter with repairTrailingCommas first—or convert config snapshots to TOML via JSON to TOML (noting TOML omits null keys since the spec has no null type).

Compare JSON semantically or diff text side-by-side

Diff ModeKey Order ChangesWhitespace / MinificationBest Use Case
Line Diff (Default)Flagged as removed + addedFlagged unless Ignore Whitespace onCode patches, .env files, plain text
Line Diff + Ignore WhitespaceFlagged as removed + addedIgnored across indented linesIndented YAML, SQL, Markdown
Semantic JSON DiffIgnored automaticallyIgnored automaticallyAPI responses, JWT claims, JSON configs

Scrubbing JWTs and connection strings before sharing debug logs

Once you have decoded a failing token or diffed two API payloads locally, avoid copying raw Authorization headers or database URLs into Slack tickets or AI chats.

Pass your trace through Sanitize Logs for AI to mask JWTs ([[JWT-01]]), IP addresses, API secrets, and Postgres/Redis connection strings deterministically before sharing.

Scrub JWTs, IPs & secrets from logs before sharing

References

Frequently asked questions

Does Base64 Text Converter verify JWT cryptographic signatures?

No. It decodes Base64URL header and payload JSON and displays the raw signature string locally without asking for or sending your signing secrets; always verify signatures server-side.

What is the difference between standard Base64 and Base64URL?

Base64URL replaces + with - and / with _ and typically omits trailing = padding so tokens stay safe inside URLs and HTTP headers.

Why does Semantic JSON Diff require valid JSON in both panes?

Semantic diff parses both inputs into JSON objects before comparing keys and values; if your snippet has comments or trailing commas, clean it in JSON Formatter first.

Related formats

Related Comparisons

Related Guides