Guide

What Is Base64 Encoding and When to Use It

Base64 is a way of writing any data — text, images, files — using only 64 safe characters: A–Z, a–z, 0–9, + and /. The word "Hi" becomes "SGk=". It is used to send data through places that only accept plain text, like email or web addresses.

How it works

Computers store data as bytes of 8 bits. Base64 takes 3 bytes (24 bits) at a time and splits them into four 6-bit chunks. Each 6-bit chunk is a number from 0 to 63, which maps to one of the 64 characters.

So every 3 bytes of input become 4 characters of output. If the input does not divide evenly by 3, one or two = signs are added at the end as padding.

Base64 makes data about 33% bigger

Because 3 bytes turn into 4 characters, encoded data is roughly a third larger. A 30 KB image becomes about 40 KB in Base64.

That is the trade-off: you gain safe, text-only data but pay with extra size, so it is best for small items.

Common uses

You will meet Base64 in many everyday technical places:

  • Email attachments, which travel as text
  • Small images embedded directly in web pages (data: URLs)
  • Login tokens and API keys in web requests
  • Storing binary data inside JSON or XML files

Base64 is not encryption

Anyone can decode Base64 instantly — there is no key or password. Never use it to hide passwords or private information. It only changes how data looks, not who can read it.

If you need real secrecy, use proper encryption; if you need to check that data was not changed, use a hash.

Encode and decode text

Type or paste text into the Base64 Encoder and press Encode to convert it, or paste Base64 and press Decode to get the original back. Emoji and accented letters are handled correctly, and invalid Base64 shows an error.

Try it yourself

Put this guide into practice with our free Base64 Encoder — no sign-up, no download.

Open the Base64 Encoder