Encode text or a file to Base64, or decode Base64 back to its original, instantly in your browser. Base64 turns binary data into plain ASCII so it can travel safely inside JSON, data URIs, JWTs, or HTTP headers. Everything runs on your device, so even sensitive payloads stay private.
| Input text | Base64 |
|---|---|
| Man | TWFu |
| hi | aGk= |
| Hello, World! | SGVsbG8sIFdvcmxkIQ== |
Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It's commonly used to embed image data in HTML/CSS, send binary data in JSON, or encode email attachments.
No. Base64 is an encoding, not encryption. It does not provide any security — it simply converts data to a text-safe format. Anyone can decode Base64 data.
Base64 encoding increases data size by approximately 33% because it uses 4 ASCII characters to represent every 3 bytes of binary data.
URL-safe Base64 replaces '+' with '-' and '/' with '_' so the encoded string can safely be used in URLs and filenames without needing percent-encoding.
This tool supports UTF-8, ASCII, ISO-8859-1 (Latin-1), and Windows-1252. UTF-8 is the recommended default as it supports the full Unicode character set.
Yes! Use the 'File to Base64' tab to convert any file to a Base64 string, or 'Base64 to File' to reconstruct a file from Base64 data. You can also specifically work with images using the dedicated image tabs.
Base64 encoding transforms binary data into ASCII characters using the btoa() function, which maps every 3 bytes (24 bits) into 4 printable characters from the Base64 alphabet. Decoding reverses this with atob(), converting the ASCII representation back into binary. For file encoding, the FileReader API reads uploaded files as ArrayBuffers, then Uint8Array views chunk the binary data for efficient Base64 conversion. Image previews are generated by constructing Data URIs (data:image/png;base64,...) that embed the encoded string directly into src attributes. The tool handles padding edge cases and supports both standard and URL-safe Base64 variants.