Text encoding, files, and privacy
UTF-8 is the default for text, supporting accented characters, non-Latin scripts, and emoji. Select Latin-1 under Advanced text encoding for compatibility with older byte-string workflows. Use the same encoding when encoding and decoding text.
Files are encoded as raw bytes, regardless of the text encoding setting. Decoding restores bytes exactly; the encoding setting only controls the text preview. Download binary results even when they cannot be displayed as UTF-8.
All text and file conversions run client-side in your browser. The tool does not send your input or files to a conversion server, avoiding upload delays and unnecessary backend requests. The page still loads normal site resources, analytics, and ads. Base64 is an encoding, not encryption.
Base64 Encoding
Base64 encoding is used to convert binary data into a text string using a set of 64 different ASCII characters. It's often used to encode data for transmission over media that are designed to deal with text.
Example in Python
These Python examples use UTF-8 and match the default text encoding in this workspace, including Unicode. For legacy Latin-1 text, use "latin-1" instead of "utf-8" when converting between text and bytes.
To encode a string in Base64:
import base64
# Original string
original_string = "Hello, World!"
# Encode the string
encoded_bytes = base64.b64encode(original_string.encode("utf-8"))
encoded_string = encoded_bytes.decode("utf-8")
print(encoded_string)
Base64 Decoding
Base64 decoding reverses the process of encoding, converting the Base64 encoded string back into its original binary form.
Example in Python:
To decode a Base64 string:
import base64
# Base64 encoded string
encoded_string = "SGVsbG8sIFdvcmxkIQ=="
# Decode the string
decoded_bytes = base64.b64decode(encoded_string)
decoded_string = decoded_bytes.decode("utf-8")
print(decoded_string)
Base64 encoding increases the original data size by approximately 33%. To understand the exact increase and validate storage or transmission limits, check the encoded string size in bytes using our calculator.
❤️ Liked this tool?
If it saved you time, consider buying me a coffee to support future improvements.