What is Base64 Encoding? A Simple Explanation

Published 2026-04-09

If you've worked with APIs, emails, or web development, you've probably seen strings of seemingly random characters like SGVsbG8gV29ybGQ=. That's Base64 encoding in action.

What is Base64?

Base64 is a way to represent binary data using only text characters. It converts any data — text, images, files — into a string using 64 safe characters: A-Z, a-z, 0-9, +, and /.

For example, "Hello World" becomes SGVsbG8gV29ybGQ= in Base64.

Why Use Base64?

  • Email attachments — SMTP (email protocol) only supports text, so files are Base64-encoded for transmission
  • Data URLs — Embed small images directly in HTML/CSS: data:image/png;base64,iVBOR...
  • API payloads — Safely include binary data in JSON, which is text-only
  • Basic authentication — HTTP Basic Auth encodes credentials in Base64 (though this is NOT encryption!)

Important: Base64 is NOT Encryption

A common misconception is that Base64 provides security. It doesn't. Anyone can decode Base64 instantly. It's an encoding (a format), not encryption (a security measure). Never use Base64 to hide passwords or sensitive data.

How to Encode and Decode Base64

Use our free Base64 Encoder/Decoder to convert text to Base64 and back instantly. It runs entirely in your browser — your data never leaves your computer.

Base64 Size Overhead

Base64 encoding increases data size by about 33%. A 3-byte input becomes 4 Base64 characters. That's why you shouldn't Base64-encode large files — the overhead adds up quickly.

Related tool: Base64 Encoder / Decoder — Encode text to Base64 or decode Base64 back to text.
Copied!