DevTools Hub

Base64 Encoder / Decoder

Encode and decode Base64 strings directly in your browser.

Runs locally
InputPlain text
42 chars
OutputBase64
Ready
RGV2VG9vbHMgSHViIHJ1bnMgbG9jYWxseSBpbiB5b3VyIGJyb3dzZXIu
Status
No errors found.

Examples

Base64 is useful when you need to safely transport text through systems that expect ASCII-compatible data.

How it works

Base64 rewrites arbitrary bytes using 64 printable characters, taking three bytes at a time and emitting four characters. That is why encoded output is about a third larger than the input, and why the length is always a multiple of four once padding is added.

It exists so that binary data can travel through channels that only accept text: email attachments, data URIs, JSON fields, and HTTP headers. It is an encoding, not encryption, and anyone can decode it.

Text is encoded as UTF-8 before conversion, so accented letters, non-Latin scripts, and emoji round-trip correctly. Decoding is strict: input that is not valid Base64, or that does not decode to valid UTF-8, reports an error rather than returning mangled characters.

Frequently asked questions

Is Base64 encryption?
No. It is a reversible encoding with no key and no secret. Anyone who has the string can decode it, so it protects nothing. Use it for transport, never to hide a password or a token.
What are the equals signs at the end of a Base64 string?
Padding. Input is processed three bytes at a time, and when the last group is short, one or two = characters fill the output to a multiple of four. So a string can end with one =, two, or none at all.
Why does my Base64 string fail to decode?
Usually it is Base64URL rather than standard Base64: it uses - and _ in place of + and /, and often drops the padding. Replace - with + and _ with /, restore the = padding, and it will decode.
Can I encode an image or a PDF file?
Not here. This tool works on text you type or paste, not on file uploads. Encoding a binary file requires reading its bytes, which is a separate feature.
Does Base64 handle emoji and accented characters?
Yes. Input is converted to UTF-8 bytes before encoding, so any character you can type is preserved exactly through a round trip.