Base64 Encoder/Decoder

Encode or decode Base64 text with customizable options

Options

How to Use

1
Choose Mode

Select Encode to convert text to Base64, or Decode to convert Base64 back to text.

2
Input Your Data

Paste text or upload files. Supports multiple file formats including TXT, CSV, JSON, XML.

3
Configure Options

Choose encoding type, enable URL-safe mode for URLs, or split output into lines for MIME.

4
Export Results

Copy to clipboard or download the result. All processing happens locally in your browser.

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into a text format using 64 printable characters. It's one of the most widely used encoding methods on the internet, essential for data transmission and storage in text-based systems.

When you need to embed an image in HTML, send binary data in JSON, or include attachments in emails, Base64 encoding makes it possible. Our tool handles both encoding and decoding with support for various options to fit your specific needs.

How to Use This Tool

Using our Base64 encoder/decoder is straightforward:

  1. Select your mode: Encode (text to Base64) or Decode (Base64 to text)
  2. Paste your text or upload a file
  3. Choose your encoding (UTF-8, ASCII, or ISO-8859-1)
  4. Enable URL-safe mode if needed for URLs or filenames
  5. Click process and copy or download your result

Common Use Cases

Embedding Images in HTML/CSS

Data URIs allow you to embed images directly in HTML or CSS without separate file requests. Encode your image to Base64 and use it as: data:image/png;base64,YOUR_BASE64_STRING. This reduces HTTP requests and can improve page load times for small images.

API Data Transmission

REST APIs often require binary data (like files or images) to be sent as Base64-encoded strings within JSON payloads. This ensures the data remains intact during transmission through text-based protocols.

Email Attachments

MIME email format uses Base64 to encode binary attachments. When creating emails programmatically, you'll need to Base64-encode any binary files. Use the line-splitting option with 76-character lines for MIME compliance.

Authentication Tokens

Many authentication schemes, including Basic Auth and JWT, use Base64 encoding. Basic Auth headers encode username:password in Base64, while JWT tokens contain Base64-encoded JSON payloads.

Understanding the Options

Character Encodings

  • UTF-8: Universal encoding supporting all Unicode characters. Best for international text, emojis, and symbols.
  • ASCII: Basic 7-bit encoding for English characters only. Smallest output for ASCII-only text.
  • ISO-8859-1: 8-bit encoding for Western European languages. Use when working with legacy systems.

URL-Safe Mode

Standard Base64 uses characters (+, /, =) that have special meaning in URLs. URL-safe Base64:

  • Replaces + with - (hyphen)
  • Replaces / with _ (underscore)
  • Removes trailing = padding

Line Splitting

For MIME-compliant output (email attachments, PEM certificates), enable line splitting. The standard line length is 76 characters, but you can customize this based on your requirements.

Technical Details

Our tool uses the browser's native encoding APIs for maximum performance and accuracy:

  • Files are processed in 4MB chunks for memory efficiency
  • TextEncoder/TextDecoder APIs handle character encoding
  • Large files can be processed without browser crashes
  • Output preview is limited to 10,000 characters for performance

Why Use Our Base64 Tool

Unlike many online Base64 tools, ours offers:

  • Multiple encoding options (UTF-8, ASCII, ISO-8859-1)
  • URL-safe Base64 support
  • Customizable line splitting for MIME
  • Large file support with chunked processing
  • Complete privacy - all processing happens locally
  • File upload and download capabilities

Whether you're a developer working with APIs, a system administrator handling certificates, or anyone needing to encode or decode Base64 data, our tool provides a fast, reliable, and private solution.

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters. It's commonly used to encode data that needs to be stored or transferred in text format, such as embedding images in HTML or sending binary data via email.

What's the difference between standard and URL-safe Base64?

Standard Base64 uses '+' and '/' characters which have special meaning in URLs. URL-safe Base64 replaces these with '-' and '_' respectively, and omits the padding '=' characters, making it safe for use in URLs and filenames.

Why would I split Base64 output into lines?

MIME specifications require Base64 encoded data to be split into lines of 76 characters. This is important for email attachments and other MIME-encoded content. Our tool lets you customize the line length based on your needs.

What encoding should I use for non-English text?

UTF-8 is recommended for most use cases as it supports all Unicode characters including non-English text, emojis, and special symbols. ASCII is limited to basic English characters, while ISO-8859-1 supports Western European characters.

Is there a size limit for Base64 encoding?

Our tool processes files in 4MB chunks, so there's no practical limit. However, keep in mind that Base64 encoding increases the data size by approximately 33%, so very large files will result in even larger encoded output.

Related Tools You Might Find Useful

Base64 Encoder/Decoder - Convert Text to Base64 Online | Mooflair Tools