Base64 Encoder / Decoder

Encode and decode text or files as Base64, UTF-8 safe, with data URL output.

Text

Type or paste text; the output updates live. Encode / Decode set the direction, Swap flips it. Ctrl/⌘ + Enter runs again.

File to Base64

Base64 to file

How Base64 works

Base64 turns any sequence of bytes into plain text using 64 safe characters (A–Z, a–z, 0–9, + and /), padded with = at the end. Every 3 bytes become 4 characters, so the output is about 33% larger than the input. This tool encodes text correctly: it first converts your text to UTF-8 bytes, then encodes those bytes, so Chinese characters, accented letters and emoji round-trip where plain btoa() fails. Decoding reverses the process and reports when the input is not Base64 or decodes to binary rather than text. File mode turns any file into a Base64 string or a ready-to-use data URL.

Common questions

Privacy

Text and files are processed with browser APIs on your device. Nothing is uploaded, so credentials, private documents and internal images are safe here.