RevealTheme logo

Base64 Encoder & Decoder

Encode strings to Base64 or decode Base64 back to text. Privacy-friendly — runs in your browser.

What is Base64 and why is it everywhere?

Base64 is an encoding scheme — not encryption — that represents arbitrary binary data using only 64 printable ASCII characters (A-Z, a-z, 0-9, plus +, /, and = as padding). It exists because many transport protocols, file formats, and APIs are text-only or treat certain bytes specially: email (SMTP was designed for 7-bit ASCII), JSON (cannot contain raw bytes), URLs (have reserved characters), HTTP headers (line-oriented text), and HTML attributes all need a way to carry binary data through text channels. Base64 solves this by grouping the input bytes in sets of 3 (24 bits) and re-encoding each set as 4 Base64 characters (6 bits each). The size penalty is exactly 33% — every 3 bytes becomes 4 characters. This tool encodes UTF-8 text or Base64 strings in either direction, entirely in your browser. It correctly handles multi-byte UTF-8 characters (emoji, non-Latin scripts), which naive Base64 implementations using atob/btoa directly will mangle.

Common use cases

  • Embed small images directly in CSS as data: URLs (eliminates one HTTP request for tiny icons).

  • Decode the payload of a JWT or Basic Auth header to inspect what's inside.

  • Encode binary file contents to put in a JSON field or environment variable.

  • Move binary data through systems that don't preserve arbitrary bytes (email, copy/paste).

  • Decode base64-encoded API responses or webhook payloads during debugging.

  • Convert binary credentials to a copy-paste-friendly format for ops handoff.

Frequently asked questions

Is Base64 encryption?
No. Base64 is reversible encoding — anyone can decode it instantly with no key. For secrecy, use real encryption (AES-256, RSA, or our AES Encryption tool). Treating Base64 as security is the #1 misconception about it.
Why does Base64 add ~33% size?
The encoding maps 3 bytes (24 bits) of input to 4 characters (24 bits, since each Base64 character represents 6 bits). The size overhead is inherent and unavoidable. For smaller binary representations, use Base85 or just send raw binary if the channel supports it.
What is URL-safe Base64?
A variant defined in RFC 4648 that replaces + with - and / with _, so output is safe to include in URL paths or filenames without percent-encoding. JWTs use URL-safe Base64. Many APIs accept either flavor.
Why do I see '=' at the end?
Those are padding characters. Base64 emits output in 4-character groups; if the input isn't a multiple of 3 bytes, the last group is padded with '=' to reach 4 chars. Some Base64 variants omit the padding — both decode the same way.
Does this handle emoji and non-Latin text?
Yes. The tool converts text to UTF-8 bytes first, then Base64-encodes the bytes. This avoids the classic JavaScript bug where btoa() throws on non-Latin1 characters.
Where do I see Base64 in real apps?
Everywhere: image data: URLs in CSS, Authorization: Basic headers, JWT segments, signed URL signatures, S3 presigned URLs, PKCS certificates (PEM format), email attachments (MIME), QR code payloads, and the .env-style secrets in modern deployment platforms.

Related tools