3 Base64 Tricks Every Developer Should Know

javascript dev.to

1. Decode JWT Payloads Without a Library JSON Web Tokens are everywhere in modern APIs, and their payload is just Base64URL-encoded JSON. When debugging auth issues, you don't need to fire up jwt.io — just grab the middle segment (between the two dots), swap - and _ for + and /, and decode it. eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.abc123 That middle part (eyJzdWIiOiIxMjM0NTY3ODkwIn0) decodes to {"sub":"1234567890"} — your user ID, expiry, and scopes, all in plain t

Read Full Tutorial open_in_new
arrow_back Back to Tutorials