Base64 Encoder and Decoder

Base64 turns any data, whether text, an image or a file, into plain letters, digits and a few symbols, so it can travel safely through systems built for text: JSON payloads, email attachments, data URLs and HTTP headers.

This tool encodes text or a file to Base64 and decodes Base64 back to text. It is UTF-8 aware, so Hindi, Tamil, other Indian scripts and emoji survive the round trip. Everything happens in your browser.

How Base64 works

Base64 takes the data three bytes at a time (24 bits) and splits them into four groups of six bits. Each six-bit group maps to one of 64 characters: A to Z, a to z, 0 to 9, + and /. When the data does not divide evenly into three bytes, "=" signs pad the end.

Because three bytes become four characters, Base64 output is about a third larger than the input. That is the price of being able to place binary data inside text.

Unicode text and a common pitfall

Many simple encoders break on non-English text because they treat each character as one byte. This tool first converts text to UTF-8 bytes, then encodes them, so "Hello नमस्ते 👋" encodes to SGVsbG8g4KSo4KSu4KS44KWN4KSk4KWHIPCfkYs= and decodes back exactly.

Remember that Base64 is encoding, not encryption. Anyone can decode it in seconds, so never use it to hide passwords or secrets.

How to use this tool

  1. Choose encode or decode: Encode text or a file to Base64, or decode Base64 to text.
  2. Enter the input: Type or paste text, or choose a file to encode.
  3. Run it: Click Encode or Decode to see the result.
  4. Copy the result: Copy the output to use in your code, email or data URL.

Features

Worked examples

Encoding mixed-language text

Encode "Hello नमस्ते 👋".

UTF-8 bytes of the text, grouped in threes and mapped to Base64 characters

Result: SGVsbG8g4KSo4KSu4KS44KWN4KSk4KWHIPCfkYs=

Who it is for

Tips

Frequently asked questions

What is Base64 used for?

It lets binary data such as images and files travel through systems that handle only text, including JSON, email and URLs. It is also used for Basic authentication headers and data URLs on web pages.

Why does my Base64 end with = signs?

Base64 works on groups of three bytes. When the input length is not a multiple of three, one or two = signs pad the output so it can be decoded correctly. They are normal.

Is Base64 secure?

No. It is an encoding, not encryption, and anyone can decode it instantly. Use proper encryption for secrets and passwords.

Why does decoding give strange characters?

Either the input is not valid Base64, or it was produced from text in a different character encoding. This tool encodes and decodes with UTF-8, which handles all languages and emoji.

Related tools