Developer Tools

What Is Base64 Encoding?

Learn what Base64 encoding is, how it works, and why it's not encryption, with a simple worked example and common use cases.

Brekzy Team Published September 7, 2026 Updated September 8, 2026

On this page
  1. What Is Base64?
  2. Is Base64 Encryption?
  3. How Base64 Encoding Works
  4. Common Uses of Base64
  5. Base64 Examples
  6. Base64 Limitations
  7. How to Encode and Decode Base64

If you’ve ever seen a long jumble of letters and numbers ending in one or two = signs inside a file, an email, or a piece of code, there’s a good chance you were looking at Base64. Here’s what it actually is, and what it isn’t.

What Is Base64?

Base64 is a way of representing binary data (the raw bytes a computer works with) using only plain text characters. It converts that binary data into a sequence made up of 64 safe, printable characters: the letters A-Z and a-z, the digits 0-9, plus + and /, with = used for padding at the end.

Base64 exists because some systems, especially older ones, were only designed to handle plain text safely. Base64 lets binary data, like an image or a file, pass through those systems without getting corrupted.

Is Base64 Encryption?

No. Base64 is not encryption, and it does not protect data. Anyone can decode a Base64 string back to its original form in a single step, using nothing more than a text editor or a basic online tool; there is no secret key involved.

It helps to be clear about the difference between three terms that often get confused:

  • Encoding (what Base64 does): transforms data into a different, reversible format. Anyone who knows the encoding scheme can reverse it. It’s meant for compatibility, not secrecy.
  • Encryption: transforms data using a secret key so that only someone with the correct key can read it. It’s meant for confidentiality.
  • Hashing: produces a fixed-length fingerprint of data that generally can’t be reversed at all. It’s used to verify data hasn’t changed, not to store or transmit the data itself.

If you need to keep data secret, Base64 alone does nothing to help. You need actual encryption.

How Base64 Encoding Works

Conceptually, Base64 takes binary data 3 bytes at a time and re-represents those bytes as 4 text characters, each one drawn from the 64-character set described above. Because the output only uses that fixed set of safe characters, it can travel through systems that might otherwise mishandle raw binary bytes, such as certain text fields, older email systems, or JSON strings.

You don’t need to work this out by hand; it’s a mechanical, well-defined process that any Base64 encoder performs the same way every time.

Common Uses of Base64

  • Email attachments: early email standards could only reliably transmit plain text, so attachments are Base64-encoded before sending.
  • Data URLs: images or fonts can be embedded directly inside HTML or CSS as Base64 text instead of a separate file.
  • APIs: some APIs accept binary data, like a file upload, as a Base64 string inside a JSON payload, since JSON can only contain text.
  • Basic data transport: any situation where binary data needs to safely pass through a text-only channel.

Base64-encoded output sometimes needs a further layer of encoding before it can be placed into a URL query string: see What Is URL Encoding?. It’s also common to see Base64 strings appear as plain values inside What Is JSON? payloads, alongside other identifiers such as What Is a UUID?.

Base64 Examples

Encoding the plain text Hello produces:

SGVsbG8=

The = at the end is padding, added because Base64 processes data in fixed-size chunks and pads the last one out when needed. Decoding SGVsbG8= gives you back the original text, Hello, exactly.

Base64 Limitations

  • It increases data size. Every 3 bytes of original data becomes 4 Base64 characters, so encoded data is roughly a third larger than the original.
  • It is not encryption. Base64 provides no confidentiality; it only changes the representation of the data, not who can access it.
  • It should never be used to protect passwords or sensitive data. Storing a password “encoded” in Base64 instead of properly hashed is a common and serious security mistake, since anyone who obtains the encoded value can decode it instantly.

How to Encode and Decode Base64

To convert text or data to and from Base64 without doing the maths yourself, use the Base64 Encoder & Decoder. It handles both directions instantly and works entirely in your browser.

Try it yourself

Base64 Encoder & Decoder

Try our Base64 Encoder & Decoder →

Frequently Asked Questions

Is Base64 encryption?

No. Base64 is an encoding scheme, not encryption. It doesn’t use a key, and it provides no security or confidentiality.

Can Base64 be decoded?

Yes, easily and by anyone. Decoding Base64 requires no secret information; it’s a direct, reversible conversion back to the original data.

Why is Base64 used?

It’s used to safely represent binary data as plain text so it can pass through systems, formats, or protocols that only reliably handle text, such as email or JSON.

Does Base64 make data secure?

No. Base64 doesn’t add any security. Treat Base64-encoded data as just as visible as plain text, because that’s effectively what it is.

Why does Base64 increase file size?

Because it represents every 3 bytes of original binary data as 4 text characters, encoded output is larger than the original by roughly a third.

Can Base64 encode images?

Yes. Any binary data, including images, can be Base64-encoded. This is exactly how data URLs embed small images directly inside HTML or CSS files.

Explore More

Find the right tool, or keep reading Brekzy's other guides.