Base64 Encoder / Decoder

Encode text or images to Base64 and decode Base64 strings back to readable text. Runs entirely in your browser.

How to Use

1

Choose Text or Image Mode

Click the "Text" tab to encode or decode plain text strings. Click the "Image" tab to convert an image file into its Base64 data URL representation.

2

Enter Your Input

For text mode, paste any plain text to encode it, or paste a Base64-encoded string to decode it. For image mode, click the upload area and select an image from your device.

3

Encode or Decode

In text mode, click "Encode to Base64" or "Decode from Base64". The result appears instantly in the output area. If the input is not valid Base64, an error message is shown.

4

Copy the Result

Click the "Copy" button next to the output area to copy the entire result to your clipboard. For images, the full data URL (including the data:image/...;base64, prefix) is copied.

Frequently Asked Questions

Base64 is an encoding scheme that converts binary data into a string of ASCII characters using a set of 64 printable characters (A–Z, a–z, 0–9, +, /). It was designed to allow binary data to be safely transmitted through text-only channels such as email bodies, JSON APIs, or HTML attributes.

Use Base64 when you need to embed binary data (like images or files) in a text-based format. Common uses include embedding small images directly in HTML or CSS as data URLs, encoding binary data in JSON API payloads, storing file attachments in email, and encoding credentials in HTTP Basic Authentication headers.

No. Base64 is an encoding scheme, not a compression algorithm. In fact, it increases the size of data by approximately 33% because every 3 bytes of binary data are encoded as 4 ASCII characters. If you need compression, use formats like gzip or Brotli before or after encoding.

No. Base64 is not encryption and provides no security. It is purely a way to represent binary data as printable text characters. Anyone can decode a Base64 string instantly — there is no key or secret involved. Never use Base64 to protect sensitive data. Use proper encryption (AES, RSA, etc.) for that purpose.

Base64 encoded data is roughly 33% larger than the original binary. For example, a 100 KB image becomes approximately 133 KB when Base64-encoded. This is because 3 bytes of input (24 bits) are represented as 4 Base64 characters (each representing 6 bits). Padding characters (=) are added to make the output length a multiple of 4.