Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 strings instantly

About this calculator

Encode text or a file to Base64, or decode Base64 back, with an optional URL-safe mode. Upload a file to get its Base64 string.

Developers use Base64 daily: in API payloads, HTTP Basic auth headers, JSON Web Tokens, data URIs and email. This tool runs in your browser, so you can safely inspect values.

How to use it

  1. Paste text or choose a file.
  2. Press Encode → or ← Decode.
  3. Tick URL-safe if the output goes in a URL.

How Base64 works

Base64 turns binary data into text using 64 safe characters: A to Z, a to z, 0 to 9, + and /. Every 3 bytes (24 bits) become 4 characters (6 bits each), and = padding fills the end. The output is about 33% larger than the input. The URL-safe variant swaps + and / for - and _. Base64 is an encoding, not encryption: anyone can decode it.

Worked example

Examples

HelloSGVsbG8=
Hello, World!SGVsbG8sIFdvcmxkIQ==
SGVsbG8=Hello

Runs entirely in your browser. Nothing you paste is uploaded.

Tips and common mistakes

  • Base64 is not security. Never use it to hide passwords.
  • Use URL-safe Base64 for tokens placed in URLs.
  • Padding (=) can be omitted in some systems, but keep it unless the spec says otherwise.
  • Non-ASCII text is encoded as UTF-8 bytes first.
  • Large files make huge Base64 strings. Prefer binary upload for anything over a few hundred KB.

Frequently asked questions

What is Base64?

A way to represent binary data as plain text using 64 characters.

Is Base64 encryption?

No. It is reversible by anyone and offers no secrecy.

Why is Base64 33% bigger?

Every 3 bytes become 4 characters.

What is the = at the end?

Padding so the length is a multiple of 4.

What is URL-safe Base64?

A variant using - and _ instead of + and /.

Where is Base64 used?

Email attachments, data URIs, JSON Web Tokens and API payloads.

Related tools