Is my data sent to any server?
No. All encoding and decoding happens entirely in your browser using JavaScript. Your text and files are never sent to any server, API, or third-party service. The tool works fully offline after the first page load.
dev-tools tool
Encode plain text or binary files to Base64 and decode Base64 strings back to text or files — entirely in your browser. Supports URL-safe encoding, MIME line breaks, file upload, drag and drop, and one-click copy as Data URI. No upload, no account, no limits.
Paste text or drop a file on the left to encode it to Base64. Paste a Base64 string to decode it back to text or download it as a binary file. Everything runs in your browser — nothing is sent to any server.
100% Private
All processing happens in your browser
No Limits
Encode and decode as much as you need
Secure
Your data never leaves your device
Free Tool
Completely free to use forever
Base64 Encoder & Decoder is a free browser-based tool for encoding and decoding Base64 strings. Paste plain text or drop any file into the input panel — the Base64 output appears instantly on the right. Everything runs in your browser. Your data is never sent to any server, API, or third party.
Auto-detect mode reads your input when you paste or drop a file and automatically switches between Encode and Decode. If the pasted content looks like a valid Base64 string, the tool switches to Decode mode. If it looks like plain text, it stays in Encode mode. You can override this at any time with the Encode / Decode toggle.
URL-safe encoding replaces + with -, / with _, and removes the = padding characters. This produces a Base64 string that is safe to use in URLs, query parameters, filenames, and HTTP headers — no percent-encoding required.
MIME line breaks insert a newline every 76 characters (configurable), producing the format required by email standards like RFC 2045 (MIME) and PEM certificate encoding. The line width is adjustable for any target format.
File encoding lets you upload any binary file — image, PDF, ZIP, font, audio — and convert it to a Base64 string. Use the Copy as Data URI button to get the complete data:{mime};base64,… URI, ready to paste into HTML, CSS, or JSON. Drag and drop a file directly onto the input panel — no file picker dialog needed.
File decoding works in the other direction: paste a Base64 string and click Download. The tool detects the file type from the decoded bytes (PNG, JPEG, PDF, ZIP, WebP) and downloads with the correct extension. The Swap button flips input and output and toggles the mode in one click — a workflow shortcut that most Base64 tools miss.
Size info below the panels shows input size, output size, and the percentage change. Encoding always produces output about 33% larger than the input — this is the fundamental trade-off of Base64.
+ with - and / with _ — required for URLs and filenames.data:… URI..base64.txt in encode mode, or decoded binary in decode mode.Most online Base64 tools are plain textareas with an encode button. This tool adds workflow features that cover real developer and designer use cases.
data:{mime};base64,… URI. Paste directly into <img src>, CSS url(), or JSON config. No image hosting needed for small assets.+// with -/_ and removes = padding, producing strings that are safe in URLs, query parameters, JWT tokens, and filenames without percent-encoding.No. All encoding and decoding happens entirely in your browser using JavaScript. Your text and files are never sent to any server, API, or third-party service. The tool works fully offline after the first page load.
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It was designed to safely transmit binary data over channels that only handle text, such as email (MIME), JSON payloads, and HTTP headers. The trade-off is a ~33% increase in data size compared to the original binary.
Standard Base64 uses + and /, which are reserved characters in URLs and must be percent-encoded as %2B and %2F. URL-safe Base64 (RFC 4648) replaces + with - and / with _, and removes the = padding. The result is safe to use in URLs, query parameters, JWT tokens, and filenames with no further encoding.
Click File in the input panel (or drag the file directly onto the panel). The file's binary content is encoded to Base64 and shown in the output. Click Copy as Data URI to get the complete data:{mime};base64,… string — ready to paste into an <img src> attribute, CSS background-image: url(), or a JSON field.
Switch to Decode mode, paste the Base64 string into the input, and click Download in the output panel. The tool decodes the Base64 to binary, detects the file type from the decoded bytes (PNG, JPEG, PDF, ZIP, WebP), and downloads with the correct extension. If the file type cannot be detected, it downloads with a .bin extension.
Base64 encodes every 3 bytes of binary data into 4 ASCII characters. 3 bytes = 24 bits; 4 Base64 characters = 4 × 6 bits = 24 bits. So the output is (4/3) = 1.333× the input size — approximately 33% larger. This is the fundamental trade-off: binary data becomes safe for text-only channels, but at a size cost.
MIME email standards (RFC 2045) require Base64-encoded data to be split into lines of no more than 76 characters. PEM format (used for SSL certificates and cryptographic keys) uses 64-character lines. Enable Line Breaks and set the width to 76 for MIME or 64 for PEM. The decoder in this tool automatically strips whitespace before decoding, so line-broken Base64 decodes correctly regardless.
A Data URI (also called a data URL) is a URL scheme that embeds file content directly in the URI instead of linking to an external resource. Format: data:{mime-type};base64,{base64-data}. For example: data:image/png;base64,iVBOR.... Data URIs let you embed images, fonts, and other assets directly in HTML or CSS — eliminating an HTTP request. Use Copy as Data URI in encode mode to get the complete URI.
Yes. The encoder uses the browser's TextEncoder API to convert text to UTF-8 bytes before encoding to Base64. The decoder uses TextDecoder to convert decoded bytes back to UTF-8 text. Emojis, CJK characters, Arabic, Hebrew, and all other Unicode text encode and decode correctly.
There is no enforced limit. The tool processes files entirely in your browser's memory. In practice, encoding large files (50 MB+) works but produces a very long Base64 string — around 67 MB of text — which may be slow to render in the output panel. For most use cases (images, PDFs, certificates, small archives), file sizes are well within range.