Decode JWTs and test regex offline without pasting secrets into online tools
When debugging an auth failure or parsing a production log line, the fastest habit is to paste a JWT, Base64 string, or API payload into the first online formatter in search results. If that payload contains a live sess
When debugging an auth failure or parsing a production log line, the fastest habit is to paste a JWT, Base64 string, or API payload into the first online formatter in search results.
If that payload contains a live session token, internal user ID, email address, or customer data, pasting it into an unknown website means trusting that site's server logs, analytics scripts, and third-party embeds not to record it.
Here are fast ways to do the same work locally, plus a single-file browser toolbox you can run offline with zero network calls.
1. Decode a JWT locally in one terminal command
A JWT is three Base64URL-encoded segments (header.payload.signature). You do not need a website just to read the claims.
Using Python (works on Linux, macOS, and Windows with no extra packages):
python3 -c '
import sys, json, base64
token = sys.argv[1].strip().split(".")
for part in token[:2]:
padded = part + "=" * (-len(part) % 4)
print(json.dumps(json.loads(base64.urlsafe_b64decode(padded)), indent=2))
' "YOUR.JWT.TOKEN"
Important: Decoding only reads the header and payload. It does not verify the cryptographic signature. Never trust claims from an unverified token in application logic.
2. Test regex on sensitive logs locally
Instead of pasting customer logs or auth errors into a web regex tester, run a quick local Python snippet that prints every match, index, and capture group:
python3 -c '
import re
pattern = r"(\d+)-(\w+)"
text = "order 1042-paid failed for user_99"
for i, m in enumerate(re.finditer(pattern, text), 1):
print(f"{i}. {m.group(0)!r} at {m.start()} groups={m.groups()}")
'
3. Use a single-file offline browser toolbox (strict CSP, zero requests)
If you prefer a UI for quick daily formatting and inspection without opening a terminal:
- Free browser toolbox (JSON, Base64, URL): https://luxury-malabi-8a7447.netlify.app/toolbox.html — includes JSON format/minify/sort-keys, Unicode-safe Base64 encode/decode, and URL encode/decode.
-
MIT source on GitLab: https://gitlab.com/yogeshwaran-tech-tools/offline-dev-toolbox — enforces a strict Content-Security-Policy (
default-src 'none'; base-uri 'none'; form-action 'none'), so the page cannot make outbound network requests. -
Full 8-tool single-file offline HTML download (₹99): https://yogeshwarantechtools.myinstamojo.com/product/offline-dev-toolbox-json-jwt-base64-hash-reg — saves one standalone HTML file you can open directly from disk (
file://) with JWT decoder (decode only +expcheck), regex tester (matches, offsets, capture groups), SHA-1/256/512 via Web Crypto, password generator/checker, and Unix timestamp converter, alongside JSON, Base64, and URL tools.
Quick rule of thumb before pasting anywhere
- Real tokens, cookies, API keys,
.envvalues, and production logs: local terminal or localfile://HTML only. - Dummy sample payloads (
{"test": 1}): online formatters are fine.
Written by Yogeshwaran Tech Tools. Corrections welcome.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.