Blog
Wild & Free Tools

How to Decode a JWT Token on Mac (Terminal + Browser)

Last updated: March 2026 4 min read
Quick Answer

Table of Contents

  1. Browser Method (Fastest)
  2. Terminal Method (Built-in Tools)
  3. Extract a Specific Claim
  4. Which Method to Use
  5. Frequently Asked Questions

On a Mac you have two solid options for decoding a JWT: paste it into the browser tool above (nothing to install, works immediately), or use Terminal with tools already built into macOS. Both take under 30 seconds.

Method 1: Browser Decoder — No Install Needed

The fastest way to decode a JWT on any Mac:

  1. Copy your JWT token (starts with eyJ)
  2. Paste it into the input field at the top of this page
  3. Header and payload appear instantly — no key required

This works on Safari, Chrome, Firefox, and Edge on macOS. Nothing is uploaded — all decoding runs locally in your browser tab. Useful for quick inspection during development or debugging an auth issue.

Method 2: macOS Terminal — One-Line Command

macOS ships with Python 3 and the base64 utility, so you can decode a JWT payload without installing anything:

# Decode the JWT payload using Python (built into macOS)
TOKEN="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTYiLCJuYW1lIjoiSm9obiBEb2UiLCJpYXQiOjE3MDAwMDAwMDB9.signature"

echo $TOKEN | cut -d'.' -f2 | python3 -c "
import sys, base64, json
payload = sys.stdin.read().strip()
padding = 4 - len(payload) % 4
decoded = base64.b64decode(payload + '=' * padding)
print(json.dumps(json.loads(decoded), indent=2))
"

This extracts the second segment (the payload), adds base64url padding, decodes it, and pretty-prints the JSON.

To decode the header instead, change -f2 to -f1.

Sell Custom Apparel — We Handle Printing & Free Shipping

Extract a Single Claim from the Terminal

If you only need one value — say the sub or exp — pipe through Python's json module:

echo $TOKEN | cut -d'.' -f2 | python3 -c "
import sys, base64, json
payload = sys.stdin.read().strip()
padding = 4 - len(payload) % 4
decoded = json.loads(base64.b64decode(payload + '=' * padding))
print(decoded.get('sub'))
"

If you have jq installed (via Homebrew: brew install jq), you can also do:

echo $TOKEN | cut -d'.' -f2 | python3 -m base64 -d 2>/dev/null | jq '.sub'

Note: the -m base64 approach may need padding adjustments on some tokens — the Python script above is more reliable for all token shapes.

Browser vs Terminal — Which Should You Use?

Use the browser tool when:

Use the terminal command when:

Both are 100% local — nothing leaves your machine.

Decode Your JWT on Mac Now

Paste your token above — works in Safari and Chrome on macOS. Instant decode, no install, no upload.

Open Free JWT Decoder

Frequently Asked Questions

Does macOS have a built-in JWT decoder?

Not a dedicated one. But macOS ships with Python 3 and the base64 utility, which is everything you need to decode a JWT in Terminal without installing anything extra.

Can I decode a JWT offline on Mac?

Yes. The browser tool works offline once the page is loaded (it is entirely client-side). The terminal command works completely offline too.

Is it safe to paste a JWT into a browser tool?

If the tool is client-side (no server uploads), yes. This tool decodes entirely in your browser — the token is never sent anywhere. Avoid tools that require server submissions for sensitive production tokens.

Ryan Callahan
Ryan Callahan Lead Software Engineer

Ryan architected the client-side processing engine that powers every tool on WildandFree — ensuring your files never leave your browser.

More articles by Ryan →
Launch Your Own Clothing Brand — No Inventory, No Risk