Skip to main content
Base64 represents arbitrary bytes using 64 ASCII characters, so binary data can travel through channels that only accept text: JSON string fields, HTTP headers, email bodies, and data URIs. Encoding grows the payload by roughly 33%: every 3 bytes become 4 characters.

Standard versus URL-safe

Standard Base64 uses + and /, both of which have meaning inside a URL. The URL-safe variant substitutes - and _, and usually drops the = padding. JWTs use the URL-safe form.

Encoding in code

Base64 is an encoding, not encryption. Anyone can decode it instantly. Never use it to hide a secret.