# Base64

Canonical URL: https://offlineutils.com/glossary/base64
Also known as: Base-64, Base 64 encoding
Published: 2026-06-24
Publisher: offlineutils.com

> Base64 is a way of encoding arbitrary binary data as a string of 64 ASCII characters (A–Z, a–z, 0–9, '+', '/') so it can travel through systems that only handle plain text — like email, URLs, JSON, or HTML data URIs.

Base64 takes three bytes of input at a time (24 bits) and emits four output characters (6 bits each). The output is exactly 4/3 the size of the input, padded with '=' characters when the input length is not a multiple of three. Because every output character is a printable ASCII letter, digit, or punctuation mark, the encoded string survives transport through text-only channels without escaping or corruption. Base64URL is a URL-safe variant that swaps '+' and '/' for '-' and '_' — the encoding JWTs use for their three segments.

Base64 is not encryption. Anyone who sees a Base64 string can decode it back to the original bytes in milliseconds — there is no key, no secret. Treat it strictly as a transport encoding.

## Frequently asked questions

### Is Base64 encryption?

No. Base64 is a reversible encoding with no key — anyone who sees the encoded string can decode it back instantly. Never use Base64 to 'hide' passwords or secrets; it provides no security at all.

### Why is the output longer than the input?

Base64 encodes three bytes (24 bits) of input as four ASCII characters (6 bits each), so the output is exactly 4/3 the size of the input plus '=' padding when the input length is not a multiple of three.

### What's the difference between Base64 and Base64URL?

Standard Base64 uses '+' and '/' as the last two characters of its alphabet, which have special meaning in URLs. Base64URL replaces them with '-' and '_' so the encoded string is safe to drop into a URL or filename without escaping. JWTs use Base64URL.

## Related tools

- https://offlineutils.com/base64
- https://offlineutils.com/base32
- https://offlineutils.com/base58
- https://offlineutils.com/base85
- https://offlineutils.com/jwt-decoder

## References

- https://en.wikipedia.org/wiki/Base64
- https://datatracker.ietf.org/doc/html/rfc4648
