Base64 Encode & Decode

Turn text into Base64 or decode Base64 back into readable text. Unicode and the URL-safe variant are handled correctly.

✓ Runs locally in your browser — nothing is uploaded

In short: Base64 encodes binary data or text as 64 printable ASCII characters (A–Z, a–z, 0–9, + and /) so it can travel safely in URLs, JSON, email and data URLs; decoding reverses it.

About Base64 Encode & Decode

Base64 represents binary data using 64 safe characters (A–Z, a–z, 0–9, + and /), so it can travel through systems that only expect text: email bodies, JSON fields, data URLs, HTTP headers and environment variables. It is an encoding, not encryption — anyone can decode it.

A common pitfall is that the browser’s built-in btoa() only handles Latin-1 characters and throws on anything else. This tool converts text to UTF-8 bytes first, so accented letters, Chinese, Arabic and emoji round-trip correctly. It also understands the URL-safe alphabet used by JWTs and many APIs, and tolerates missing padding and line breaks when decoding.

How to use Base64 Encode & Decode

  1. Paste the text you want to encode, or the Base64 string you want to decode.
  2. Tick URL-safe if you need - and _ instead of + and / (common in URLs and tokens).
  3. Press Encode or Decode.
  4. Copy the output, or press Use output as input to chain another step.

Examples

Encoding a short string

Hello, world! encodes to SGVsbG8sIHdvcmxkIQ==. The two = signs are padding that makes the length a multiple of four.

Unicode text

café ☕ encodes to Y2Fmw6kg4piV. Decoding gives back exactly the same characters, because the tool uses UTF-8 in both directions.

Frequently asked questions

Is Base64 a form of encryption?

No. It only changes how bytes are written down. Anyone can decode it instantly, so never use Base64 to hide passwords or secrets.

Why is the Base64 output longer than my text?

Base64 uses 4 characters for every 3 bytes of input, so output is roughly 33% larger, plus up to two padding characters.

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

URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _, and usually drops the = padding, so the result can sit in a URL or filename without escaping.

Can I encode an image or file?

Yes — use the Image to Base64 tool for images and data URLs. This page is for text.

Updated November 2026 · Free, no signup · How we build and test tools

Related tools All developer tools →