Base64 encode/decode · Guide
Base64 Encode Online: Text and Files in Your Browser
Encoding to Base64 online should be instant and private. This encoder runs entirely in your browser, which matters because the things people encode — tokens, certificates, config fragments — are exactly the things that should not be pasted into a remote service.
What the encoder does with your input
Text is converted to UTF-8 bytes first, then those bytes are encoded. This is worth knowing because encoding is defined over bytes, not characters: the same visible text in a different encoding produces a different Base64 string.
Files are read exactly as stored, with no newline translation. The output therefore matches base64 file on the command line byte for byte.
Padding, wrapping and the alphabet
Standard Base64 output has a length divisible by 4, padded with one or two = characters. Some tools strip the padding; most decoders tolerate its absence, but strict ones do not, so keep it unless a spec says otherwise.
MIME-style Base64 wraps lines at 76 characters. That breaks anything expecting a single-line value — a Kubernetes secret, an Authorization header — so this encoder emits one unbroken line, matching base64 -w 0.
If the value goes into a URL or a JWT you need base64url instead: - and _ replace + and /, and padding is normally dropped.
What encoding is not
Base64 is a transport encoding, fully reversible by anyone, with no key involved. A Base64 blob in a log file or a URL is plaintext for security purposes.
It also grows the data by about 33%, so it is a poor choice for anything large. Encode when a channel demands text — JSON, email, an env var — not as a default.
Frequently asked questions
Is my input uploaded?
No. Encoding happens in your browser; text and files never leave your machine.
Why does my output differ from the terminal?
Usually a trailing newline (echo adds one) or line wrapping. Use printf %s and base64 -w 0 to match.
Does Base64 make data secure?
No. Anyone can decode it. Encrypt first if the content must stay private.
Ready to try it?
Open the free browser-based Base64 encode/decode and apply what you just read — no sign-up, runs locally.
Open the Base64 encode/decode tool