What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a sequence of printable ASCII characters. It is widely used in web development, email systems, and data storage to safely transmit binary data through text-based protocols.
This tool lets you encode text or files to Base64 and decode Base64 strings back to their original form — all instantly in your browser with no server processing.
Common Use Cases
Embedding Images
API Authentication
Email Attachments
Data Storage
JWT Tokens
How to Use
Encode Text to Base64
Select Mode
Make sure Encode mode is selected (default)
Input Text
Type or paste your text in the left panel
Get Result
The Base64 result appears instantly in the right panel
Save Output
Click Copy or Download to save the result
Decode Base64 to Text
Switch Mode
Click Decode to switch mode
Paste Base64
Paste a Base64 string in the left panel
View Result
The decoded text appears instantly in the right panel. Data URLs (e.g., data:image/png;base64,...) are automatically detected
Encode a File
Upload File
In Encode mode, click the Upload button
Select File
Select any file — the tool reads and encodes it to Base64
Use Result
Copy the result to embed in your code or save as a text file
Available Options
URL-Safe
Replaces + with -, / with _, and removes padding =. Useful for URLs, filenames, and JWT tokens.
Line Wrap
Inserts a line break every 76 characters, following the MIME standard used in email encoding.
Swap
Moves the output to the input and switches mode, so you can quickly verify a round-trip encode/decode.
Features
Real-Time Conversion
Text is encoded or decoded as you type — no need to press a button. Results update instantly with a short delay to keep things smooth.
File Upload Support
Upload any file (images, PDFs, documents) to encode it as a Base64 string. This is useful for embedding assets directly in HTML, CSS, or JSON without external file references.
URL-Safe Base64
Standard Base64 uses +, /, and = characters that can cause issues in URLs and filenames. The URL-safe variant replaces these with -, _, and removes trailing padding — commonly used in JWT tokens and web APIs.
Line Wrapping (MIME)
When enabled, output is wrapped at 76 characters per line following the MIME standard (RFC 2045). This format is used in email encoding and PEM certificates.
Data URL Detection
When decoding, the tool automatically detects and strips Data URL prefixes like data:image/png;base64,..., so you can paste the full Data URL without manually removing the prefix.
Size Statistics
The status bar shows the input size, output size, and the encoding ratio. Standard Base64 encoding increases data size by approximately 33% (ratio ~1.33x).
Frequently Asked Questions
What is the difference between Base64 and URL-safe Base64?
Standard Base64 uses +, /, and = characters. URL-safe Base64 replaces + with -, / with _, and removes padding =. This makes the output safe to use in URLs, filenames, and query parameters without additional encoding.
Why does Base64 encoding increase the file size?
Base64 represents 3 bytes of binary data as 4 ASCII characters. This results in approximately 33% size increase (ratio ~1.33x). This is a trade-off for being able to safely transmit binary data through text-only channels.
Can I encode any file type?
Yes. You can encode any file — images, PDFs, audio, video, archives, or any binary file. The tool reads the raw bytes and converts them to Base64 text.
What does Line Wrap do?
Line Wrap inserts a line break every 76 characters, following the MIME standard (RFC 2045). This format is required for Base64 content in email (MIME encoding) and PEM certificates. Most modern applications do not require line wrapping.
Is my data safe?
Yes. All encoding and decoding happens entirely in your browser using JavaScript. No data is sent to any server. You can verify this by using the tool offline after the page loads.
What character encoding is used?
The tool uses UTF-8 encoding by default, which supports all Unicode characters including international text, emoji, and special symbols.
No comments yet. Be the first to comment!