Skip to main content

Base64 Encoder

Turn text or small files into Base64 for data URIs, APIs, or safe transport—preview and copy in one click.

File Upload

Switch to Decoder
Characters: 0 | Bytes: 0 | MB: 0.00 | Words: 0
Characters: 0 | Bytes: 0 | MB: 0.00 | Words: 0

About Base64 Encoding

What is Base64?

Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format.

Common Uses

  • • Embedding images in HTML/CSS
  • • Storing binary data in JSON
  • • Email attachments
  • • API data transmission

Encode text, files, and binary data to Base64 format for safe transmission in JSON, HTML, APIs, and email. Base64 encoding converts binary data into ASCII characters, making it suitable for text-based protocols and storage systems. Our tool supports both text input and file uploads, with real-time encoding and copy functionality.

What is Base64 Encoder?

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It uses 64 characters (A-Z, a-z, 0-9, +, /) to encode data, with '=' used for padding. Base64 encoding increases the size of data by approximately 33%, but ensures compatibility with systems that only handle text data.

Common Use Cases

  • Embedding images in HTML or CSS using data URIs
  • Storing binary data in JSON APIs where raw binary isn't supported
  • Email attachments encoded in MIME format
  • Data URLs for inline resources in web pages
  • API payloads that need to include binary data
  • Storing encrypted data in text-based databases
  • Encoding credentials or tokens for HTTP Basic Authentication

How It Works

The Base64 encoder takes your input (text or file) and converts each byte into a 6-bit value, which is then mapped to one of 64 ASCII characters. The encoding process groups input bytes into 24-bit chunks, splits them into four 6-bit values, and maps each to a Base64 character. If the input length isn't divisible by 3, padding characters ('=') are added to complete the encoding.

Examples

Encoding simple text

Input:
Hello, World!
Output:
SGVsbG8sIFdvcmxkIQ==

Encoding a JSON-friendly string

Input:
user@example.com
Output:
dXNlckBleGFtcGxlLmNvbQ==

ThenCatch is a free developer toolkit. Learn more about us.