Base64 Encoder/Decoder

Encode and decode Base64 strings

About Base64

Base64 encoding converts binary data to ASCII text format, using 64 printable characters.

Characters: A-Z, a-z, 0-9, +, /

Padding: = (equals sign)

Size increase: ~33%

Common Uses

  • • Data URLs for images
  • • Email attachments (MIME)
  • • Basic authentication
  • • Storing binary in JSON
  • • JWT tokens

⚠️ Security Note

Base64 is NOT encryption. Anyone can decode it. Never use it to protect sensitive data.

Complete Guide to Base64 Encoding

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters. It was designed to carry data stored in binary formats across channels that only reliably support text content.

The name "Base64" comes from the 64 characters used in the encoding: A-Z (26 characters), a-z (26 characters), 0-9 (10 characters), and two additional characters (+ and /). A 65th character (=) is used for padding.

Every 3 bytes of binary data becomes 4 Base64 characters, which is why Base64 encoding increases data size by approximately 33%. This trade-off ensures compatibility with text-only systems.

When to Use Base64

  • Data URLs: Embed images directly in HTML/CSS without separate requests
  • Email (MIME): Send binary attachments through text-based email protocols
  • APIs: Include binary data in JSON payloads
  • Authentication: HTTP Basic Auth headers use Base64
  • Cryptography: Represent keys and signatures in text format

⚠️ Important: Base64 is encoding, not encryption. It provides zero security—anyone can decode it instantly.

Base64 Character Set

ValueCharacterValueCharacter
0-25A-Z26-51a-z
52-610-962, 63+, /
Padding=URL-safe- and _ replace + and /

🔒 100% Client-Side Processing

This Base64 encoder/decoder runs entirely in your browser. Your data never leaves your device—no uploads, no server processing, no logging. Safe for encoding sensitive configuration strings or testing data.

Related Developer Tools

Frequently Asked Questions

What is Base64 encoding and what is it used for?

Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It's commonly used to embed images in HTML/CSS, send binary data through email (MIME), store complex data in JSON/XML, encode authentication credentials (Basic Auth), and transmit data in URLs. Base64 increases data size by approximately 33% but ensures safe transmission through text-only channels.

Is Base64 encoding the same as encryption?

No, Base64 is NOT encryption and provides NO security. It's simply an encoding format that can be easily reversed by anyone. Never use Base64 to protect sensitive data like passwords or API keys. Anyone can decode Base64 strings instantly. For security, use proper encryption algorithms like AES, or hashing for passwords.

Why does Base64 make data larger?

Base64 encoding increases data size by approximately 33% (4 output characters for every 3 input bytes). This overhead occurs because Base64 uses only 64 printable ASCII characters to represent data, requiring more characters to encode the same information. This trade-off ensures the data can safely pass through systems that only support text.

What characters are used in Base64?

Standard Base64 uses 64 characters: A-Z (26), a-z (26), 0-9 (10), and + and / (2). The = character is used for padding. URL-safe Base64 replaces + with - and / with _ to avoid URL encoding issues. This tool uses standard Base64 encoding.

Can I encode images or files with this tool?

This tool encodes text/string data to Base64. For encoding images, you would first need to read the image as binary data. In web development, you can use FileReader API to convert images to Base64 data URLs (data:image/png;base64,...). For direct file encoding, use command-line tools like `base64` on Linux/Mac.

Why am I getting "Invalid Base64 string" error?

This error occurs when the input isn't valid Base64. Common causes: the string contains invalid characters (only A-Z, a-z, 0-9, +, /, = allowed), incorrect padding (Base64 strings should have length divisible by 4), or extra whitespace/newlines. Try removing any spaces or copying the Base64 string again.

Is my data safe when using this Base64 tool?

Yes, completely safe. This tool runs 100% in your browser using JavaScript. Your data never leaves your device—no server uploads, no logging, no storage. You can verify this by checking your browser's network tab. The encoding/decoding happens locally using built-in browser functions.

What is the difference between Base64 and Base64URL?

Base64URL is a variant designed for URLs and filenames. It replaces + with - and / with _ (which have special meaning in URLs). It also often omits padding (=). Base64URL is commonly used in JWTs (JSON Web Tokens) and data URLs. This tool uses standard Base64; for URL-safe encoding, use our URL Encoder tool.