Base64 Encode / Decode
Encode text or a whole file as Base64, or decode Base64 back to text or a file. Supports the URL-safe alphabet and 76-character MIME line wrapping. Runs entirely in your browser — nothing is uploaded.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Drop a file here, or browse
Files stay on your device.
Ctrl+V to paste an image
Text is processed on this device. If a file is selected, the file is used instead.
Options
Name for the file produced when decoding. Files only.
Drop a file above to begin
Your file are processed on this device and never uploaded.
How it works
Encoding and decoding text
In the default encode direction, typed text is converted to UTF-8 bytes and then to the standard RFC 4648 alphabet, so emoji and non-Latin scripts round-trip exactly rather than throwing like the naive atob and btoa pair. The decode direction accepts a Base64 string and turns it back into UTF-8 text, flagging a replacement character when the bytes are not valid text so you know the payload was something else. The URL-safe toggle swaps the plus and slash for hyphen and underscore and drops the padding, which is the alphabet for query strings and JWTs, and MIME wrap breaks encoded text every 76 characters for old mail software.
Encoding and decoding a whole file
When a file is dropped on the workbench it wins over any pasted text, which the notes say plainly. Encoding reads the file in chunks so even a large binary is encoded without blowing the call stack, and hands back a .base64.txt download with a copy shown in the report. Decoding reads the file as text, so it accepts a data URI as well as a bare Base64 string — a truncated or malformed payload is an error, never a partial file — and the result downloads under the name you set, defaulting to decoded.bin.
Lenient text versus strict files
The two paths apply different rules. Typed text is decoded leniently: surrounding whitespace is ignored, the URL-safe alphabet is accepted on input even when the toggle is off, and missing padding is added. A file is decoded strictly: it must be a complete, correctly padded string of the standard alphabet (after stripping whitespace or a data-URI prefix) or it is rejected outright. That asymmetry means a quick decode of a pasted value tolerates your formatting, while turning a dropped file back into bytes never silently returns a truncated copy.
Where the conversion happens
Both directions run in the browser with no network request. Text is encoded or decoded with the Web TextEncoder and TextDecoder, and files are read, converted and handed back entirely in the tab. Nothing is uploaded, so a file you convert for embedding in a page, an email or an API call stays on your machine, and the same is true for any Base64 you paste in to reverse.
Questions
Does this handle Unicode correctly?
Yes. Text is encoded as UTF-8 first, so emoji and non-Latin scripts round-trip exactly. The naive btoa() approach throws on those; this tool does not.
What is the URL-safe alphabet?
RFC 4648 §5 replaces + with - and / with _ so the value is safe in URLs and filenames. Padding = is usually omitted.
Can it encode a whole file?
Yes — drop a file on the workbench and it is encoded as a .base64.txt download. If a file is selected it is used instead of any text you typed.
Related tools
See categoryBase32 Encode / Decode
RFC 4648 Base32 and Crockford Base32 encoding and decoding of text.
URL Encode / Decode
Percent-encode or decode text for use in URLs — component or whole-URL mode.
Hex Encode / Decode
Convert text to and from hexadecimal (UTF-8), with configurable separators.
JWT Decoder
Decode a JSON Web Token and pretty-print its header and payload. Does not verify the signature.