Base64 Encoder and Decoder – Convert Text and Files

Base64 Encoder and Decoder that converts text to Base64 format and back. No sign-up, no cost, just instant conversion.
We built this tool for developers, designers, and anyone who needs to encode data for APIs, data URIs, or secure transfers.
Paste your text, choose encode or decode, toggle URL-safe mode if needed, and get your result instantly.
All conversions happen in your browser. Nothing is stored or uploaded anywhere.

Light Dark

Text to Base64 Encoder

Convert plain text to Base64 encoded string

0 characters

Base64 to Text Decoder

Convert Base64 encoded string back to plain text

0 characters

File to Base64 Encoder

Convert files to Base64 encoded data URI

Click to upload or drag & drop file here

Max file size: 10MB

Conversion Info

Input Length
0
Output Length
0
Size Increase
~33%

About Base64 Encoding

Base64 encoding converts binary data into ASCII text format using 64 characters (A-Z, a-z, 0-9, +, /). Encoded data is approximately 33% larger than the original.

Privacy Guaranteed

All conversions happen locally in your browser. No data is uploaded to servers or stored anywhere. Your files and text remain completely private.

1

Select mode - Choose Encode, Decode, or File Encoder.

2

Enter data - Paste text, Base64 string, or upload a file.

3

Convert instantly - Click the button for real-time conversion.

4

Copy or download - Use your converted data immediately.

Common Use Cases

  • Embed images in HTML/CSS as data URIs
  • Encode API credentials and tokens
  • Transfer binary data in JSON/XML
  • Email attachment encoding
  • Store binary data in databases

Features

  • Real-time text encoding/decoding
  • File to Base64 conversion
  • URL-safe Base64 support
  • Copy and download results
  • Conversion history tracking
1

Select mode - Choose Encode, Decode, or File Encoder.

2

Enter data - Paste text, Base64 string, or upload a file.

3

Convert instantly - Click the button for real-time conversion.

4

Copy or download - Use your converted data immediately.

Have you ever needed to send binary data through a text-based system like JSON or XML? Or maybe you wanted to embed an image directly into your CSS without a separate file. These situations require a way to convert binary data into plain text that can travel safely across the internet. That is exactly what Base64 encoding does.

This Base64 encoder and decoder is designed to help developers, designers, and anyone working with data transmission convert text to Base64 and back. With options for standard and URL-safe encoding, plus file support, our tool handles all your encoding needs. All conversions happen locally in your browser, keeping your data private and secure.

What People Use This For

Here are some real ways people use this tool.

️ Embedding Images in HTML/CSS as Data URIs

A web developer converts an image to Base64 and embeds it directly in CSS or HTML. No separate image file needed, reducing HTTP requests and simplifying deployment.

Encoding API Credentials and Tokens

A developer needs to encode authentication credentials for API requests, especially for Basic Auth headers. Base64 provides the standard format for this encoding.

Transferring Binary Data in JSON/XML

A programmer sends binary data through text-based formats like JSON. Base64 encoding makes the data safe to transmit without corruption.

Email Attachment Encoding

Email systems use Base64 to encode attachments for safe transmission. Developers test encoding before implementation to ensure compatibility.

️ Storing Binary Data in Databases

A database administrator stores binary data as Base64 strings when binary fields are not available or when text storage is required for compatibility.

Debugging Encoded Data

Someone receives a Base64 string from an API or system and needs to decode it to see the original content. They paste and decode instantly to verify the data.

Did you know? Base64 encoding has been a fundamental part of internet infrastructure since the early days of email. It was originally designed to allow binary data to be sent through text-only email systems like SMTP. Today, it is used everywhere from data URIs in web development to API authentication headers. The name "Base64" comes from the 64-character alphabet used to represent the data.

How Base64 Encoding and Decoding Works

Simple conversion, right in your browser. Here is exactly what happens when you click Encode or Decode.

When encoding, our tool converts your text into Base64 format using the standard Base64 alphabet (A-Z, a-z, 0-9, +, /). Each group of 3 bytes becomes 4 characters. The result is a text string that can be safely transmitted through any text-based system.

When decoding, the tool reverses the process, converting the Base64 string back to plain text. If URL-safe mode is enabled, the tool handles the modified character set (using - and _ instead of + and /).

All operations happen in your browser. No data is sent to any server. Your information stays private.

Settings and Options

Options to customize your conversion.

📝 Input Text

Enter plain text to encode or Base64 string to decode. A character counter shows the input length, helping you track your data size.

🔗 URL-Safe Encoding

Toggle to replace standard characters (+ and /) with URL-friendly alternatives (- and _). Useful for embedding encoded data in URLs, query parameters, and filenames.

📊 Conversion Info

Shows input length, output length, and size increase (typically about 33 percent for encoding). Helps you understand the impact of Base64 on your data size.

📁 File Encoder

Upload a file to convert its contents to Base64 format. Perfect for encoding images, documents, or any binary data for embedding or transmission.

About Base64 Encoding

Base64 encoding converts binary data into ASCII text format using 64 characters: A-Z, a-z, 0-9, +, and /. This makes binary data safe to transmit through text-only systems like email, JSON, or XML. When data is encoded, the size increases by approximately 33 percent because every 3 bytes of original data become 4 characters of Base64 text.

Pro tips for effective Base64 conversion: Use URL-safe encoding for web use. If you are putting Base64 data in URLs, query parameters, or filenames, enable URL-safe mode to avoid issues with + and / characters. Check the size increase. Encoded data is about 33 percent larger. Keep this in mind when embedding large files as data URIs. Test small strings first. If you are new to Base64, test with short text to understand how encoding and decoding work before processing large data. Decoding requires valid Base64. Make sure your input is properly formatted Base64. Invalid strings may return errors or empty results. Use for debugging. If you receive encoded data from an API or system, decode it to see the original content and verify it matches expectations.

Frequently Asked Questions

1. What is Base64 encoding?

Base64 is a process that converts binary data into ASCII text format using 64 specific characters (A-Z, a-z, 0-9, +, /). It is used to safely transmit binary data through text-based systems like email, JSON, XML, and URLs.

2. Why does the file size increase after encoding?

Encoded data is approximately 33 percent larger than the original because every 3 bytes of binary data are converted into 4 characters of text. This is normal and expected for Base64 encoding. The trade-off is safe transmission through text-only channels.

3. Is this Base64 tool secure?

Yes. All conversions happen in your browser. No text or data is uploaded to any server. Your information stays private on your device. Even file uploads are processed locally.

4. What is URL-safe Base64?

URL-safe Base64 replaces standard characters + and / with - and _. This makes the encoded string safe to use in URLs, query parameters, and filenames without additional escaping or encoding.

5. Can I encode files?

Yes. The File Encoder option allows you to upload a file (up to 10MB) and convert its contents to Base64 format. This is perfect for embedding images, documents, or any binary data directly into text-based formats.

6. Does this work on a phone?

Yes. Our Base64 converter works on iPhone, Android, and tablets. Paste text or upload files and convert instantly from your device. Perfect for developers on the go.

7. Is this free?

Yes. No payment, no account, no credit card required. Use the tool as many times as you need, for any project, with any data.

8. What is a data URI and how is it used?

A data URI is a way to embed small files directly in HTML or CSS using Base64 encoding. For example, `data:image/png;base64,iVBORw0KGgo...` allows you to include an image without a separate file. This reduces HTTP requests and is useful for small assets.

9. How do I use Base64 for API authentication?

Many APIs use Basic Auth, which requires credentials in the format `username:password` encoded in Base64. You can use this tool to encode your credentials and then include them in the Authorization header: `Authorization: Basic base64encodedstring`.

10. What happens if I try to decode invalid Base64?

Our tool will attempt to decode valid Base64 strings. If the input is not properly formatted, you may receive an error or an empty result. Make sure your Base64 string uses the correct character set (A-Z, a-z, 0-9, +, / for standard, or -, _ for URL-safe).

Note: This Base64 Encoder and Decoder performs all conversions locally in your browser. No data is transmitted to external servers. For file encoding, maximum file size is 10MB. URL-safe mode replaces + and / with - and _ for use in web contexts. The size increase from encoding is typically about 33 percent.