Data -> Base64 Encoder
Encode data to Base64/Base64URL or decode Base64/Base64URL data using various character sets. Supports text and binary file uploads for encoding.
About Base64 <-> Data Conversion
This tool converts textual data or file content to Base64/Base64URL and vice versa. Base64 encoding represents binary data in an ASCII string format using a radix-64 representation, making it suitable for transmission over text-only channels. Base64URL is a variant using URL-safe characters. When a file is uploaded for encoding, its raw binary bytes are used.
Why Use This Tool?
Use this converter to: transmit binary data (like images or files) via JSON/XML or email bodies; make data URL-safe with Base64URL; or represent binary content in a printable ASCII format. It supports various character sets for decoding non-UTF-8 text data accurately.
Example Use Cases
- Encoding binary files (like images or executables) for embedding in text-based formats.
- Decoding Base64 strings from APIs, which might represent images, documents, or text in specific encodings.
- Preparing binary data for `data:` URIs (e.g., `data:image/png;base64,...`).
- Converting Base64 encoded text from legacy systems (e.g., ISO-8859-1) by selecting the correct character set for decoding.
Pro Tips
- Character Set for Decoding Text: Crucial for non-UTF-8 text. Select the original character set (e.g., ISO-8859-1) to avoid garbled output. Ignored if Base64 represents non-text binary data (downloadable as binary). Ignored when encoding uploaded files (binary data is used directly).
- Base64 vs. Base64URL: Use Base64URL for URLs or filenames. It avoids '+' and '/' and omits '=' padding.
- File Uploads for Encoding: When uploading a file in 'Data to Base64' mode, the tool reads its raw binary bytes for direct Base64 encoding, bypassing character set considerations for the file itself.