Skip to content

Base64 Encoder & Decoder

Convert readable UTF-8 text to Base64 and decode Base64 back to text in your browser. This is useful for data interchange and quick debugging.

Runs locally in your browser

Discuss a result

Write a short summary and review it before posting. Your tool inputs are never copied automatically.

What is the Base64 Encoder & Decoder?

Convert readable UTF-8 text to Base64 and decode Base64 back to text in your browser. This is useful for data interchange and quick debugging.

How to use it

  1. 1Keep Base64 selected as the scheme.
  2. 2Enter plain text to encode or paste encoded text into the decode field.
  3. 3Copy the corresponding result.

How it works

TextEncoder turns Unicode text into UTF-8 bytes before Base64 encoding. Decoding reverses the process through TextDecoder.

A familiar example

The ASCII text “Hello” encodes to “SGVsbG8=”.

Limitations & notes

  • Base64 is an encoding format, not encryption.
  • Malformed Base64 cannot be decoded.

Frequently asked questions

Is Base64 a form of encryption?

No. Base64 only rewrites bytes using 64 printable characters (A-Z, a-z, 0-9, + and /) so binary or non-ASCII data can travel through text-only channels such as email bodies, JSON fields or HTTP headers. Anyone can reverse it without a key. If you see a password or API key stored as Base64, treat it as plain text: decoding it takes one click, so it needs real encryption or a secrets manager instead.

Why is Base64 output about a third larger than the input?

Base64 turns every 3 bytes into 4 characters, so encoded data is roughly 133 percent of the original size, plus up to two = padding characters at the end. A 30 KB image becomes about 40 KB of Base64 text. Non-ASCII text grows more, because characters like é take two UTF-8 bytes before encoding: the single letter é encodes to w6k=, four characters for one visible letter.

Why do I get an error when decoding a Base64 string with - or _ characters?

Those characters belong to the Base64URL variant used in JWTs and many web APIs, which swaps + for - and / for _ and often drops the = padding. This tool uses the standard alphabet through the browser's atob function, so - and _ are rejected and the result shows that the input could not be decoded. Replace - with + and _ with / first, then decode.

Why does my decoded text show strange symbols like the � character?

The tool decodes Base64 to bytes and then reads those bytes as UTF-8 text. If the original data was an image, a zip file, or text saved in another encoding such as Windows-1252, the bytes are not valid UTF-8 and the decoder substitutes the replacement character. The Base64 itself was fine; the content is simply not UTF-8 text, and this page only displays text, not files.

Can I encode a file or image with this tool?

No. This page encodes text you type or paste, converting it to UTF-8 bytes first, and it has no file picker. To embed a small image as a data URI you need a tool that reads the file's raw bytes. You can, however, paste Base64 text that came from elsewhere and decode it, as long as the original content was UTF-8 text.

No directly related discussion yet.

Start a focused thread and share the question this tool helped you explore.

Ask the community about Base64 Encoder & Decoder

You might also like