Raw byte count
0
Free 路 Instant 路 No signup
UTF-8 and emoji-safe encode/decode, Standard or URL-safe, with byte telemetry.
Raw byte count
0
Encoded byte count
0
Inflation
+0.0%
Line count
0
window.btoa is a Latin-1 function. Pass it a string with emoji or a non-BMP character and the browser throws. Data URLs, HTTP basic auth, and JSON web token segments all expect Base64 (or base64url) of bytes, not of UTF-16 code units. This page walks TextEncoder to get UTF-8 bytes, builds a binary string, then calls btoa. Decode reverses with atob and TextDecoder. Conversion is live: there is no submit button.
Mode Encode treats the left pane as plaintext. Mode Decode treats it as Base64. Standard alphabet uses + and / with = padding. URL-safe uses - and _ and strips padding, which is what JWTs and many query parameters need. Decode always accepts both alphabets.
bytes = TextEncoder.encode(str)btoa(binaryFromBytes)inflation % = (encoded - raw) / raw x 100
Telemetry reports raw UTF-8 bytes, encoded string bytes, inflation percent, and line count of the current input. Empty input zeros the cards and clears output. Swap exchanges the panes and flips Encode/Decode so you can round-trip a sample. Load sample text includes caf茅, na茂ve, and a wave emoji so you can confirm Unicode does not throw.
Garbage characters in decode mode are caught. The alert region is assertive. The script does not stop. Copy uses the Clipboard API with a 1px on-screen textarea fallback if permission is denied. Labels return to Copy output after two seconds (Copied! or Copy failed).
This is a text tool. It will not hash files, wrap MIME 76-character lines, or implement Base32. For JSON pretty-print after you decode a payload, open the JSON Formatter and Minifier. For compact tokens that look like Base64 but are three segments, use the JWT Decoder instead of decoding the whole string as one blob.
Padding: Standard output includes = when needed. URL-safe output does not. Some servers reject unpadded strings; some reject padded URL-safe strings. Match the consumer. Copy the output you see, not a remembered variant from another site.
Three bytes become four Base64 characters. That is +33.3% before padding. Short strings pad up to a multiple of 4, so inflation can sit above 33%. Decode mode still reports raw as the recovered plaintext bytes and encoded as the Base64 you typed, so the ratio stays meaningful. If inflation is 0% you are probably looking at empty input.
Nothing is posted. Treat this as a scratch pad for snippets, not a vault. Clear wipes both panes. If you need YAML rather than Base64, use the JSON to YAML Converter on the same site.
btoa throws a DOMException on code points above 255. Emoji and most non-Latin UTF-8 will fail. This page encodes with TextEncoder to bytes, then btoa on a binary string, and reverses with atob plus TextDecoder. That is the usual browser-safe UTF-8 Base64 path.
Standard uses + and / and pads with = to a multiple of 4. URL-safe replaces + with -, / with _, and strips padding. Decode accepts both: - and _ are mapped back, then = is added until the length is divisible by 4.
Raw byte count is TextEncoder.encode(plaintext).length. Encoded byte count is the UTF-8 length of the Base64 string. Inflation % = (encoded - raw) / raw x 100. Classic Base64 expands 3 bytes to 4 characters, about +33.3% before padding.
atob throws. The catch path shows a live alert, clears the output, and leaves the script running. Empty input is not an error: telemetry resets to zeros. Copy stays disabled until output is non-empty.