Contact, if you are interested in this website / domain name / Sponsorship / Advertisement / Partnership

Base64 Encode / Decode

Encode text or files to Base64 and decode back — UTF-8 and URL-safe.

Runs in your browserNo sign-upFree forever

Loading tool…

Report an issue

How to use the Base64 Encode / Decode

  1. Type or paste text into the input.
  2. Click Encode (tick URL-safe if needed) or Decode.
  3. To embed a file, choose it under “encode a file” to get a data URI.
  4. Copy the output.

About this tool

Base64 turns arbitrary bytes into a 64-character alphabet (A–Z, a–z, 0–9, + and /) so binary data can travel through systems that only handle text: email bodies, JSON payloads, HTML attributes and HTTP headers. Every 3 bytes of input become 4 characters of output, so encoded data is roughly 33% larger.

A common bug is encoding non-English text with the browser's raw btoa(), which throws on characters like “é” or “日本”. This tool converts text to UTF-8 bytes first, so emoji and accented characters round-trip correctly.

Standard vs. URL-safe Base64

The + and / characters have special meanings in URLs, so RFC 4648 defines a URL-safe variant that uses - and _ and usually drops the = padding. JWTs use this variant. Tick URL-safe when encoding for query strings or tokens; the decoder accepts both forms automatically.

Base64 is an encoding, not encryption. Anyone can decode it — never use it to hide passwords or secrets.

Frequently asked questions

Why is my decoded text garbled?

The original bytes may not have been UTF-8 text — for example an image or a compressed file. Decode it as a file instead.

What is the '=' at the end?

Padding that makes the length a multiple of 4. It can be safely removed in URL-safe contexts.

Is Base64 secure?

No. It offers zero confidentiality. Use proper encryption for secrets.

Get a free tech stack audit