Base64 Encode & Decode

Encode text or files to Base64 and decode it back, with URL-safe mode and data URIs, without leaving your browser.
Client-side · verifiable
How this tool works

Base64 represents binary data using 64 printable characters: A–Z, a–z, 0–9, + and /. Every 3 bytes become 4 characters, so encoded data is a third larger. It exists because email, JSON, HTML attributes and many APIs only carry text; Base64 lets images, keys and signatures pass through them intact.

What this page handles:

  • Text is encoded as UTF-8 first, so accented characters and emoji round-trip correctly (plain btoa() would throw).
  • URL-safe mode swaps + and / for – and _ and drops the = padding, the variant used in JWTs, OAuth and web push.
  • File → Base64 reads a file locally and produces a data URI you can embed in HTML or CSS.
  • Decode accepts either alphabet, with or without padding and whitespace.

Base64 is an encoding, not encryption. Anyone can decode it, and it should never be used to hide secrets.

Security note

What leaves your browser

Encoding and decoding run in your browser with no network activity. Files are read with the File API and never uploaded.

FAQ
Is Base64 encryption?

No. It is a reversible encoding with no key. Decoding takes a millisecond. Treat Base64 "secrets" as plain text.

Why does my decoded text look like garbage?

The data was probably binary, not text, or was encoded from a different character set. Try the hex converter to inspect the bytes.

What is the difference between Base64 and Base64url?

Two characters: + and / become - and _ so the string is safe in URLs and filenames, and padding = is usually dropped.

How much larger is Base64 output?

About 33% larger than the input, plus up to two padding characters.