Home / General Tools

Base64 Decode and Encode Online

Use this tool to Base64 decode any string back into readable text, or to Base64 encode text and files. It handles UTF-8, URL safe strings, images and MIME line breaks. Paste your input and the result appears as you type.

What Base64 Is

Base64 is a way to write binary data with only 64 safe characters: A to Z, a to z, 0 to 9, plus (+) and slash (/). The equals sign (=) pads the end when needed. It lets images, files and other raw bytes travel through systems built for plain text, such as email and JSON.

Base64 is an encoding, not encryption. Anyone can reverse it in a second, as the tool above shows. Never use it to hide passwords or private data.

How to Base64 Decode a String

  • Choose the decode option at the top of the tool.
  • Paste the encoded string into the input box.
  • Read the result in the output box and copy it with one click.

Spaces and line breaks in the input are ignored, and so is a data URI prefix at the start. If the bytes form valid UTF-8, you see the text. If they hold an image you get a preview, and any other binary data is shown in hex.

How to Base64 Encode Text or a File

To Base64 encode text, switch the mode and type or paste it. The tool reads your text as UTF-8 first, so accents, Urdu script and emoji all survive the round trip. For a file, pick it with the file button and the output appears at once.

Image files also get a preview. Put the image type and the word base64 in front of the output and you have a data URI for HTML or CSS. Keep this for small icons, since a large image grows by about a third.

Worked Examples

These are real results from the tool. You can paste any of them back in to Base64 decode them again. Each row shows a different padding case.

InputBase64 output
ManTWFu
HiSGk=
Hello World!SGVsbG8gV29ybGQh
caféY2Fmw6k=

Three letters such as "Man" fit exactly into four characters. "Hi" has only two bytes, so one equals sign pads the result. The é in café takes two bytes in UTF-8, which is why the output is longer than the word looks.

How the Encoding Works

To Base64 encode data, the encoder reads it three bytes at a time, which is 24 bits. It splits those bits into four groups of 6 bits, and each group picks one of the 64 characters. When the last group has only one or two bytes, one or two = signs fill the gap.

That is why padded output is always a multiple of four characters long. It also explains the size cost, since 3 bytes always become 4 characters. A 30 KB image turns into about 40 KB of text.

URL Safe Base64

Standard Base64 uses + and /, which have special meanings in web addresses. The URL safe version swaps them for a minus sign and an underscore and usually drops the padding. JSON Web Tokens and many APIs use this form.

Tick the URL safe box to Base64 encode in this style. When you Base64 decode, the tool accepts both alphabets. You can paste either kind without changing a setting.

Common Uses

  • Small icons placed inside HTML, CSS or email as plain text.
  • Files sent inside JSON or XML, which only carry text.
  • Email attachments, which use MIME Base64 split into 76 character lines.
  • Basic HTTP login headers, which are encoded but not secured.

Why Use This Base64 Converter

It works both ways and supports text, files and images. It also handles URL safe and MIME formats with one tick. Everything runs in your browser, so your data never reaches our server. Paste your string and get the result now.

Frequently asked questions

Is Base64 a form of encryption?

No, it is an encoding that anyone can reverse.

How do I Base64 decode a string?

Paste it in decode mode and the text appears instantly.

Can I Base64 encode a file or image?

Yes, pick it with the file button and copy the output.

Why does Base64 end with = signs?

They pad the last group when the input is not a multiple of three bytes.

Can I convert Base64 to text with accents or emoji?

Yes, it decodes UTF-8, so Base64 to text works for every language.

How much bigger does data get?

Base64 output is about 33% larger than the original.

Is my data uploaded anywhere?

No, this Base64 converter runs entirely in your browser.

Related calculators

Other tools people use alongside the base64 encoder / decoder.

Browse all calculators