Skip to content
Skip to main content
Free · No Signup100% Browser-basedUnlimited

Base64 Encoder / Decoder

Encode text to Base64 and decode Base64 back to text — UTF-8 safe, supports files up to 50MB, chunked processing for large inputs. 100% browser-based, no signup, no upload, unlimited.

Instant
100% Private
No Limit
Any Device
0 chars
0 chars

Encoding UTF-8 text via TextEncoder → bytes → chunked btoa. Output Base64 is ~33% larger than the input.

UTF-8 Safe Encoding

Uses the standard TextEncoder/TextDecoder pipeline — never mangles emoji, CJK, or other multi-byte characters like the naive `btoa(unescape(encodeURIComponent(...)))` shortcut does.

100% Private

All encoding and decoding happens in your browser. No file is ever uploaded — your text and binary data never leave your device. No signup, no cookies.

Chunked Processing

Input bytes are processed in 32KB chunks (and Base64 in 4-aligned chunks) to avoid the "Maximum call stack exceeded" crash that hits naive `String.fromCharCode(...hugeArray)` on large files.

Text & File Mode

Encode raw text or any file (images, PDFs, ZIPs). For decoded binary content the file type is auto-detected from magic bytes and the right extension is suggested on download.

Is this Base64 encoder/decoder safe for non-ASCII text (emoji, Chinese, etc.)?

Yes. Encoding uses `new TextEncoder().encode(text)` (which produces UTF-8 bytes) before applying `btoa`, and decoding reverses this with `new TextDecoder().decode(bytes)`. This is the correct UTF-8-safe pipeline. The shortcut `btoa(unescape(encodeURIComponent(text)))` you see in many older tutorials also works, but is harder to read and easier to get wrong.

Can I encode or decode files (images, PDFs, ZIPs)?

Yes. Tick "Encode a file instead" to switch to file mode. For encoding, drop in any file — it is read as an ArrayBuffer and converted to Base64 in 32KB chunks. For decoding, paste the file's Base64 into the textarea and the tool will reconstruct the original bytes; the file type is auto-detected from its magic bytes and the correct extension is suggested when you click Download.

Why does large input sometimes crash other Base64 tools?

The most common cause is `String.fromCharCode(...new Uint8Array(buffer))` — spreading the entire byte array as function arguments blows the call stack once the buffer is bigger than ~64KB. This tool processes the input in 32KB chunks (and Base64 in chunks that are always a multiple of 4 characters to stay aligned) so very large inputs are handled without overflowing the stack.

Is there a size limit?

There is a 50MB soft cap on the output size to prevent out-of-memory crashes on mobile devices. If your input produces a larger output, the tool will still try to process it but will show a warning. The browser will be slow or may crash on very low-memory devices (older phones, tabs with many other sites open).

My Base64 has "-" and "_" instead of "+" and "/". What's wrong?

That's the "URL-safe" Base64 variant (RFC 4648 §5). This tool only accepts the standard alphabet (A–Z, a–z, 0–9, "+", "/", and "=" padding) and will show a friendly error if it sees "-" or "_". Convert URL-safe to standard first (replace "-" with "+" and "_" with "/") and decoding will work.

Is anything uploaded to a server?

No. The tool is 100% client-side. There are no API calls, no server actions, no analytics on your input. You can verify this by opening your browser's DevTools Network tab — you will see zero requests when you encode or decode, even for very large files.

Ready to use the Base64 Encoder / Decoder?

Free, no signup, no watermark. 100% browser-based. Your data never leaves your device.

Open the tool