Base64 Encode/Decode

Encode text to Base64 or decode Base64 to text. Supports file uploads, UTF-8, URL-safe variant, and hex output.

Use Base64 Encode/Decode

What is Base64 encoding?

Base64 is a binary-to-text encoding that represents 8-bit bytes using a 64-character alphabet: the uppercase and lowercase letters A–Z and a–z, the digits 0–9, and the symbols + and /. Every three bytes of input become four characters of output, with = added as padding when the input length isn't a multiple of three. The encoding is reversible and lossless, which makes it a safe way to shuttle arbitrary binary data through text-only channels such as JSON, XML, email headers, or HTTP forms.

Standard vs URL-safe Base64

Standard Base64 uses + and /, but both characters have special meaning in URLs and file paths. RFC 4648 defines a URL-safe variant that substitutes - for + and _ for /, and typically strips the trailing = padding. This variant is what JSON Web Tokens (JWT), OAuth 2.0 bearer tokens, and many REST APIs use. Toggle the “URL-safe” option above to produce that format when encoding. The decoder accepts either variant automatically and re-pads as needed.

Common uses

Base64 shows up in many places you probably touch every day:

  • Data URIs — embed small images or fonts directly in CSS or HTML using data:image/png;base64,… so no extra HTTP request is needed.
  • JWT tokens — header, payload, and signature are each URL-safe Base64-encoded and joined with dots.
  • HTTP Basic Auth — the Authorization header sends username:password as a Base64 string (note: this is encoding, not encryption — always use HTTPS).
  • Embedded binary in JSON/XML — file uploads, cryptographic keys, certificates (PEM), and attachments in MIME email all rely on Base64 so that binary bytes survive text transport.
  • Debugging & forensics — decoding a Base64 blob to hex is often the fastest way to inspect a file signature, a certificate, or an opaque token payload.

Everything runs locally in your browser — your input never leaves your machine.

Frequently Asked Questions

Find this useful?

These tools are free and ad-free. Support the project!

Buy me a coffee

Related Tools