Base64 Encode / Decode
Encode text to Base64, or decode Base64 back to text — switch mode with the toggle above the input.
How it works
Base64 encodes arbitrary bytes as ASCII text using 64 printable characters, at the cost of about 33% more
size than the original. Text is first converted to UTF-8 bytes, so multi-byte characters (accents, CJK,
emoji) round-trip correctly rather than getting mangled — a common bug in naive btoa()-only
implementations.
Common uses
- Embedding small binary data (images, fonts) inline in HTML/CSS as a data URI.
- Encoding credentials for HTTP Basic Auth headers.
- Passing binary payloads through systems that only handle text (e.g. JSON fields, JWTs).