Base64 Encoder/Decoder Tool

Encode and decode Base64 data instantly. Convert text, files, or binary data to Base64 format or decode Base64 strings back to their original form.

Characters: 0 | Size: 0 bytes
✓ Copied to clipboard!
💡 Quick Tip: Base64 encoding converts binary data into ASCII text using 64 characters (A-Z, a-z, 0-9, +, /). It’s commonly used for embedding images in HTML/CSS and transmitting data over text-based protocols.

🔒 Working with sensitive text or files online? NordVPN keeps your connection private and encrypts it in one click — Hide My Activity and Secure My Connection →

Case Converter Online Tool Base64 Encoder/Decoder Tool

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It uses 64 different characters (hence the name) to represent data:

Base64 Character Set:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 + /
(Plus padding character: =)

Base64 encoding increases the data size by approximately 33% because it represents 3 bytes of binary data using 4 ASCII characters. This trade-off allows binary data to be safely transmitted through systems that only support text.

Example:
Original Text: Hello World
Base64 Encoded: SGVsbG8gV29ybGQ=
Back to Original: Hello World

How Base64 Encoding Works

  1. Binary Conversion: Text is first converted to binary (8-bit bytes).
  2. Grouping: Binary data is divided into groups of 6 bits each.
  3. Mapping: Each 6-bit group is mapped to one of the 64 Base64 characters.
  4. Padding: If the input isn’t a multiple of 3 bytes, padding characters (=) are added.
Encoding Process Example:
Text: "A"
ASCII: 65
Binary: 01000001
6-bit groups: 010000 01
Padded: 010000 010000 (padding needed)
Base64: QQ==

Common Use Cases for Base64

🖼️ Embedding Images

Embed images directly in HTML, CSS, or JSON using Data URIs. Great for small icons and logos to reduce HTTP requests.

data:image/png;base64,iVBOR...

📧 Email Attachments

MIME (Multipurpose Internet Mail Extensions) uses Base64 to encode email attachments for safe transmission.

🔐 Basic Authentication

HTTP Basic Authentication encodes credentials in Base64 format in the Authorization header.

Authorization: Basic dXNlcjpwYXNz

🔄 API Data Transfer

Transfer binary data (PDFs, images, files) through JSON APIs that only support text.

💾 Data Storage

Store binary data in text-based formats like XML, JSON, or databases that don’t support binary.

🌐 Web Tokens

JWT (JSON Web Tokens) use Base64url encoding to encode token headers and payloads.

How to Use the Base64 Encoder/Decoder

Encoding Text to Base64:

  1. Enter or paste your plain text in the text area.
  2. Click the “Encode to Base64” button.
  3. The encoded Base64 string will appear in the same text area.
  4. Click “Copy Result” to copy it to your clipboard.

Decoding Base64 to Text:

  1. Paste your Base64 encoded string in the text area.
  2. Click the “Decode from Base64” button.
  3. The decoded text will appear in the text area.
  4. Click “Copy Result” to copy the decoded text.
Try This:
Type “Hello World” and click Encode. You’ll get: SGVsbG8gV29ybGQ=
Then click Decode to get back: Hello World

Base64 vs Other Encoding Methods

Encoding Type Characters Used Use Case Size Increase
Base64 A-Z, a-z, 0-9, +, / Email, Data URIs, APIs ~33%
Base64url A-Z, a-z, 0-9, -, _ URLs, Filenames, JWT ~33%
Hexadecimal 0-9, A-F Color codes, Hashes 100%
URL Encoding %, 0-9, A-F URLs only Varies

Frequently Asked Questions

No! Base64 is NOT encryption or security. It’s simply an encoding method to convert binary data to text. Anyone can easily decode Base64 data. Never use Base64 to hide sensitive information like passwords. Use proper encryption methods (AES, RSA) for security.

Base64 encodes 3 bytes of binary data using 4 ASCII characters. This 3:4 ratio means the encoded data is approximately 33% larger than the original. This trade-off allows binary data to be transmitted safely through text-only systems.

The “=” character is padding used when the input data isn’t a multiple of 3 bytes. It ensures the encoded output length is always a multiple of 4 characters. For example, “A” encodes to “QQ==” with two padding characters, and “AB” encodes to “QUI=” with one padding character.

This tool is designed for text encoding/decoding. For encoding images and files, you would need a file upload feature. However, if you already have a Base64 string of an image or file, you can decode it here to see if it’s valid.

Base64url is a URL-safe variant of Base64. It replaces “+” with “-” and “/” with “_” and removes padding “=” characters. This makes it safe to use in URLs and filenames without encoding. JWT (JSON Web Tokens) use Base64url encoding.

Yes! Our tool properly handles Unicode characters (emoji, Chinese, Arabic, etc.) by first encoding them as UTF-8 before converting to Base64. This ensures all international characters are preserved correctly during encoding and decoding.

Yes! Our Base64 encoder/decoder tool is completely free to use with no registration, no limits, and no hidden costs. Encode and decode as much data as you need!

Base64 Encoding Examples

Original Text Base64 Encoded
Hello World SGVsbG8gV29ybGQ=
user:password dXNlcjpwYXNzd29yZA==
[email protected] YWRtaW5AZXhhbXBsZS5jb20=
Base64 Encoding! QmFzZTY0IEVuY29kaW5nIQ==
🎉 Emoji test 😀 8J+OiSBFbW9qaSB0ZXN0IPCfmIA=
123456789 MTIzNDU2Nzg5

Practical Examples

1. Data URI for Images

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..." alt="Small icon">

2. HTTP Basic Authentication

Credentials: username:password
Base64: dXNlcm5hbWU6cGFzc3dvcmQ=
Header: Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

3. JSON with Binary Data

{
  "filename": "document.pdf",
  "content": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXB..."
}
Ethan KeenEthan Keen
Last updated: September 14, 2026
Check out some of our other pages here:
Remove Backslashes From Text ✅ Online Case Converter Tool 2026

📝 Easily remove backslashes from your text with our free online Backslash Remover tool. ✅ Paste your text, click convert, and get clean results instantly.

CSS Beautifier & Code Fixer

Our CSS Beautifier & Code Fixer is a simple tool designed to help you with that. It works like a 2-in-1 helper: it not only...

Schema Markup Generator

Schema Markup Generator Build valid JSON-LD structured data — FAQ, Article, Product, Breadcrumb, Local Business, or Review schema — by filling in a simple form....

Remove Greater Than Sign From Text ✅ Online Case Converter 2026

😀 Online Case Convert Tool ☞ Remove Greater Than Sign From Text, underline, dots and commas, brackets