Base64 Encoder & Decoder
Base64 decode and encode text or files in seconds, right in your browser. Paste a Base64 string to recover the original text, or type any text to convert it into a Base64 string — the result updates as you type, with nothing to install.
Base64 is a binary-to-text scheme that maps binary data onto printable ASCII characters, so binary content travels safely through text-only channels. This tool is built for developers working with Data URLs, JWT tokens, HTTP Basic auth, MIME email, and JSON or XML payloads that need to carry binary data as text.
How to Use
Choose Encode or Decode
Pick Encode (the default) to turn text into Base64, or switch to Decode to turn a Base64 string back into readable text.
Type, paste, or upload
Enter text or paste a Base64 string in the left panel. In Encode mode you can also click Upload File to encode any image, PDF, or other file. Need a quick test? Click Sample Data.
Tune the options
Turn on URL-safe for output that is safe in URLs, filenames, and JWT tokens, or Line Wrap to break the output every 76 characters for MIME email and PEM certificates.
Copy, download, or swap
The result appears instantly in the right panel. Use Copy or Download to save it, or Swap to move the output into the input and flip the mode for a quick round-trip check.
Features
Real-Time Encoding
Text is converted to Base64 as you type — no button to press, results refresh after a brief pause to stay smooth.
Real-Time Decoding
Paste a Base64 string and the original text appears instantly, with invalid input flagged right away.
File Upload Encoding
Upload any file — images, PDFs, or documents — to encode it as a Base64 string for inline embedding.
URL-Safe Variant
Swaps + and / for - and _ and drops padding, matching JWT tokens and web APIs.
MIME Line Wrapping
Wraps output at 76 characters per line (RFC 2045), the format used by email encoding and PEM certificates.
Data URL Detection
Decoding strips data:image/png;base64,… prefixes automatically, so you can paste a full Data URL.
One-Click Swap
Move the output back to the input and flip the mode to verify a round-trip encode and decode.
Size & Ratio Stats
The status bar reports input size, output size, and the encoding ratio (about 1.33x for standard Base64).
Copy & Download
Copy the result to your clipboard or download it as a text file to drop into your code.
UTF-8 Support
Encoding uses UTF-8, so international text, symbols, and emoji round-trip without corruption.
Frequently Asked Questions
What is Base64?
Base64 is a binary-to-text encoding that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, plus + and /). It lets binary content travel safely through systems that only handle text, such as URLs, email, and JSON.
How do I decode a Base64 string?
Switch to Decode mode and paste your Base64 string into the left panel. The original text appears instantly on the right. If the string is a full Data URL or uses the URL-safe variant, the tool detects and handles that for you.
Is Base64 encryption?
No. Base64 is encoding, not encryption. It offers no secrecy — anyone can decode a Base64 string back to its original form. Use it to transport data safely, never to protect it.
What is the difference between standard and URL-safe Base64?
Standard Base64 uses +, /, and =. URL-safe Base64 replaces + with -, / with _, and drops the trailing = padding, so the output is safe in URLs, filenames, and query parameters. Enable the URL-safe toggle to produce it.
How do I convert a Base64 string to an image?
This tool decodes Base64 to text and reports binary payloads as their byte size rather than rendering a preview. To embed an image, encode the file here and prefix the result with a Data URL header such as data:image/png;base64,, then use that string in your HTML or CSS src.
Why does Base64 make data larger?
Base64 represents every 3 bytes of binary data as 4 ASCII characters, so the output is roughly 33% larger than the input (a ratio near 1.33x). That overhead is the trade-off for being able to send binary data through text-only channels.
Can I encode any file type?
Yes. In Encode mode, click Upload File and pick any file — images, PDFs, audio, video, or archives. The tool reads the raw bytes and converts them to a Base64 string you can copy or download.
Is my data private?
Yes. All encoding and decoding happens in your browser with JavaScript — no text or file is uploaded to a server. You can confirm this by using the tool offline once the page has loaded.
No comments yet. Be the first to comment!