How to Decode a JWT Token on Mac (Terminal + Browser)
- Two methods: free browser tool (zero install) or macOS Terminal
- One-line terminal command using only tools built into macOS
- How to extract just the payload or a specific claim from the command line
- When to use each method
Table of Contents
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:
- Copy your JWT token (starts with
eyJ) - Paste it into the input field at the top of this page
- 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.
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:
- You want to inspect a token quickly during development
- You need to share a decoded view with a teammate
- You prefer a visual layout of header, payload, and claims
Use the terminal command when:
- You are already in a terminal session and do not want to switch contexts
- You want to automate token inspection in a shell script
- You are decoding tokens from a server response in a CI pipeline
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 DecoderFrequently 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.

