Base64 Encode and Decode Online

Convert text to and from Base64, for example when working with API tokens, MQTT payloads or data URLs.

Output

Runs entirely in your browser. Nothing you enter is sent anywhere.

How it works

Base64 represents binary data using 64 printable characters (A–Z, a–z, 0–9, + and /), turning every 3 bytes into 4 characters, so encoded data is about 33% larger. '=' padding fills the last group.

Text is converted to UTF-8 bytes first, so Indian-language text and emoji encode correctly. The URL-safe variant swaps + and / for - and _ and drops padding, as used in JWTs. Base64 is an encoding, not encryption; anyone can decode it.

Encoded length = 4 × ceil(bytes / 3)

Worked example

The text 'CrimsonEdge' is 11 bytes and encodes to 'Q3JpbXNvbkVkZ2U=' (16 characters, one '=' of padding). Decoding that string gives back 'CrimsonEdge'.

Frequently asked questions

Is Base64 secure?

No. It's a reversible encoding for moving binary data through text-only channels. Never use it to hide passwords or keys.

Why does decoding fail?

The input contains characters outside the Base64 alphabet, has been cut short, or is URL-safe Base64; tick the URL-safe option for strings with - and _.

Related tools