Encoders & Utilities

Base64 Encoder

Encode and decode text or binary data to Base64.

About this tool

Base64 turns arbitrary binary data into a 64-character alphabet (A–Z, a–z, 0–9, +, /) that survives any text-only transport — email bodies, JSON strings, URL parameters, data: URIs. Our tool encodes and decodes both text and binary in your browser, with auto-detection between the two directions: paste cleartext, get Base64; paste Base64, get cleartext (or a downloadable file if the result is binary).

The tool supports both standard Base64 (RFC 4648 §4) and URL-safe Base64 (RFC 4648 §5, where +/ become -_) — the variant you want depends on context. JSON Web Tokens, query-string parameters, and SHA-based hashes typically use URL-safe; email MIME, X.509 certificates, and most "what is in the clipboard" cases use standard. Optional padding (=) can be stripped for compact tokens.

When to use this tool

  • Decoding a JWT. Strip the dot-separated segments, drop each through the decoder, and read the JSON. (The JWT Decoder tool does this for you in one click.)
  • Inspecting an inline data: URI. Paste the part after data:image/png;base64, and download the original PNG.
  • Embedding a small binary in JSON or a config file. Logos, certificates, signing keys all travel as Base64 in YAML/JSON.
  • Debugging email attachments. A MIME part starting with Content-Transfer-Encoding: base64 is just a Base64-wrapped binary — decode it here to inspect.

What Base64 is not

Base64 is not encryption. The encoding is fully reversible by anyone — there is no key, no obscurity. If you see "we Base64 the password for security", that is a security bug, not a feature. The 4-to-3 expansion (every 3 bytes become 4 characters) also makes Base64 ~33% larger than the original — fine for small payloads, wasteful for multi-megabyte files. Use it for transport compatibility, not for size or secrecy.

Frequently asked questions

Why is the encoded string 33% longer than the original?

By design. Base64 uses 6 bits of information per output character; bytes are 8 bits. So 3 bytes (24 bits) of input produce 4 characters (24 bits) of output — a 4:3 ratio = +33%. The padding "=" characters at the end round the output up to a multiple of 4 characters. This expansion is the price of being able to ride through text-only channels.

What is the difference between standard and URL-safe Base64?

Two of the 64 characters differ. Standard Base64 uses + and /; URL-safe Base64 uses - and _ (because + and / have special meaning in URLs). Padding also differs — URL-safe variants often drop the trailing =. JWTs and OAuth use URL-safe; most other contexts use standard. Our tool auto-detects and offers both.

Is Base64 encryption?

No — it is encoding, not encryption. Anyone can decode any Base64 string back to its original bytes in milliseconds with no key. Base64's only job is to represent binary data in a text-safe alphabet so it can travel through systems that mangle non-printable characters. For confidentiality, use real encryption (AES-GCM, age, libsodium) and then Base64 the ciphertext if you need a text representation.

Can I encode files?

Yes — drag and drop or pick a file, and we encode it client-side. For very large files (over ~100 MB) the encoded result is held in browser memory and may stutter; for big binaries the command-line base64 utility is faster. The reverse also works: paste a Base64 string and download it as the binary it represents — useful for restoring inline-encoded files from emails or APIs.