Skip to content

Base64 Encoder / Decoder

Convert text and files to and from Base64 right in your browser.

About the Base64 Encoder / Decoder

Base64 is a binary-to-text encoding that represents arbitrary bytes using only 64 ASCII characters. It's used everywhere modern data can't be sent raw — embedding images inside CSS data URIs, attaching files to email (MIME), passing binary payloads through JSON APIs, and storing credentials in environment variables (for example, basic HTTP authentication).

This tool encodes and decodes both text and files. File support is binary-safe and handles content of any type — images, PDFs, JSON, certificates — directly inside your browser.

How it works

Text mode uses the browser's TextEncoderto convert your input to UTF-8 bytes, then encodes those bytes with the standard Base64 alphabet (A–Z, a–z, 0–9, '+', '/') with = padding to align to four-character groups.

File mode reads the dropped or selected file via FileReader.readAsArrayBuffer and encodes the bytes directly — so you can encode binary files without any UTF-8 round-trip corruption. Decode mode reverses the process and offers a download for the resulting bytes.

Privacy

All encoding and decoding happens in your browser. Files you drop in are never uploaded — they're read with FileReader and processed locally. Closing the tab wipes everything from memory.

Frequently asked questions

Is Base64 encryption?
No. Base64 is encoding, not encryption. Anyone can decode a Base64 string instantly with no key. Don't use Base64 to 'hide' secrets — use proper encryption (AES, age, libsodium) instead.
Why does encoded output sometimes end with '=' or '=='?
Base64 groups input bytes into triplets and outputs four characters per triplet. When the input length isn't a multiple of three, the encoder pads the final group with '=' characters so decoders can recover the original byte count.
What's the difference between standard Base64 and URL-safe Base64?
URL-safe Base64 replaces '+' with '-' and '/' with '_' so the encoded string can be used in URLs and filenames without escaping. It also commonly omits trailing '=' padding. JWT tokens use URL-safe Base64.
Can I encode large files here?
Yes, up to your browser's memory limit — typically hundreds of MB on desktop. The whole file is held in memory while encoding, so very large files may take a moment on lower-end devices.
Why is the encoded version about 33% larger?
Base64 represents 3 input bytes using 4 output characters, so the encoded size is roughly 4/3 of the original. Add padding overhead and the practical inflation is about 33–37%.

Other free utilities that pair well with this one.