Security & Encoding

Base64 Encoder / Decoder

Turn text or a file into Base64, or decode Base64 back into text and files. Pick a direction, choose standard or URL-safe output, then copy or download the result. Everything is computed locally — your data never leaves the page.

Runs in your browser v1.0.0

Direction & options

live
Direction
Source
Output alphabet
Line breaks

Input

0 chars

Result

0 chars

How it works

Encode converts UTF-8 text (or any file’s raw bytes) into Base64. Decode turns Base64 back into bytes and, when those bytes are valid UTF-8, into readable text. Decoding accepts the standard +/ alphabet, the URL-safe -_ alphabet, missing padding, embedded whitespace and a leading data:…;base64, prefix, so pasted values from many sources just work. Invalid Base64 is reported as a friendly message instead of silently producing bad bytes. Everything runs in the browser — nothing is uploaded — and the direction, options and text can be shared through the URL fragment.

Practical uses

Encode text or bytes to Base64 and decode Base64 back to text, with a URL-safe alphabet.

Common ways to use it

  • Inspect or produce a Basic authentication header value.
  • Decode the payload of a data URL while debugging an embedded asset.
  • Encode a file's raw bytes for embedding or transfer.

Encode then decode

Input

Hello (UTF-8 text)

Output

encodeText("Hello")        = SGVsbG8=
decodeText("SGVsbG8=")     = Hello
URL-safe bytes FB EF FF     = --__

Verified with the tool's own functions. Encoding the UTF-8 text Café gives Y2Fmw6k=. The standard alphabet encodes the bytes FB EF FF as ++// while the URL-safe alphabet gives --__.

Options that matter

  • Direction — encode or decode.
  • Source — Text or File; a decoded file can be downloaded as raw bytes.
  • Output alphabet — standard +/ or URL-safe -_.
  • Line breaks — wrap encoded output at 76 characters in MIME/PEM style.
  • data: URL prefix — when encoding a file, prefix the output with its MIME type.

Things to keep in mind

  • Base64 is an encoding, not encryption — it does not keep data secret.
  • The URL-safe alphabet and line wrapping are separate options from the default encoding.
  • Text decoding expects the bytes to be valid UTF-8; non-text bytes are reported and can only be saved through the File source.