Base64 Encoder & Decoder
Encode text or files to Base64, or decode Base64 strings back to readable text. Drag & drop files supported.
How to Use the Base64 Tool
To encode: Paste plain text in the input box and click "Encode". The Base64 representation appears in the output box.
To decode: Paste a Base64 string in the input box and click "Decode". The original text appears in the output box.
Auto Detect: Not sure if your input is Base64 or plain text? Click "Auto Detect" and the tool will figure it out.
File upload: Click "Upload File" or drag & drop any file onto the input area. The tool converts it to a Base64 data URI string.
What is Base64 Used For?
Data URIs in HTML/CSS — embed small images directly in code without separate HTTP requests. Example: <img src="data:image/png;base64,..." />
API authentication — HTTP Basic Auth encodes credentials as Base64 in the Authorization header.
Email attachments — MIME encoding uses Base64 to attach binary files to text-based email protocols.
JSON payloads — binary data (like images or PDFs) can be embedded in JSON as Base64 strings since JSON only supports text.
URL-safe tokens — session tokens and JWTs use a URL-safe variant of Base64 (replacing + with - and / with _).
Base64 vs Encryption
Base64 is not encryption. It's a reversible encoding — anyone can decode it. Never use Base64 to hide passwords, API keys, or sensitive data. For security, use proper encryption (AES, RSA) or hashing (SHA-256, bcrypt).
Frequently Asked Questions
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It uses 64 characters (A-Z, a-z, 0-9, +, /) to represent data. It's commonly used to embed images in HTML/CSS, transmit data in URLs, and encode email attachments.
Why would I need to encode something in Base64?
Common use cases include: embedding images directly in HTML or CSS (data URIs), sending binary data through text-only protocols like email (MIME), storing complex data in JSON or XML, and encoding authentication tokens for HTTP headers.
Does Base64 encrypt my data?
No. Base64 is encoding, not encryption. Anyone can decode Base64 back to the original data. It provides no security — it only changes the format. Never use Base64 to protect sensitive information.
Why does Base64 make data larger?
Base64 increases data size by approximately 33%. Every 3 bytes of input become 4 bytes of Base64 output. This is the trade-off for being able to represent binary data as safe ASCII text.
Can I encode files and images?
Yes! Click the "Upload File" button or drag and drop any file onto the input area. The tool will convert it to a Base64 string that you can embed in HTML, CSS, or use in API requests.
Is there a file size limit?
Since everything runs in your browser, the limit depends on your device's memory. For best performance, keep files under 5MB. Larger files may cause the browser to slow down.
Related Tools
JSON Formatter — Format, validate, and beautify JSON data.
Convert Case — Transform text between uppercase, lowercase, camelCase, and more.
View All Tools — Browse our complete collection of free online utilities.