{ }HttpStatus.com

Base64 Encode / Decode

This tool encodes plain text to Base64 and decodes Base64 back to plain text, entirely inside your browser. It handles full UTF-8 input correctly, so accented characters, emoji and non-Latin scripts round-trip without corruption, and it includes a URL-safe base64url mode for values that need to be embedded in URLs or JWTs. Nothing you type is sent anywhere.

0 characters

0 characters

How it works

Base64 is an encoding scheme that maps arbitrary binary data to a set of 64 printable ASCII characters, so that data which might otherwise contain control characters or non-text bytes can be safely embedded in places that expect plain text — email attachments, data URLs, HTTP headers and JSON strings among them. It's an encoding, not a cipher: anyone can decode it back to the original bytes with no key required, so it should never be treated as a way to hide or protect sensitive data.

Encoding text takes each group of three input bytes and maps it to four Base64 characters drawn from the standard alphabet, padding the final group with = characters when the input length isn't a multiple of three. Because JavaScript strings are Unicode, this tool first converts your text to its UTF-8 byte representation before encoding, which is what makes accented letters, emoji and other multi-byte characters decode back correctly instead of turning into garbled output — a common bug in naive Base64 implementations that skip this step. Decoding simply reverses the process: the Base64 characters are mapped back to bytes, and those bytes are interpreted as UTF-8 text.

The URL-safe base64url variant swaps the standard alphabet's + and / characters for - and _, and typically omits the trailing = padding, so the result can be used directly inside a URL path, query string, or JWT segment without needing further escaping.

All of this runs as JavaScript in the page you're looking at. Nothing you type is transmitted to any server — the encoding and decoding happen entirely on your device.

Frequently asked questions

Why did decoding my Base64 string produce garbled text?

This usually means the original text contained multi-byte UTF-8 characters and was encoded without accounting for byte length, or the string was truncated and is missing its padding. Make sure you're encoding and decoding with matching UTF-8 handling.

What's the difference between Base64 and base64url?

They use the same underlying scheme, but base64url replaces the + and / characters with - and _ and usually drops the = padding, so the output is safe to use directly inside a URL or filename without extra escaping.

Is Base64 encryption?

No. Base64 is just a reversible encoding with no key involved — anyone can decode it instantly. Never use it as a substitute for actual encryption when you need to protect data.

Why does encoded output end with one or two = characters?

Base64 processes input in groups of three bytes; when the final group has only one or two bytes, = characters pad it out to a full four-character block so decoders know exactly how many bytes to expect.

Can I encode or decode binary files, not just text?

This tool is built for text input and output. Base64 itself works on any bytes, but pasting raw binary data as text in a browser field isn't reliable — for files, a dedicated file-to-Base64 tool that reads bytes directly is a better fit.

Related status codes

Related tools