Base64 Encode / Decode
Encode text or files to Base64, or decode Base64 back to text. Supports URL-safe mode and Data URI output.
About This Tool
The Base64 Encode / Decode tool converts text and files to and from Base64 encoding directly in your browser. Base64 is a binary-to-text encoding scheme that represents binary data as an ASCII string, making it safe to embed in JSON, HTML, CSS, URLs, and email bodies.
All encoding and decoding is performed client-side using the browser's native btoa() / atob() and TextEncoder / TextDecoder APIs. Your data never leaves your machine — no server requests are made, and nothing is stored or logged.
The tool supports standard Base64 as well as URL-safe Base64, which replaces + with -, / with _, and strips padding characters. This variant is commonly used in JWTs, URL parameters, and filenames. You can also toggle Data URI output to generate a complete data: string suitable for embedding images, fonts, and other assets directly in HTML or CSS.
For file encoding, simply drag and drop a file onto the input area or click to browse. The file is read in the browser and converted to Base64. This is useful for embedding small images as Data URIs or for transferring binary payloads as text. In decode mode, you can download the decoded binary as a file.
How to Use
- Select Encode or Decode from the tabs.
- Type or paste text into the Input panel. The output updates instantly.
- To encode a file, drag it onto the drop zone or click browse.
- Toggle URL-safe for URL-compatible output, or Data URI to generate a complete data URL.
- In Decode mode, use the Download button to save decoded binary data as a file.
- Click Copy or press Ctrl+Shift+C to copy the output.
FAQ
Is my data safe?
Yes. All encoding and decoding runs in your browser. No data is sent to any server.
What is URL-safe Base64?
URL-safe Base64 replaces + with - and / with _, and removes trailing = padding. It's used when Base64 data needs to appear in URLs, filenames, or other contexts where standard Base64 characters may cause issues.
What is a Data URI?
A Data URI is a string of the form data:[mime];base64,[data] that embeds file content directly into HTML, CSS, or JavaScript. It's commonly used for small images and fonts to avoid extra HTTP requests.
Does it support Unicode text?
Yes. The tool uses TextEncoder / TextDecoder to handle full Unicode (UTF-8) text correctly.
How large a file can I encode?
There is no hard limit, but very large files (tens of MB) may cause your browser tab to slow down because the entire file is loaded into memory. For most practical uses — embedding images, encoding config files — the tool works flawlessly.
How do I decode Base64 back to a file?
Switch to Decode mode, paste the Base64 string, and click the Download button in the toolbar to save the decoded bytes as a file.
Related Tools
URL Encode/Decode
Encode and decode URLs, parse query parameters, and build query strings.
JSON Formatter
Format, validate, and beautify JSON with syntax highlighting and tree view.
JWT Decoder
Decode JSON Web Tokens to inspect header, payload, and verify signatures.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes for text and files.