Base64 Encoder / Decoder Online
A free online Base64 encoder and decoder. Instantly encode any text or file to Base64 and decode any Base64 string back to plain text, with full Unicode support, URL-safe mode, and file encoding.
Loading Base64 Tool...
🔒 Trust and Privacy Notice: This Base64 tool runs entirely in your browser using native JavaScript APIs. No text, data, or files you enter are ever sent to any server. Everything is processed locally on your device.
How to Encode Text to Base64
- Select the Encode tab at the top of the tool
- Type or paste your plain text into the input panel
- The Base64 encoded output appears instantly in the output panel
- Click Copy Encoded to copy the result to your clipboard
- Use the URL-Safe option if your Base64 string will be used in a URL or JWT token
How to Decode a Base64 String
- Select the Decode tab at the top of the tool
- Paste your Base64 encoded string into the input panel
- The decoded plain text appears instantly in the output panel
- The tool automatically handles whitespace and line breaks in the input
- Click Copy Decoded to copy the result to your clipboard
How to Encode a File to Base64
- Expand the Encode File to Base64 section
- Drag and drop any file or click to upload (max 5MB)
- The full Base64 encoded string and data URL are generated instantly
- If the file is an image, a live preview is shown from the Base64 data URL
- Copy the data URL to embed the file directly in HTML or CSS
Common Use Cases for Base64
- Embedding images directly in HTML as
<img src="data:image/png;base64,...">tags - Encoding binary data for transmission in JSON APIs which only support text
- Working with JWT (JSON Web Tokens) which use Base64url encoding
- Encoding email attachments in MIME format
- Storing small images or icons in CSS as data URIs
- Debugging and inspecting encoded API responses
- Passing binary data through URL query parameters
Key Features
- Real-time encoding and decoding — output updates as you type
- Full Unicode and special character support
- URL-safe Base64 mode (Base64url) for URLs, JWT, and filenames
- Line wrap options for PEM certificates and MIME encoding
- File to Base64 encoder with image preview
- Input/output character and byte size statistics
- Sample data buttons to explore the tool instantly
- Copy, paste, clear, and swap action buttons
- Works on all devices including mobile
- 100% free — no signup, no account, no data uploaded
Base64 vs Encryption — Important Distinction
Base64 is a data encoding scheme, not encryption. Encoding simply translates data into a different format so it can be safely transmitted. Anyone with the Base64 string can decode it instantly. It provides zero security and zero privacy protection. Never use Base64 to hide or protect sensitive information like passwords or API keys. If you need to protect sensitive data, you must use proper encryption like AES-256.
Frequently Asked Questions
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters. It uses 64 printable characters (A-Z, a-z, 0-9, +, /) to represent binary data, making it safe to transmit over text-based protocols like HTTP, email, and JSON.
How do I encode text to Base64?
Select the Encode tab, paste or type your text in the input panel, and the Base64 encoded output appears instantly in the output panel. You can then copy the encoded string with the Copy button.
How do I decode a Base64 string?
Select the Decode tab, paste your Base64 encoded string in the input panel, and the decoded plain text appears instantly. The tool automatically strips whitespace and line breaks that may be present in copied Base64 strings.
What is URL-safe Base64?
URL-safe Base64 (also called Base64url) replaces the + character with - and the / character with _ to make the encoded string safe for use in URLs, filenames, and JWT tokens without URL encoding. Enable the URL-Safe option in the tool to use this format.
Can I encode files to Base64?
Yes. Expand the Encode File to Base64 section, upload any file up to 5MB, and the tool generates the full Base64 encoded string and data URL for that file. Images are also previewed directly from the Base64 output.
Does Base64 encoding encrypt my data?
No. Base64 is an encoding scheme, not encryption. Anyone with the Base64 string can decode it back to the original content instantly. Do not use Base64 as a security or privacy measure. Use proper encryption like AES if you need to protect sensitive data.
Why does Base64 encoding increase the data size?
Base64 represents every 3 bytes of binary data as 4 ASCII characters, resulting in approximately 33% larger output than the original input. This size overhead is the trade-off for making binary data safe to transmit in text-based formats.
Is this Base64 tool free and private?
Yes. This tool is completely free with no account or signup required. All encoding and decoding happens entirely in your browser. No text or files you enter are ever sent to any server.
Related Tools
Image to Base64
Encode image to Base64 string or decode Base64 to image instantly. Fast and free.
URL Encoder / Decoder
Encode or decode URLs and query strings instantly in your browser. Free online URL encoding tool for developers.
JSON Formatter
Format, validate, and minify JSON online. Includes an advanced syntax checker and compare diffing.
Word Counter
Instantly calculate words, characters, sentences, paragraphs, Keyword Density and reading time.