Base64 Encoder / Decoder — Online & Free
Encode text and files to Base64. Decode Base64 strings back to original content. Supports URL-safe Base64. All processing happens in your browser — no data sent to any server.
Text to Base64
Base64 to Text
File to Base64
Click to select a file or drag & drop here
Any file type, up to 10 MB. Processing happens in your browser.What Is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is widely used to encode data that needs to be stored or transferred over media designed to handle text — such as email (MIME), URLs, JSON payloads, and data URIs for embedding images in CSS or HTML.
Base64 uses a character set of 64 printable characters: A-Z, a-z, 0-9, plus + and /, with = as a padding character. A URL-safe variant replaces + with - and / with _ to avoid URL encoding issues.
Base64 Encoder — Text to Base64
Paste any plain text and convert it to a Base64 string instantly. The encoder handles Unicode characters (including emoji and non-Latin scripts) by first converting the text to UTF-8 bytes, then encoding those bytes to Base64. Enable URL-safe Base64 if you plan to use the result in a URL or filename.
Base64 Decoder — Base64 to Text
Paste a Base64-encoded string and decode it back to its original text. The decoder validates the input and shows a clear error if the string is not valid Base64. If your input uses URL-safe encoding (with - and _), enable the URL-safe checkbox before decoding.
File to Base64 — Data URIs & Embeddings
Convert any file — images, PDFs, audio, or binary data — to a Base64 string. This is useful for creating data URIs that embed small assets directly in HTML or CSS, generating Base64 payloads for APIs, or encoding attachments for email. Drag and drop any file onto the drop zone, or click to browse. Files are processed locally in your browser; nothing is uploaded.
Common Base64 Use Cases
- Data URIs in HTML/CSS: Embed small images directly in stylesheets or markup without separate HTTP requests
- JSON APIs: Encode binary data (images, audio, PDFs) as strings inside JSON payloads
- Email attachments (MIME): Email protocols are text-based; binary attachments are Base64-encoded for transmission
- Basic Authentication headers: The
Authorization: Basicheader encodes username:password as Base64 - JWT tokens: JSON Web Tokens use Base64url encoding for their header and payload segments
- URL parameters: URL-safe Base64 encodes binary data in query strings without percent-encoding issues
Frequently Asked Questions
Is this Base64 tool free?
Yes, completely free. No signup, no usage limits, no API calls. Everything runs in your browser.
Does this tool send my data to a server?
No. All encoding, decoding, and file processing happens 100% client-side in your browser using JavaScript. Your data never leaves your machine. This makes it safe for sensitive files, credentials, and proprietary data.
What is the difference between standard and URL-safe Base64?
Standard Base64 uses + and / characters, which can cause issues in URLs because they have special meaning. URL-safe Base64 (also called Base64url) replaces them with - and _, making the output safe to use in URLs and filenames without additional encoding.
Can I encode files larger than 10 MB?
The file encoder works with files up to roughly 10 MB. Larger files may cause browser performance issues because the entire file is loaded into memory for Base64 encoding. For very large files, consider using a command-line tool like base64 on Unix systems or PowerShell on Windows.
How do I use a Base64-encoded image in HTML?
Use a data URI: <img src="data:image/png;base64,iVBORw0...">. Encode your image file with this tool, then prepend data:image/png;base64, (replace png with the correct MIME type) before the Base64 string.
Is Base64 encryption?
No. Base64 is an encoding, not encryption. It does not provide security or confidentiality — anyone can decode a Base64 string instantly. If you need to protect sensitive data, use proper encryption (such as AES) and never rely on Base64 alone.