Menu

Base64 Encoder

Developer Tools

Encode text to Base64

Example / Use Case

Encode Data for API Authentication

A developer needs to encode API credentials for HTTP Basic Authentication. They paste the credentials into the encoder and get the Base64 string.

Input

Text: username:password

Output

Encoded: dXNlcm5hbWU6cGFzc3dvcmQ=

How It Works

Base64 encoding is a method of converting binary or text data into a set of ASCII characters that can be safely transmitted over protocols that only support text. It uses 64 characters (A-Z, a-z, 0-9, +, /) to represent data.

The encoding process takes 3 bytes of input (24 bits) and represents them as 4 Base64 digits (each 6 bits). This results in approximately 33% larger output than the original data. Base64 is commonly used for encoding email attachments, embedding images in HTML/CSS, and transmitting binary data through JSON APIs.

The URL-safe variant replaces + and / with - and _ to avoid issues in URLs. For decoding Base64 back to text, use the Base64 Decoder tool.

How to Use

  1. 1Enter or paste text to encode into the input area
  2. 2Toggle URL-safe option if needed for web URLs
  3. 3Click the "Encode" button
  4. 4Copy the Base64 output to use in your application

Frequently Asked Questions

Base64 is a binary-to-text encoding scheme that represents binary data in ASCII string format using 64 printable characters.

Related Tools