ToolRun
🔐

Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 strings back to plain text. Supports UTF-8 encoding.

Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 strings. Supports UTF-8.

About the Base64 Encoder/Decoder

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is one of the most commonly used encoding methods in web development, used for embedding images in CSS, sending email attachments, encoding authentication credentials, and transmitting binary data over text-based protocols.

How Base64 Encoding Works

Base64 encoding takes every three bytes (24 bits) of binary data and converts them into four ASCII characters from a set of 64 characters: A-Z, a-z, 0-9, +, and /. If the input length is not a multiple of three, padding characters (=) are added to the output. This results in encoded output that is approximately 33% larger than the original data.

Common Uses of Base64

  • Data URIs: Embedding images directly in HTML or CSS using data:image/png;base64,... syntax, eliminating extra HTTP requests.
  • Email Attachments: MIME encoding uses Base64 to encode binary attachments in email messages sent over SMTP.
  • HTTP Authentication: Basic Authentication encodes username:password pairs in Base64 in the Authorization header.
  • JSON Web Tokens (JWT): JWTs encode their header and payload sections using Base64URL encoding.
  • API Payloads: Sending binary data (files, images) as part of JSON API requests.

Base64 vs Base64URL

Standard Base64 uses + and / characters, which are not safe for URLs. Base64URL replaces + with - and / with _, and omits the padding = characters. Base64URL is used in JWTs and anywhere encoded data appears in URLs or filenames.

Important Security Note

Base64 is an encoding scheme, not an encryption method. It provides no security whatsoever. Anyone can decode a Base64 string. Never use Base64 as a means of protecting sensitive data. Use proper encryption algorithms (AES, RSA) for security.

Frequently Asked Questions

Is Base64 encoding the same as encryption?
No. Base64 is an encoding scheme that converts binary data to text, and it can be reversed by anyone. It provides zero security. Encryption uses a secret key to transform data so that only someone with the key can reverse it. Never use Base64 to protect sensitive information.
Why does Base64 encoded data become larger?
Base64 represents every 3 bytes of input as 4 ASCII characters, resulting in output that is approximately 33% larger than the original data. This overhead is the trade-off for being able to safely transmit binary data over text-based protocols.
Can I encode images with this tool?
This tool is designed for text-to-Base64 and Base64-to-text conversion. For encoding images to Base64 data URIs, you would need to handle the binary file input separately. Our tool focuses on string encoding and decoding.
Does this tool support Unicode and special characters?
Yes. The tool properly handles UTF-8 encoding, so characters from any language, including emojis and special symbols, will be correctly encoded and decoded.

Related Tools