Base64 Encoder/Decoder
Encode and decode Base64 strings and files. Processing runs in your browser. Your data stays on your device.
Text to Encode
Output
Free Base64 Encoder and Decoder
Encode and decode Base64 strings and files in your browser. Use it for data URIs, API payloads, and quick file conversions.
Features
- Encode text to Base64
- Decode Base64 to text
- Encode files and images to Base64
- Decode Base64 to downloadable files
- URL-safe encoding option
- Image preview for encoded or decoded images
- Copy to clipboard
- Runs entirely in your browser
What is Base64?
Base64 turns binary data into ASCII text. It is common for images, files, and other binary payloads that need to travel over text protocols like HTTP and email.
Common use cases
- Embed images in HTML or CSS with data URIs
- Encode files for API transmission
- Inspect authentication tokens
- Prepare MIME email attachments
- Debug JWT payloads
How to Use Base64 Encoder/Decoder
- 1Choose between 'Text' or 'File' mode depending on what you want to encode/decode
- 2Select 'Encode' to convert to Base64, or 'Decode' to convert from Base64
- 3For text: paste your content in the input area
- 4For files: click or drag to upload your file
- 5Toggle 'URL-safe encoding' if you need Base64 for URLs
- 6Click the action button to process, then copy or download the result
Base64 Examples
Simple Text Encoding
Hello World → SGVsbG8gV29ybGQ=The text Hello World encoded as Base64
URL-Safe Encoding
Uses - and _ instead of + and / for URL compatibilityWorks in query parameters and URL paths
Data URI for Images
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...Put an image in HTML or CSS without a separate file
Related Tools
AI Image Analyzer
Analyze images with AI
URL Encoder/Decoder
Percent-encode a string for a URL, or decode %20 and %40 back to text
Hash Generator
Generate MD5, SHA-1, SHA-256 hashes
JSON Formatter
Format, validate, and minify JSON
Image Converter
Convert images between different formats
QR Generator
Create QR codes for any content
Frequently Asked Questions
What is Base64 encoding?
Base64 turns binary data into ASCII text. Developers use it when a protocol only accepts text, such as email MIME parts, HTTP bodies, or data URIs.
Is Base64 encoding secure?
Base64 is encoding, not encryption. Anyone can decode it, so do not use it to hide sensitive data.
Can I encode images to Base64?
Upload an image and convert it to a Base64 string. Data URIs use this form to embed an image in HTML or CSS.
What is URL-safe Base64?
URL-safe Base64 swaps + and / for - and _, and drops = padding, so the string works in URLs and filenames without extra escaping.
Is my data safe when using this tool?
Encoding and decoding run in your browser with JavaScript. The tool does not upload files or text.