Developer tools

How to encode and decode Base64, and why it is not encryption

Learn how Base64 works, when to use it for transport, how to encode and decode it locally, and why it is not encryption.

9 min read Reviewed August 4, 2026 Professional reference

Document summary

A guide to Base64: what the encoding does, when to use it, how to encode and decode locally, and why it adds no security.

Key takeaways

  • Base64 is a text representation, not a cipher
  • It grows data by about 33 percent
  • Decode once; double decoding corrupts data
01

What Base64 actually does

Base64 maps binary bytes to 64 safe ASCII characters (A-Z, a-z, 0-9, +, /) plus = padding. It exists so binary data can travel through text-only channels such as email, JSON, and URLs.

Because the mapping is public and reversible without any key, Base64 provides transport safety, not confidentiality.

02

Where Base64 is the right tool

  • Embedding images as data URIs in HTML
  • Sending binary payloads inside JSON APIs
  • Email attachments in MIME encoding
  • Storing small binary blobs in text fields
03

Encode and decode locally

  1. 1

    Open the Base64 encoder and decoder.

  2. 2

    Paste text or open a file to encode.

  3. 3

    Run the conversion and copy the output.

  4. 4

    To recover the original, paste the Base64 and decode.

04

Why it is not encryption

Anyone who sees Base64 can decode it in seconds, with no key. If you need confidentiality, use real encryption with a secret key; for integrity checks, use a hash instead.

Never store passwords or tokens as Base64 and assume they are protected.

05

Frequently asked questions

Can Base64 be decoded without a key?

Yes. The mapping is public, so decoding needs no key. That is why it is an encoding, not encryption.

Why does Base64 output grow?

Each character carries 6 bits, so 3 bytes become 4 characters. The output is about 33 percent larger than the input.

What is the = padding for?

Padding makes the output length a multiple of 4 so decoders can restore the exact original byte count.

Is my data uploaded during encoding?

No. Encoding and decoding run locally in your browser.

Jump to tool

Encode or decode Base64

Open tool