Skip to content
100% in your browser. Nothing you paste is uploaded — all processing runs locally. Read more →

Base64 Encoder & Decoder

Type or paste text on either side. The other side updates as you type. UTF-8 safe by default — emoji, CJK, accents all roundtrip correctly.

🔒 100% client-side · no upload · no account

What this does

Why client-side

Most "Base64 encoder" sites upload your text to their server, encode it there, and return the result. That's a privacy and bandwidth tradeoff for nothing — every modern browser has built-in base64 functions.

This tool uses btoa() (encode) and atob() (decode) plus the TextEncoder/TextDecoder APIs for UTF-8. Total JS for the page is under 10 KB. Nothing leaves your browser.

Common use cases

Programmatic equivalents

// JavaScript / Node
btoa(unescape(encodeURIComponent(text)));        // encode (UTF-8 safe)
decodeURIComponent(escape(atob(base64)));        // decode

// Python
import base64
base64.b64encode(text.encode("utf-8")).decode()
base64.b64decode(b64_string).decode("utf-8")

// Bash
echo -n "hello" | base64
echo -n "aGVsbG8=" | base64 -d

// Go
import "encoding/base64"
base64.StdEncoding.EncodeToString([]byte(s))

Common pitfalls

FAQ

Is the text I paste sent anywhere?

No. Encoding and decoding both run in your browser via the built-in btoa/atob APIs plus TextEncoder for UTF-8 handling. Open DevTools → Network and verify — no requests are made.

Why does my emoji break with plain btoa?

btoa only handles Latin-1 characters. For arbitrary Unicode (emoji, CJK, accents), the input must first be UTF-8 encoded to bytes. This tool does that — TextEncoder converts the string to UTF-8 bytes, then base64 encodes the bytes. Every other roundtrip works.

What's the size overhead?

Base64 encodes 3 input bytes as 4 output characters. So output is 4/3 ≈ 33% larger than input. Add ~1% for newline wrapping if enabled.

URL-safe — what's different?

Standard base64 uses + and /, which need URL-encoding. URL-safe (base64url, RFC 4648 §5) uses - and _ instead. Useful for JWT, query strings, and filenames. See the comparison.

Can I decode binary data?

Decoding works on any base64 input, but if the result isn't valid UTF-8 text (e.g. a PNG or binary protocol message), the text pane will show a decode error. Use the file converter for binary content.